Skip to main content

openquantum-mcp

Model Context Protocol (MCP) server for Open Quantum.

Any MCP-compatible client (Claude, Cursor, VS Code, Grok, and others) can discover backends, submit quantum jobs, wait for completion, and summarize results using your Open Quantum SDK credentials.

One stdio server, standard MCP tools — nothing client-specific in the package.

Docs: docs.openquantum.com/mcp

Install

pip install openquantum-sdk openquantum-mcp

Requires Python 3.10+. openquantum-mcp depends on openquantum-sdk and installs it if needed:

pip install openquantum-mcp

Verify without starting the stdio server:

python -c "import openquantum_mcp; print(openquantum_mcp.__version__)"
python -m openquantum_mcp --version
python -m openquantum_mcp --help

Authentication

Use the same SDK key credentials as the Core SDK (portal SDK keys):

Variable Meaning
OPENQUANTUM_CLIENT_ID SDK key client id
OPENQUANTUM_CLIENT_SECRET SDK key secret
OPENQUANTUM_SDK_KEY Path to JSON key file (client_id + client_secret)

If OPENQUANTUM_SDK_KEY is set but the file is missing, startup/auth fails with a clear path error (no silent fallback).

Optional configuration:

Variable Default Meaning
OPENQUANTUM_MCP_MAX_CREDITS 10 Hard cap on estimated credits per job
OPENQUANTUM_MCP_WAIT_TIMEOUT_SECONDS 600 Default wait_for_job timeout when the tool arg is omitted
OPENQUANTUM_MCP_POLL_INTERVAL_SECONDS 5 Default wait_for_job poll interval when omitted
OPENQUANTUM_MCP_PREP_TIMEOUT_SECONDS 300 Job preparation wait timeout
OPENQUANTUM_MCP_DEFAULT_SHOTS 128 Default shots when omitted
OPENQUANTUM_MCP_DEFAULT_SUBCATEGORY oth:oth Default job subcategory
OPENQUANTUM_MCP_MAX_RESULT_RAW_CHARS 8000 Cap on raw result text
OPENQUANTUM_MCP_MAX_CALIBRATION_RAW_CHARS 8000 Cap on raw calibration text
OPENQUANTUM_MANAGEMENT_BASE production Override management API base URL
OPENQUANTUM_SCHEDULER_BASE production Override scheduler API base URL
OPENQUANTUM_KEYCLOAK_BASE production Override Keycloak base URL
OPENQUANTUM_KEYCLOAK_REALM platform Keycloak realm

Run

export OPENQUANTUM_CLIENT_ID=...
export OPENQUANTUM_CLIENT_SECRET=...
python -m openquantum_mcp
# or
openquantum-mcp

MCP client configuration

Point your client at a Python environment where openquantum-mcp is installed, and pass credentials in the server env. Exact config file locations differ by host; the process definition is the same:

{
  "mcpServers": {
    "openquantum": {
      "command": "python",
      "args": ["-m", "openquantum_mcp"],
      "env": {
        "OPENQUANTUM_CLIENT_ID": "...",
        "OPENQUANTUM_CLIENT_SECRET": "..."
      }
    }
  }
}

Prefer an absolute path to python if the client does not inherit your shell PATH (for example, /path/to/venv/bin/python).

Tools

Tool Purpose
list_organizations Organizations for the account
get_credits Spark and Full credit balances
list_backends / get_backend Discover devices
list_job_categories Categories and subcategories
prepare_job Upload circuit and return a quote (no spend)
submit_job Create a job (does not wait for completion)
get_job / list_jobs Job status
wait_for_job Poll until terminal status or timeout
get_job_results Compact output summary
get_job_calibration Calibration data on demand
cancel_job Cancel when allowed by platform rules

prepare_job / submit_job accept execution_plan (auto / public / private / UUID) and queue_priority (auto / standard / priority / instant / UUID). Auto plan selection prefers Public so Spark can apply. Quotes include quote_summary with per-priority pricing.

Security: file_path is read by the MCP process and uploaded; prefer qasm strings when possible and least-privilege process accounts.

Spend policy

  1. Estimated cost greater than 10 credits (configurable) → rejected.
  2. Cost 0 → allowed.
  3. Public plan and Spark ≥ cost → auto-approved.
  4. Spend that would use Full credits → requires confirm_spend=true.

Default job subcategory: oth:oth. Jobs are tagged submitted_with=mcp.

Example agent flow

  1. list_backends / get_credits
  2. prepare_job with OpenQASM → review quote
  3. submit_job (with confirm_spend=true when required)
  4. wait_for_job (re-call if still queued; QPU queues can be long)
  5. get_job_results
  6. get_job_calibration only if needed

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openquantum_mcp-0.1.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openquantum_mcp-0.1.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file openquantum_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: openquantum_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for openquantum_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6bb9d3d3d1bfde1c227945eae3371163309c779908688160e323f335bf0b8a22
MD5 a3d4f1a0456808dd8339582956b66958
BLAKE2b-256 0106269e63f8c4960eb414a2cb5c6ec891c8740cdd18c56d8381aa5fe6867d86

See more details on using hashes here.

File details

Details for the file openquantum_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openquantum_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cce3d41ad253607f885aee0e8bb1da6cf40a9e8e0095ead8543136126636eacc
MD5 359306d14f1717b6580fd5a5e7fbeede
BLAKE2b-256 996e2a2f2e883848422fb27d7c32d770756dc8e1a362a1ce2c06868569590183

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page