io.github.Blite-HQ/qnexus-mcp

السجل الرسمي أدوات المطورين

MCP server for Quantinuum Nexus, wrapping the qnexus SDK. Not affiliated with Quantinuum.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package qnexus-mcp
Claude Code
claude mcp add qnexus-mcp -e 'QNEXUS_MCP_TOOLSETS=<QNEXUS_MCP_TOOLSETS>' -e 'QNEXUS_MCP_ALLOW_SPEND=<QNEXUS_MCP_ALLOW_SPEND>' -e 'QNEXUS_MCP_ALLOW_HARDWARE=<QNEXUS_MCP_ALLOW_HARDWARE>' -e 'QNEXUS_MCP_ALLOW_DESTRUCTIVE=<QNEXUS_MCP_ALLOW_DESTRUCTIVE>' -e 'QNEXUS_MCP_MAX_CREDITS=<QNEXUS_MCP_MAX_CREDITS>' -e 'QNEXUS_MCP_MAX_OUTCOMES=<QNEXUS_MCP_MAX_OUTCOMES>' -e 'QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE=<QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE>' -e 'QNEXUS_MCP_PROJECTS=<QNEXUS_MCP_PROJECTS>' -- uvx qnexus-mcp==0.2.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "qnexus-mcp": {
            "command": "uvx",
            "args": [
                "qnexus-mcp==0.2.0"
            ],
            "env": {
                "QNEXUS_MCP_TOOLSETS": "<QNEXUS_MCP_TOOLSETS>",
                "QNEXUS_MCP_ALLOW_SPEND": "<QNEXUS_MCP_ALLOW_SPEND>",
                "QNEXUS_MCP_ALLOW_HARDWARE": "<QNEXUS_MCP_ALLOW_HARDWARE>",
                "QNEXUS_MCP_ALLOW_DESTRUCTIVE": "<QNEXUS_MCP_ALLOW_DESTRUCTIVE>",
                "QNEXUS_MCP_MAX_CREDITS": "<QNEXUS_MCP_MAX_CREDITS>",
                "QNEXUS_MCP_MAX_OUTCOMES": "<QNEXUS_MCP_MAX_OUTCOMES>",
                "QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE": "<QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE>",
                "QNEXUS_MCP_PROJECTS": "<QNEXUS_MCP_PROJECTS>"
            }
        }
    }
}

متغيرات البيئة

  • QNEXUS_MCP_TOOLSETS Comma-separated toolsets: read,execute,manage,destructive (default: read).
  • QNEXUS_MCP_ALLOW_SPEND Permit credit-spending (HQC) execution (default: false).
  • QNEXUS_MCP_ALLOW_HARDWARE Permit real-QPU targets (default: false).
  • QNEXUS_MCP_ALLOW_DESTRUCTIVE Permit delete/cancel/archive tools (default: false).
  • QNEXUS_MCP_MAX_CREDITS Hard per-call HQC ceiling; 0 blocks all spend (default: 0).
  • QNEXUS_MCP_MAX_OUTCOMES Top-N cap on distinct measurement outcomes returned per result item (default: 100).
  • QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE Sliding-window submission cap; each circuit in a batch counts as one (default: 6).
  • QNEXUS_MCP_PROJECTS Comma-separated project allowlist, enforced on every mutating tool (default: all projects).

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. qnexus-mcp
  2. Status
  3. Requirements
  4. 1. Authenticate (once)
  5. 2. Add the server to your MCP client
  6. Configuration
  7. Safety
  8. Contributing
  9. License

qnexus-mcp

A community Model Context Protocol (MCP) server for Quantinuum Nexus, wrapping the official qnexus Python SDK so any MCP-speaking agent (Claude Code, Cursor, VS Code, Codex, …) can inspect Nexus and, opt-in, run circuits on the free emulator.

Not affiliated with, endorsed by, or an official product of Quantinuum. "Quantinuum" and "Nexus" are trademarks of their respective owners, used here nominatively to describe compatibility.

Status

Early development. Read-only by default. Design and rationale live in docs/DESIGN.md; the research behind it is in docs/research/.

Requirements

  • Python 3.10+ and uv (the uvx command). On Windows, note the full path to uvx.exe (where uvx in a terminal) — GUI clients don't inherit your shell PATH.
  • A Quantinuum Nexus account.

1. Authenticate (once)

qnexus-mcp never handles your Nexus token. Authenticate out-of-band with the qnexus CLI (it opens your browser):

uvx --from qnexus qnx login

Inside Nexus JupyterHub, authentication is automatic; do not run qnx login there.

2. Add the server to your MCP client

The launch command is the same everywhere — only the config file differs per client:

uvx qnexus-mcp==0.2.0                              # read-only (default)
uvx qnexus-mcp==0.2.0 --toolsets read,execute      # + run circuits on the free H2-1LE emulator

Pin a version (==0.2.0): uvx otherwise resolves the latest PyPI release on every launch — unpinned installs are neither reproducible nor auditable. Avoid 0.1.0 on Windows: its first tool call hangs (fixed in 0.2.0).

What to expect on startup: the first ever launch downloads the quantum SDK stack (1–3 min); every launch takes ~30 s before the server responds — the SDK is imported up front, before the MCP handshake. "Waiting for server to respond to initialize" during that window is normal.

Claude Desktop

Settings → Developer → Local MCP servers → Edit Config (always use this button — the Microsoft Store build keeps the file under %LOCALAPPDATA%\Packages\Claude_*\..., not %APPDATA%\Claude), then add:

{
  "mcpServers": {
    "nexus": {
      "command": "C:\\Users\\<you>\\.local\\bin\\uvx.exe", // or plain "uvx" on macOS/Linux
      "args": ["qnexus-mcp==0.2.0", "--toolsets", "read,execute"]
    }
  }
}

Then quit Claude Desktop fully and reopen — the config is only read at cold start, and closing the window leaves the old process running (tray icon → Quit, or taskkill /F /IM claude.exe).

VS Code

Command Palette → MCP: Open User Configuration (or a workspace .vscode/mcp.json):

{
  "servers": {
    "nexus": {
      "type": "stdio",
      "command": "C:\\Users\\<you>\\.local\\bin\\uvx.exe", // or plain "uvx" on macOS/Linux
      "args": ["qnexus-mcp==0.2.0", "--toolsets", "read,execute"]
    }
  }
}
Claude Code
claude mcp add nexus -- uvx qnexus-mcp==0.2.0 --toolsets read,execute
Other MCP clients (Cursor, Codex, …)

Same command; the config shape is one of the two JSON forms above (mcpServers vs servers + "type": "stdio") — check your client's docs for which file to put it in.

Something not working? See docs/TROUBLESHOOTING.md — it covers every failure mode observed in real client setups (wrong config path, slow first start, auth, rate limits, known Nexus-side errors).

Configuration

FlagEnvDefaultEffect
--toolsetsQNEXUS_MCP_TOOLSETSreadCapability domains to expose (read,execute,manage,destructive)
--allow-spendQNEXUS_MCP_ALLOW_SPENDfalsePermit credit-spending (HQC) execution
--allow-hardwareQNEXUS_MCP_ALLOW_HARDWAREfalsePermit real-QPU targets
--allow-destructiveQNEXUS_MCP_ALLOW_DESTRUCTIVEfalsePermit delete/cancel/archive
--max-creditsQNEXUS_MCP_MAX_CREDITS0Hard per-call HQC ceiling; 0 blocks all spend
--max-outcomesQNEXUS_MCP_MAX_OUTCOMES100Top-N cap on distinct measurement outcomes returned per result (truncation is always reported)
--max-submissions-per-minuteQNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE6Sliding-window submission cap; each circuit in a batch counts as one
--projectsQNEXUS_MCP_PROJECTS(all)Comma-separated project allowlist, enforced on every mutating tool

Safety

Read-only by default. Anything that spends credits or mutates cloud state requires an explicit opt-in flag and an in-protocol confirmation, and the default execution backend is the free, noiseless H2-1LE emulator. Submissions are rate-limited, cloud mutations are serialized, destructive project operations resolve their target by exact name (never substring), and the server never reads, stores, or returns your Nexus token. Every control is enforced server-side; MCP tool annotations are treated as UX hints only. See docs/DESIGN.md §6–§7.

Prompt injection (conscious design decision). Everything Nexus returns — job names, project names, error messages, results — is attacker-influencable content (any Nexus user can name a job) and is treated as untrusted data. There is no structural tagging that separates "data" from "instructions" in today's MCP ecosystem; the structural boundary here is instead that injected content cannot escalate: every action with consequences (spending credits, targeting hardware, deleting anything) requires launch flags the agent cannot set plus an in-protocol human confirmation naming the exact target and cost. Injected text can at worst confuse the agent's reasoning — it cannot spend or destroy anything on its own. This residual risk is accepted and documented, not an omission.

Governance. This is an early-stage, single-maintainer project (see CODEOWNERS): releases are published by one person via GitHub-OIDC Trusted Publishing (no long-lived PyPI tokens). Pin a version (above) if that trust model matters for your deployment.

Contributing

See CONTRIBUTING.md. Contributions are accepted under the Developer Certificate of Origin; sign off your commits with -s.

License

Apache-2.0. See LICENSE and NOTICE.

الأسئلة الشائعة

ما هو io.github.Blite-HQ/qnexus-mcp؟

MCP server for Quantinuum Nexus, wrapping the qnexus SDK. Not affiliated with Quantinuum.

كيف أثبّت io.github.Blite-HQ/qnexus-mcp؟

يعمل على جهازك. في Claude Code: claude mcp add qnexus-mcp -e 'QNEXUS_MCP_TOOLSETS=<QNEXUS_MCP_TOOLSETS>' -e 'QNEXUS_MCP_ALLOW_SPEND=<QNEXUS_MCP_ALLOW_SPEND>' -e 'QNEXUS_MCP_ALLOW_HARDWARE=<QNEXUS_MCP_ALLOW_HARDWARE>' -e 'QNEXUS_MCP_ALLOW_DESTRUCTIVE=<QNEXUS_MCP_ALLOW_DESTRUCTIVE>' -e 'QNEXUS_MCP_MAX_CREDITS=<QNEXUS_MCP_MAX_CREDITS>' -e 'QNEXUS_MCP_MAX_OUTCOMES=<QNEXUS_MCP_MAX_OUTCOMES>' -e 'QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE=<QNEXUS_MCP_MAX_SUBMISSIONS_PER_MINUTE>' -e 'QNEXUS_MCP_PROJECTS=<QNEXUS_MCP_PROJECTS>' -- uvx qnexus-mcp==0.2.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.Blite-HQ/qnexus-mcp إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل io.github.Blite-HQ/qnexus-mcp مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص Apache-2.0.

من يصون io.github.Blite-HQ/qnexus-mcp؟

ينشره Blite-HQ. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.