Qiskit MCP Server

v0.3.2
io.github.Qiskit/qiskit-mcp-server Checked 18 hours ago Published 1 month ago

MCP server for Qiskit quantum computing with circuit serialization utilities

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

transpile_circuit_tool

Transpile a quantum circuit using Qiskit's preset pass managers. Takes a quantum circuit and transpiles it to match target hardware constraints while optimizing for depth and gate count. IMPORTANT: Optimization level 3 can be very slow for large circuits (100+ qubits or 1000+ gates). Consider using level 2 for faster results with good quality.

ParameterTypeDescription
circuit *stringQuantum circuit as QASM3 string, base64-encoded QPY, or QASM2 string. Maximum supported: 100 qubits, 10000 gates. For QASM2, set circuit_format="qasm3" (it will auto-detect and parse QASM2).
basis_gatesTarget basis gates. Can be: - A list of gate names (e.g., ["cx", "id", "rz", "sx", "x"]) - A preset name: "ibm_default", "ibm_eagle", "ibm_heron", "generic_clifford_t", "ion_trap", "superconducting"…
circuit_formatstringFormat of the input circuit ("qasm3" or "qpy"). Defaults to "qasm3". When "qasm3" is specified, QASM2 is also accepted as a fallback.
coupling_mapQubit connectivity. Can be: - A list of [control, target] pairs (e.g., [[0, 1], [1, 2]]) - A topology name: "linear", "ring", "grid", "full" - None for all-to-all connectivity
initial_layoutOptional initial qubit layout as list of physical qubit indices. Length must match the number of qubits in the circuit.
optimization_levelintegerOptimization level (0-3): - 0: No optimization, just maps to basis gates (fastest) - 1: Light optimization (default mapping, simple optimizations) - 2: Medium optimization (noise-adaptive layout) [def…
seed_transpilerRandom seed for reproducibility

analyze_circuit_tool

Analyze a quantum circuit without transpiling it. Provides detailed information about circuit structure, gate counts, and metrics useful for understanding circuit complexity.

ParameterTypeDescription
circuit *stringQuantum circuit as QASM3 string, base64-encoded QPY, or QASM2 string.
circuit_formatstringFormat of the input circuit ("qasm3" or "qpy"). Defaults to "qasm3". When "qasm3" is specified, QASM2 is also accepted as a fallback.

compare_optimization_levels_tool

Compare transpilation results across all optimization levels (0-3). Useful for understanding the trade-off between compilation time and circuit quality for a specific circuit. WARNING: This runs transpilation 4 times. For large circuits, this can be slow.

ParameterTypeDescription
circuit *stringQuantum circuit as QASM3 string, base64-encoded QPY, or QASM2 string.
circuit_formatstringFormat of the input circuit ("qasm3" or "qpy"). Defaults to "qasm3". When "qasm3" is specified, QASM2 is also accepted as a fallback.

convert_qpy_to_qasm3_tool

Convert a QPY circuit to human-readable QASM3 format. Use this tool to view the contents of a QPY circuit output from other tools (like transpile_circuit) in a human-readable OpenQASM 3.0 format.

ParameterTypeDescription
circuit_qpy *stringBase64-encoded QPY circuit string (from transpile_circuit output)

convert_qasm3_to_qpy_tool

Convert a QASM3 (or QASM2) circuit to base64-encoded QPY format. Use this tool to convert human-readable QASM circuits to QPY format, which preserves full circuit fidelity (exact parameters, metadata, custom gates). The QPY output can then be used with other tools that accept QPY input.

ParameterTypeDescription
circuit_qasm *stringOpenQASM 3.0 or 2.0 circuit string

load_circuit_from_qasm_tool

Load a quantum circuit from an OpenQASM 2.0 or 3.0 string. Parses the QASM input, returns the circuit as base64-encoded QPY along with metadata (qubit count, gate counts, depth) so you can reason about the circuit before deciding what to do next.

ParameterTypeDescription
qasm_string *stringThe OpenQASM source code (2.0 or 3.0)
qasm_versionstringWhich parser to use: - "auto" (default): Try QASM 3.0 first, fall back to QASM 2.0 - "3.0": Only use the QASM 3.0 parser - "2.0": Only use the QASM 2.0 parser

export_circuit_to_qasm_tool

Export a Qiskit circuit to OpenQASM format. Converts a base64-encoded QPY circuit to human-readable OpenQASM text. Supports both QASM 3.0 and QASM 2.0 output. Note that some circuits with non-standard gates may not be expressible in QASM 2.0.

ParameterTypeDescription
circuit_qpy *stringBase64-encoded QPY circuit string (from other tool outputs)
qasm_versionstringTarget QASM version: - "3.0" (default): Export as OpenQASM 3.0 - "2.0": Export as OpenQASM 2.0