qciconnect-mcp
A local MCP server exposing the QCI Connect quantum computing platform (German Aerospace Center, DLR) to LLM agents. It is a thin tool layer over the API Client - it does not reimplement platform access, and inherits the API Client's per-user auth, so an agent using it can only do what your own platform token allows.
It is a component of the QCI Connect SDK. It will allow your LLM to answer question like:
- Hey Agent, which QPUs are available on the platform?
- Simulate a Bell state locally, 1000 shots
- Simulate a Bell state with the digital twin of XYZ, 1000 shots
- What are
<Z0 Z1>and<X0 X1>on that state?
and see examples for further inspiration.
Current coverage: so far the MCP server covers the API Client, ALF and the QCI Connect platform only. Support for AppLib, the Miniserver and the other SDK components is coming soon.
Install
qciconnect-mcp is a local stdio MCP server. Any harness that supports local MCP
servers can launch it, including Codex, Mistral Vibe, OpenCode and Claude Code. The launch
command is shared; registration commands and configuration formats depend on the harness.
tl;dr (using claude and uv)
claude mcp add qciconnect-mcp -- uvx qciconnect-mcp
echo "QCICONNECT_TOKEN=your-token" >> .env
claude
Using uv
Install uv, then register the server with your harness using one of the following commands:
| Harness | Registration command | Documentation |
|---|---|---|
| Codex | codex mcp add qciconnect-mcp -- uvx qciconnect-mcp |
MCP setup |
| Mistral Vibe | vibe mcp add qciconnect-mcp --transport stdio --command "uvx qciconnect-mcp" |
MCP setup |
| OpenCode (v2) | opencode mcp add qciconnect-mcp -- uvx qciconnect-mcp |
MCP setup |
| Claude Code | claude mcp add qciconnect-mcp -- uvx qciconnect-mcp |
MCP setup |
uvx fetches qciconnect-mcp from PyPI into an isolated, cached environment on first start - no
checkout, no virtual environment to manage. The harness starts the server for you.
For another harness or a version with different registration commands, configure a local MCP
server named qciconnect-mcp with executable uvx and arguments ["qciconnect-mcp"]. Use that
harness's configuration format: there is no universal MCP config file. For example, Codex uses
TOML, while OpenCode uses JSON/JSONC with a command array.
Using pip
With Python 3.12 or newer, install into your chosen Python environment:
pip install qciconnect-mcp
Register the server in your harness with the absolute path to that environment's
qciconnect-mcp executable and no arguments, replacing uvx qciconnect-mcp above. For Vibe,
set --command to that path and omit --arg.
Dependencies and local simulation
qciconnect-mcp requires both qciconnect-client for platform access and
qciconnect-alf for simulate_circuit and estimate_observables. ALF declares its
simulation dependencies, including Qiskit. A normal pip install qciconnect-mcp or
uvx qciconnect-mcp installs these dependencies automatically; no extra is required.
If a local tool reports ModuleNotFoundError: No module named 'qciconnect.alf'
(or a missing backend such as qiskit), check the Python environment that actually
runs the MCP server. Installing ALF in your project's environment does not repair
an isolated uvx environment or another harness's configured interpreter.
For a pip installation, use that server environment's Python executable to check
and repair the installation:
python -m pip check
python -m pip install --upgrade qciconnect-mcp
Restart the MCP server after repairing its environment. Verify both local tools with a circuit without explicit measurements, such as the Bell-state examples below. A generic error alone does not establish that ALF is missing: use the exception type and message reported by the local tools to distinguish import, parsing, and simulation failures. In particular, explicit measurements produce a separate statevector error.
Credentials and first use
Create a token at https://connect.qci.dlr.de/Account and put it in a .env file in the
server's working directory:
QCICONNECT_TOKEN=your-token
When the harness launches the server from your project root, place .env there. Otherwise,
configure the server's working directory or pass QCICONNECT_TOKEN through the harness's
server environment settings. Existing environment variables take precedence over .env.
Keep the token out of version control.
Start or restart your chosen harness, check its MCP status/tool list for qciconnect-mcp, check if the setup works by asking:
Which QPUs are available on the platform?
For a credential-free check, ask Simulate a Bell state locally, 1000 shots. See Examples for more prompts and Checking the installation for a harness-independent protocol check.
To drive a local miniserver instead of
the production platform, use QCICONNECT_SERVER=http://127.0.0.1:8000/ instead - a miniserver
needs no token.
Behind a proxy, set the standard proxy variables in the same .env (or in your MCP host's
server environment settings):
HTTPS_PROXY=http://user:password@proxy.example.com:3128
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY are honoured, including SOCKS proxies
(socks5://...). A local miniserver (localhost, 127.0.0.1) is never sent through the proxy.
Tools
Read-only:
list_qpus- real quantum hardware, with status, whether you have access, and the platform's usage hint where there is onelist_simulators- statevector simulators and digital twins, same fieldslist_apus- analog processing unitslist_compiler_methods- available compiler passes, as<pass_alias>_<compiler_alias>nameslist_recent_jobs,get_result- completed jobs and their resultssimulate_circuit,estimate_observables- run a circuit on this machine, no platform needed
Submitting (annotated as not read-only, so a host's approval prompt can tell them apart):
submit_qpu_job- run an OpenQASM circuit on a QPUsubmit_apu_job- compile and/or run code on an analog processing unitsubmit_compiler_job- run circuits through a compiler pass
The server also publishes one MCP resource, qci://skills/alf-circuits, a guide to writing
idiomatic ALF that an agent can read on demand.
Reading it requires a harness with MCP resource support; see the FAQ to install it
as a skill instead.
Examples
You do not call these tools yourself - you ask the agent for the thing you want, and it picks the tool. The exchanges below are illustrative and, unless noted, run against a local miniserver started with the example compilers and the bundled Qiskit Aer simulator:
uv run miniserver -c compilers # in a miniserver checkout; needs Docker
Listing the compilers
List all available compilers
┌─────────────────────┬─────────────────────────────┬──────────────┬────────────────────────────────────────────────────────────────┐
│ Method name │ Compiler │ Pass │ What it does │
├─────────────────────┼─────────────────────────────┼──────────────┼────────────────────────────────────────────────────────────────┤
│ zne_mitiq_compiler │ Mitiq Compiler (Unitary │ ZNE │ Zero Noise Extrapolation as implemented by the mitiq library │
│ │ Foundation) │ │ │
├─────────────────────┼─────────────────────────────┼──────────────┼────────────────────────────────────────────────────────────────┤
│ optimization_qronos │ Qronos (Linus Scholz) │ Optimization │ Compilation and optimization of Clifford circuits │
├─────────────────────┼─────────────────────────────┼──────────────┼────────────────────────────────────────────────────────────────┤
│ pyqsp_qsp │ QSP (Team Biber) │ pyqsp │ Quantum Signal Processes the given block encoding according to │
│ │ │ │ a provided polynomial │
├─────────────────────┼─────────────────────────────┼──────────────┼────────────────────────────────────────────────────────────────┤
│ exactoddqsp_qsp │ QSP (Team Biber) │ exactoddqsp │ Exact QSP angles for odd monomials │
└─────────────────────┴─────────────────────────────┴──────────────┴────────────────────────────────────────────────────────────────┘
Calls list_compiler_methods. The method name is <pass_alias>_<compiler_alias>, both halves
lowercased with spaces and hyphens turned into underscores. The compiler half comes from the
compiler's name, not from the compiler_alias field of its description - which is why "Mitiq
Compiler" yields mitiq_compiler.
Listing the devices
Which QPUs can I use?
Against the production platform, rather than the miniserver the other examples use:
┌────────────────┬────────┬───────────────────┬─────────────┐
│ Alias │ Qubits │ Technology │ Status │
├────────────────┼────────┼───────────────────┼─────────────┤
│ kratos_xaphiro │ 24 │ other │ IDLE │
│ xq2i │ 8 │ vacancy_centres │ IDLE │
│ saxonq_4qb_rt │ 3 │ vacancy_centres │ CALIBRATION │
│ xq1i │ 4 │ vacancy_centres │ CALIBRATION │
│ qsea_i │ 4 │ trapped_ions │ OFFLINE │
│ carina │ 4 │ photons │ COMING_SOON │
│ comiqc │ 50 │ solid_state_spins │ COMING_SOON │
│ dedalo │ 64 │ photons │ COMING_SOON │
│ dinaqc │ 100 │ neutral_atoms │ COMING_SOON │
│ legato │ 20 │ trapped_ions │ COMING_SOON │
│ qsea_ii │ 20 │ trapped_ions │ COMING_SOON │
│ redac │ 8 │ analogue_computer │ COMING_SOON │
│ sunqc │ 8 │ vacancy_centres │ COMING_SOON │
│ toccata │ 50 │ trapped_ions │ COMING_SOON │
│ xaphiro │ 50 │ trapped_ions │ COMING_SOON │
└────────────────┴────────┴───────────────────┴─────────────┘
Calls list_qpus. Real hardware only - ask for simulators and you get list_simulators instead,
which covers the statevector simulators and the digital twins (statevector_simulator,
kratos_aer, qsea_i_digital_twin and friends). The split is on the platform's own technology
field, so a device labelled other counts as hardware. Both lists are submitted to the same way,
through submit_qpu_job, and both also report access_for_current_user, which is what decides
whether you can actually use a row. list_apus does the same for analog processing units. A local
miniserver only offers what you started it with, which is usually a single simulator.
Running a circuit
Run a Bell state on the Aer simulator with 1000 shots
The agent writes the circuit, submits it, and waits for the result:
Submitted to qiskit_aer_simulator (sampling, 1000 shots) - finished.
┌─────────┬───────┬───────────┐
│ Outcome │ Count │ Frequency │
├─────────┼───────┼───────────┤
│ 00 │ 503 │ 50.3% │
├─────────┼───────┼───────────┤
│ 11 │ 497 │ 49.7% │
└─────────┴───────┴───────────┘
Only 00 and 11 appear, as expected for a Bell pair - the two qubits are perfectly correlated.
Calls submit_qpu_job. This runs a real job and may consume QPU time or HPC allocation, so your
host should prompt for approval first - the tool is annotated as not read-only precisely so that
prompt can tell it apart from the listing tools. Shots default to 10000 if you do not say;
QPUs on an HPC system also need a cost bearer, which the agent will ask you for.
Simulating without a platform
Simulate a Bell state locally, 1000 shots
Simulated on this machine - no platform involved.
┌─────────┬───────┬───────────┐
│ Outcome │ Count │ Frequency │
├─────────┼───────┼───────────┤
│ 00 │ 503 │ 50.3% │
├─────────┼───────┼───────────┤
│ 11 │ 497 │ 49.7% │
└─────────┴───────┴───────────┘
Calls simulate_circuit. This one runs through ALF's local statevector simulator, so it needs no
token, no miniserver and no Docker - useful for checking a circuit before spending QPU time on it.
It samples all qubits from the final state. Explicit measurement statements (register-wide or
individual) are unsupported by the local statevector backend; for final-state sampling, provide
a circuit without measurements. Both local tools report failures with the underlying exception
type and message, including parsing and missing-dependency errors.
estimate_observables is the same idea for expectation values, taking Pauli strings in ALF's form:
What are and on that state?
Z0 Z1 -> 1.0
X0 X1 -> 1.0
Both correlators are +1, which is the signature of a Bell pair.
Building a circuit with ALF's algebra
Build a GHZ state on 4 qubits with ALF and simulate it
from qciconnect.alf.circuit import Circuit, H, CX
ghz = Circuit(name="ghz", width=4)
ghz += H(0)
for q in range(3):
ghz += CX(q, q + 1)
┌──────────┬───────┬───────────┐
│ Outcome │ Count │ Frequency │
├──────────┼───────┼───────────┤
│ 0000 │ 503 │ 50.3% │
├──────────┼───────┼───────────┤
│ 1111 │ 497 │ 49.7% │
└──────────┴───────┴───────────┘
All four qubits agree every shot - nothing in between, as a GHZ state should be.
Reads qci://skills/alf-circuits, then calls simulate_circuit. The skill is what keeps the
generated code idiomatic: += to append, width= by keyword, and the parameter-before-qubit order
that parameterised gates use (RX(0.5, 0), not RX(0, 0.5)).
Checking a circuit undoes itself
Apply that two-qubit block five times, then invert the whole thing. Do I get the identity back?
from qciconnect.alf.circuit import RX, RZ
block = Circuit(name="block", width=2)
block += RX(0.3, 0)
block += CX(0, 1)
block += RZ(0.7, 1)
loop = block.repeat(5)
echo = loop.composed(loop.dagger())
Counts: {'00': 1000} - every shot returns to the start.
echo.is_equivalent_to(Circuit(name="id", width=2)) -> True
Calls simulate_circuit. repeat, dagger and composed each return a new circuit. Their
in-place counterparts are the trap: compose mutates the receiver and returns None, so
tail = circuit.compose(other) silently binds None. The skill has the full table.
Stacking error mitigation
Wrap the local sampler in a readout-mitigation pass
from qciconnect.alf.mitigation import AbstractSimpleMitigationSampler
from qciconnect.alf.execution import LocalSampler
from qciconnect.alf.circuit import X
class FlipReadout(AbstractSimpleMitigationSampler):
def _adapt_circuit(self, circuit):
return {"plain": circuit, "flipped": circuit + X(0)}
def _mitigate_samplesets(self, samplesets):
return samplesets["plain"]
sampler = FlipReadout(None) >> LocalSampler()
No tool call - this is the skill doing the work. >> stacks mitigation samplers: circuits flow
left to right to the right-most one, which talks to the backend, and results are post-processed right
to left. It is defined only on the mitigation base classes: TrivialSampler() >> LocalSampler() is a TypeError. On a PauliString the same operator shifts qubit indices
instead (PauliString.from_string("X0Z1") >> 2 gives X2Z3).
Compiling a circuit
Optimize this circuit with Qronos
OPENQASM 3.0; include "stdgates.inc"; qubit[2] q; h q[0]; cx q[0], q[1]; s q[1]; s q[1];
Compiled with optimization_qronos - finished.
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
h q[0];
cx q[0], q[1];
z q[1];
The two S gates were merged into a single Z.
Calls submit_compiler_job. One call can carry several named circuits at once, so "compile these
three variants" is a single job. Pass-specific settings (options) are filled in by the agent from
what you ask for.
Looking up earlier work
What have I run recently?
┌──────────────────────────────────────┬────────────────────────────────┬──────────┐
│ Job ID │ Type │ Status │
├──────────────────────────────────────┼────────────────────────────────┼──────────┤
│ 01234567-89ab-cdef-0123-456789abcdef │ QPU (qiskit_aer_simulator) │ finished │
├──────────────────────────────────────┼────────────────────────────────┼──────────┤
│ fedcba98-7654-3210-fedc-ba9876543210 │ Compiler (optimization_qronos) │ finished │
└──────────────────────────────────────┴────────────────────────────────┴──────────┘
Show me the counts from the first one
┌─────────┬───────┬───────────┐
│ Outcome │ Count │ Frequency │
├─────────┼───────┼───────────┤
│ 00 │ 503 │ 50.3% │
├─────────┼───────┼───────────┤
│ 11 │ 497 │ 49.7% │
└─────────┴───────┴───────────┘
Calls list_recent_jobs, then get_result. Only successfully completed jobs show up here -
failed and running ones are not listed. For a job you just submitted in the same conversation the
agent already has the result and will not look it up again.
Scope
v1 wraps the API Client's public surface, as listed above. Submitting a job is a real, potentially billable action on the platform - qciconnect-mcp relies on your MCP host's own tool-approval prompt before running one, rather than adding a confirmation step of its own.
simulate_circuit and estimate_observables are the exception to the "thin layer" rule: they use
ALF's local statevector simulator rather than the
platform, so they work with no credentials, no miniserver and no Docker. Everything else still goes
through the API client.
AppLib, the Miniserver and the other SDK components are not covered yet - support is coming soon. Until then, running named AppLib algorithms (VQE, QAOA, time evolution) rather than raw circuits is out of scope.
Questions
Anything else, check the FAQ - or write to qc-software@dlr.de.
Metadata
Release files for qciconnect-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qciconnect_mcp-0.1.0.tar.gz | 24.2 kB | Without provenance | Details for qciconnect_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qciconnect_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for qciconnect_mcp-0.1.0-py3-none-any.whl |
Total release size: 43.7 kB
Release files / qciconnect_mcp-0.1.0.tar.gz
| Download URL | qciconnect_mcp-0.1.0.tar.gz |
|---|---|
| Size | 24.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee063e4fdea15187234e0ea994ec1bdd8fe2015fa5a75627fd69be04f91ef8a5
|
|
BLAKE2b-256 checksum How to use checksums |
60d533db4653d19612d45e53adca2391837f55ebc76863c7ddfc45b16af15f74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / qciconnect_mcp-0.1.0-py3-none-any.whl
| Download URL | qciconnect_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
635dc83aa75c683a38279f39690f356e1157c753bcdd4f51de1a700c497d448d
|
|
BLAKE2b-256 checksum How to use checksums |
efbed4a3c4728507d13b84a2057d14b0137f7798df2428766c7f25693bb15753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for qciconnect-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.