
Mcp Qiskit
io.github.daedalusPublished by GitHub account daedalusv0.1.1Updated Oct 24, 2026
MCP server exposing Qiskit 2.3.1 quantum computing functionality
Overview
A local MCP server that exposes Qiskit 2.3.1 so an assistant can build, analyze, draw and run quantum circuits on simulators or IBM backends.
- What you can do
- Create and modify circuits: start a circuit, add single or multiple gates, add measurements, keeping state between calls, and transpile for optimization or a target backend. Analyze circuits: get depth, list available gates and inspect a gate's definition. Draw circuits as ASCII, text, matplotlib or LaTeX output. Manage backends: list backends with filters, check status and read configuration such as coupling map, basis gates and max shots. Execute circuits: run one circuit or a batch with configurable backend, shots and seed, returning counts or a statevector.
- When to use it
- Useful when you want an assistant to help with quantum computing work in Qiskit: building circuits such as Bell states or Grover and Shor examples, inspecting and drawing them, and running them on the local Aer simulator or IBM Quantum hardware without leaving the chat.
- Requirements
- Runs locally as a stdio process; install the PyPI package mcp-qiskit with the qiskit extra. Needs Python 3.11 or higher, Qiskit 2.3.1, qiskit-aer and fastmcp, plus an MCP client such as Claude Desktop or Cursor. The default Aer simulator needs no credentials; IBM Quantum backends need an IBM Quantum API token supplied through the IBM_QUANTUM_TOKEN environment variable or saved via Qiskit.
Installation
In SourceWeft
- Open Mcp Qiskit in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-qiskit
MCP server exposing Qiskit 2.3.1 quantum computing functionality through the Model Context Protocol. Enables LLMs to create, manipulate, and execute quantum circuits via standardized MCP tools and resources.
[PyPI] [Python] [Ruff] [Tests][Ask DeepWiki]
mcp-name: io.github.daedalus/mcp-qiskit
Overview
This project provides a Model Context Protocol (MCP) server that exposes Qiskit quantum computing functionality to Large Language Models (LLMs). It allows AI assistants to:
- Create and manipulate quantum circuits
- Execute circuits on quantum simulators or real backends
- Analyze circuit properties (depth, gates, operations)
- Visualize circuits in various formats
- Manage quantum backends
Why Use This?
- LLM Integration: Enables AI assistants to perform quantum computing tasks without external tooling
- Standardized Interface: MCP provides a consistent tool-based interface for quantum operations
- Qiskit 2.3.1 Compatible: Specifically designed for Qiskit 2.3.1 with all its features
- Extensible: Easy to add new tools or backends
Installation
Prerequisites
- Python 3.11 or higher
- Qiskit 2.3.1
- A running MCP client (Claude Desktop, Cursor, etc.)
Install from PyPI
The [qiskit] extra installs the required Qiskit dependencies. Other extras available:
Install from Source
Quick Start
As a Python Library
As an MCP Server
Claude Desktop
Add to your claude_desktop_config.json:
Cursor
Add to your Cursor settings under MCP Servers:
Other MCP Clients
MCP Tools Reference
Circuit Creation Tools
create_quantum_circuit_tool
Creates an empty quantum circuit with specified number of qubits and classical bits.
Parameters:
num_qubits(int): Number of quantum bitsnum_classical_bits(int): Number of classical bits for measurements
Returns: Dictionary representing the circuit
Example:
add_gate_tool
Adds a quantum gate to a circuit. This tool maintains circuit state between calls.
Parameters:
circuit(dict, optional): The circuit to modify. If None, creates a new 8-qubit circuit with 8 classical bits automatically.gate_name(str): Name of the gate (e.g., "h", "x", "cx", "rx")qubits(list[int]): List of qubit indices to apply the gate to. Can be a single qubit (e.g.,[0]) or multiple qubits (e.g.,[0, 1, 2, 3]). When multiple qubits are specified for a single-qubit gate, the gate is applied to each qubit.params(list[float], optional): Parameters for parameterized gates
Supported Gates:
- Single-qubit:
h,x,y,z,s,t,sdg,tdg,i,id - Parameterized:
rx,ry,rz,u1,u2,u3,p - Multi-qubit:
cx,cy,cz,swap - Multi-controlled:
mcx,mct,mcp,ccx,toffoli,c3x,c3sx,c4x - Specialized:
rxx,ryy,rzz,ch,cswap,cu,crx,cry,crz
State Maintenance Pattern: Always pass the circuit returned by the previous call to maintain state:
Apply Single-Quantum Gate to Multiple Qubits:
When applying single-qubit gates (like h, x, y, z, etc.) to multiple qubits at once, use a list of qubit indices:
add_gates_tool
Adds multiple quantum gates to a circuit in a single call. This tool maintains circuit state between calls and reduces the number of tool calls needed.
Parameters:
circuit(dict, optional): The circuit to modify. If None, creates a new 8-qubit circuit with 8 classical bits automatically.gates(list[dict]): List of gate specifications, each containing:gate(str): Name of the gate (e.g., "h", "x", "cx", "rx")qubits(list[int]): Qubit indices to apply the gate toparams(list[float], optional): Parameters for parameterized gates
Example:
add_measurement_tool
Adds measurement operations to qubits. This tool maintains circuit state between calls.
Parameters:
circuit(dict, optional): The circuit to modify. If None, creates a new 8-qubit circuit with 8 classical bits automatically.qubits(list[int]): Qubit indices to measureclbits(list[int], optional): Classical bit indices to store results
Example:
Analysis Tools
get_circuit_depth_tool
Returns the depth (number of layers) of the circuit.
Parameters:
circuit(dict): The circuit to analyze
Returns: Integer representing circuit depth
list_available_gates_tool
Lists all available quantum gates in Qiskit.
Returns: List of gate name strings
get_gate_definition_tool
Gets detailed information about a quantum gate.
Parameters:
gate_name(str): Name of the gate
Returns: Dictionary with gate properties:
name: Gate namenum_qubits: Number of qubits the gate operates onnum_parameters: Number of parameters (0 for fixed gates)params: List of parameter values
Visualization Tools
draw_circuit_tool
Renders a circuit in various formats.
Parameters:
circuit(dict): The circuit to drawoutput_format(str): Output format - "ascii", "text", "mpl", "latex"
Returns: String representation of the circuit
Example Output (ASCII):
Backend Tools
list_backends_tool
Lists available quantum backends.
Parameters:
filters(dict, optional): Filter criteria (e.g.,{"status": "ONLINE"})
Returns: List of backend information dictionaries
get_backend_status_tool
Gets status information for a backend.
Parameters:
backend_name(str): Name of the backend
Returns: Dictionary with:
name: Backend namestatus: Status (ONLINE/OFFLINE)num_qubits: Number of qubits
get_backend_configuration_tool
Gets detailed configuration for a backend.
Parameters:
backend_name(str): Name of the backend
Returns: Dictionary with:
name: Backend namenum_qubits: Number of qubitscoupling_map: Qubit connectivity (if applicable)basis_gates: List of available basis gatesmax_shots: Maximum allowed shots
Execution Tools
run_circuit_tool
Executes a single quantum circuit.
Parameters:
circuit(dict): Circuit to executebackend_name(str, optional): Backend name (default: "aer_simulator")shots(int, optional): Number of measurement shots (default: 1024)seed(int, optional): Random seed for reproducibility
Returns: Dictionary with:
status: "COMPLETED" or error messagebackend: Backend usedshots: Number of shotscounts: Measurement outcome counts (if shots > 0)statevector: Statevector (if shots=None)time_taken: Execution time in seconds
Example:
run_circuits_tool
Executes multiple circuits in a batch.
Parameters:
circuits(list[dict]): List of circuits to executebackend_name(str, optional): Backend nameshots(int, optional): Number of shotsseed(int, optional): Random seed
Returns: List of result dictionaries
Example:
transpile_circuit_tool
Transpiles a circuit for optimization or specific backend.
Parameters:
circuit(dict): Circuit to transpileoptimization_level(int, optional): 0-3 (default: 1)basis_gates(list[str], optional): Target basis gates
Returns: Transpiled circuit dictionary
Example:
MCP Resources
resource://backends
Provides a list of available quantum backends. Updated dynamically based on available providers.
resource://gates
Provides a list of all available quantum gates in Qiskit.
Usage Examples
Create a Bell State
Run Grover's Algorithm
Draw and Analyze Circuit
Run Shor's Algorithm
See examples/shor_example.py for a complete implementation with factor extraction.
Shor's Algorithm with MCP Qiskit Tools
Build Shor's algorithm circuit to factor N=15 using the MCP Qiskit server tools:
Architecture
Module Responsibilities
- _circuit.py: Quantum circuit creation, gates, measurements, visualization
- _backend.py: Backend discovery, status, configuration
- _execution.py: Circuit execution, transpilation
- _mcp.py: FastMCP server definition, tool registration
Requirements
- Python 3.11+
- qiskit >= 2.3.1
- qiskit-aer >= 0.14.0
- fastmcp >= 2.0
Development
Setup
Running Tests
Code Quality
Pre-commit Hooks
Troubleshooting
API Keys and Credentials
This package supports two types of backends:
- Aer Simulator (default) - Runs locally, no API key required
- IBM Quantum - Requires an IBM Quantum API token
Using IBM Quantum Backends
To use IBM Quantum backends, you need to provide your API token:
Option 1: Environment Variable
Or in your Python code:
Option 2: Save Credentials via Qiskit
Getting an IBM Quantum Token:
- Create an account at IBM Quantum
- Go to Account > My Tokens
- Copy your API token
Environment Variable for MCP Server:
When running as an MCP server, set the environment variable before starting:
Or in your MCP client configuration:
Backend Not Found
If you get "Backend not found", ensure the backend name is correct:
Import Errors
Make sure Qiskit is properly installed:
MCP Connection Issues
Verify the server is running:
License
MIT License - see LICENSE file.
Contributing
Contributions are welcome! Please open an issue or submit a PR on GitHub.
Related Projects
- Qiskit - Quantum computing SDK
- FastMCP - MCP framework
- Model Context Protocol - Protocol specification
Source: README.md at commit e36e72d
Tools
0Version history
1- v0.1.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts