Qiskit MCP Server
Provides tools for building, executing, and analyzing quantum circuits using Qiskit, including creating circuits, adding gates, running simulations, analyzing state vectors, computing density matrices, optimizing circuits, and implementing quantum algorithms such as QFT and variational circuits.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Qiskit MCP Server Create a Bell state circuit with 2 qubits and run it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Qiskit MCP Server
Unofficial Model Context Protocol (MCP) server that enables LLMs to build and execute quantum circuits using Qiskit.
Features
The server provides 13 MCP tools for comprehensive quantum circuit operations:
Core Tools (8)
1. create_quantum_circuit
Create a new quantum circuit with specified qubits and classical bits.
Parameters:
num_qubits(int): Number of quantum bitsnum_classical_bits(int, optional): Number of classical bits (defaults to num_qubits)name(string, optional): Custom name for the circuit (auto-generated if not provided)
2. add_gates
Add quantum gates to an existing circuit.
Parameters:
circuit_name(string): Name of the circuit to modifygates(array): List of gate operations
Supported gates:
h: Hadamard gate -{'type': 'h', 'qubits': [0]}x: Pauli-X gate -{'type': 'x', 'qubits': [0]}y: Pauli-Y gate -{'type': 'y', 'qubits': [0]}z: Pauli-Z gate -{'type': 'z', 'qubits': [0]}cx: CNOT gate -{'type': 'cx', 'qubits': [0, 1]}measure: Measure specific qubit -{'type': 'measure', 'qubits': [0], 'classical_bit': 0}measure_all: Measure all qubits -{'type': 'measure_all'}
3. run_circuit
Execute a quantum circuit on the BasicSimulator.
Parameters:
circuit_name(string): Name of the circuit to runshots(int, optional): Number of measurement shots (default: 1000)
Returns: JSON with measurement results and counts
4. get_circuit_info
Get detailed information about a circuit.
Parameters:
circuit_name(string): Name of the circuit
Returns: JSON with circuit properties (qubits, depth, gate counts, etc.)
5. visualize_circuit
Get a text visualization of the quantum circuit.
Parameters:
circuit_name(string): Name of the circuit
Returns: ASCII art representation of the circuit
6. visualize_circuit_mermaid
Generate a Mermaid flowchart diagram of the quantum circuit.
Parameters:
circuit_name(string): Name of the circuit to visualize
Returns: Mermaid flowchart syntax representing the quantum circuit
7. list_circuits
List all created circuits with basic information.
Returns: JSON with all circuit names and their properties
Advanced Tools (6)
8. analyze_statevector
Analyze the quantum state vector of a circuit.
Parameters:
circuit_name(string): Name of the circuit to analyze
Returns: JSON with probabilities, amplitudes, and state analysis
9. compute_density_matrix
Compute and analyze the density matrix including purity and entanglement.
Parameters:
circuit_name(string): Name of the circuit to analyze
Returns: JSON with purity, entropy, and entanglement information
10. optimize_circuit
Optimize a quantum circuit using Qiskit transpiler passes.
Parameters:
circuit_name(string): Name of the circuit to optimizeoptimization_level(int): Optimization level 0-3
Returns: JSON with optimization results and performance metrics
11. add_advanced_gates
Add advanced quantum gates beyond basic H, X, Y, Z, CX.
Parameters:
circuit_name(string): Name of the circuit to modifygates(array): List of advanced gate operations
Supported advanced gates:
Rotation gates:
rx,ry,rz,rxx,ryy,rzzUniversal gate:
uClifford gates:
s,sdg,t,tdgswap: SWAP gate
12. create_variational_circuit
Create a variational quantum circuit for quantum machine learning.
Parameters:
num_qubits(int): Number of qubitsnum_layers(int): Number of layers (default: 1)entanglement(string): Entanglement pattern ('full', 'linear', 'circular')name(string, optional): Custom name for the circuit
Returns: Success message with circuit details and parameter count
13. implement_qft
Implement Quantum Fourier Transform circuit.
Parameters:
num_qubits(int): Number of qubits for QFTinverse(bool): Whether to implement inverse QFT (default: false)name(string, optional): Custom name for the circuit
Returns: Success message with QFT circuit details
Related MCP server: qiskit-sim-mcp
Examples and Documentation
π Comprehensive Examples
We provide extensive examples and prompts to help you get started:
Examples Folder - Complete collection of examples and prompts
Examples README - Detailed guide with learning paths
π Test Scripts
Basic Operations Tests - Test cases for core 6 tools
Advanced Operations Tests - Test cases for advanced 6 tools
Quantum Algorithms Tests - Famous quantum algorithms
π¬ Ready-to-Use Prompts (130+ Examples)
Basic Circuit Operations - Beginner-friendly prompts
Advanced Circuit Operations - State analysis & optimization
Quantum Algorithms - Algorithm implementations
Educational Examples - Learning-focused prompts
Quick Start Examples
Creating a Bell State
Create a 2-qubit quantum circuit and make a Bell state by applying H to qubit 0 and CNOT from 0 to 1, then measure both qubits and run with 1000 shots.Advanced State Analysis
I have a Bell state circuit. Analyze its statevector to show the probabilities, then compute the density matrix to verify it's entangled with purity=1.0.Circuit Optimization
Create a circuit with redundant gates (X followed by X), then optimize it at level 2 and show me the improvement metrics.Variational Quantum Circuit
Create a variational quantum circuit with 4 qubits, 2 layers, and full entanglement for quantum machine learning. Show me how many parameters it has.Running the Server
Standalone
# Install dependencies
uv sync
# Start the MCP server
uv run python main.pyClaude Desktop Integration
Add this configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"qiskit-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/qiskit-mcp-server",
"run",
"main.py"
]
}
}
}Replace /path/to/qiskit-mcp-server with the actual path to this project directory.
After adding the configuration, restart Claude Desktop. You can then ask Claude to:
"Create a quantum Bell state circuit"
"Build a Grover search algorithm for 2 qubits"
"Analyze the statevector of my circuit to show entanglement"
"Optimize my circuit and show performance improvements"
"Create a variational circuit for quantum machine learning"
"Implement a 3-qubit Quantum Fourier Transform"
Testing and Validation
Run Test Scripts
# Test basic functionality
uv run python examples/test_scripts/test_basic_operations.py
# Test advanced features
uv run python examples/test_scripts/test_advanced_operations.py
# Test quantum algorithms
uv run python examples/test_scripts/test_quantum_algorithms.pyDirect Testing (Legacy)
uv run python test_direct.py # If availableDependencies
qiskit (β₯2.1.1): Quantum computing framework with quantum_info, circuit.library, and transpiler modules
fastmcp (β₯2.10.6): MCP server implementation
numpy: Required for numerical computations in state analysis
Quantum Computing Concepts Supported
Core Quantum Mechanics
Superposition: Create quantum superposition with Hadamard gates
Entanglement: Create entangled states with CNOT and advanced gates
Measurement: Collapse quantum states to classical bits
Quantum Interference: Demonstrate constructive/destructive interference
Advanced Quantum Operations
Parameterized Gates: RX, RY, RZ rotations with arbitrary angles
Two-Qubit Rotations: RXX, RYY, RZZ for direct entanglement creation
Universal Quantum Computation: Complete gate sets for any quantum algorithm
Clifford Operations: S, T gates for quantum error correction
Quantum State Analysis
Statevector Analysis: Complete quantum state information with probabilities
Density Matrix: Mixed state analysis, purity, and entropy calculations
Entanglement Detection: Partial trace entropy to verify quantum correlations
State Tomography: Comprehensive quantum state characterization
Quantum Algorithms
Search Algorithms: Grover's quadratic speedup for database search
Decision Algorithms: Deutsch-Jozsa exponential advantage
Fourier Analysis: Quantum Fourier Transform for period finding
Variational Algorithms: VQE, QAOA for near-term quantum advantage
Phase Estimation: Extract eigenvalues and phases from quantum operators
Circuit Optimization & Analysis
Transpiler Integration: Multi-level optimization (0-3) with performance metrics
Circuit Depth Analysis: Critical path analysis and parallelization
Gate Count Optimization: Redundancy removal and commutation analysis
Resource Estimation: Quantum resource requirements for algorithms
Quantum Machine Learning
Variational Circuits: Parameterized ansΓ€tze with different entanglement patterns
Quantum Feature Maps: Encoding classical data into quantum states
Hybrid Algorithms: Classical-quantum optimization loops
The server enables LLMs to interactively build quantum circuits by describing the desired quantum operations in natural language, which get translated into specific gate sequences, analyzed for quantum properties, optimized for performance, and executed on quantum simulators with comprehensive results analysis.
Project Structure
qiskit-mcp-server/
βββ main.py # MCP server with 13 quantum tools
βββ pyproject.toml # Dependencies and project config
βββ examples/ # Comprehensive examples and documentation
β βββ README.md # Learning guide and examples overview
β βββ test_scripts/ # Test cases and demonstrations
β β βββ test_basic_operations.py # Core tools testing
β β βββ test_advanced_operations.py # Advanced features testing
β β βββ test_quantum_algorithms.py # Algorithm implementations
β βββ prompts/ # 130+ ready-to-use prompt examples
β βββ basic_circuit_operations.md # Beginner prompts
β βββ advanced_circuit_operations.md # State analysis prompts
β βββ quantum_algorithms.md # Algorithm prompts
β βββ educational_examples.md # Learning prompts
βββ README.md # This fileGetting Help
Examples: Start with the examples folder for comprehensive guides
Qiskit Documentation: https://qiskit.org/documentation/
Quantum Computing Learning: IBM Qiskit Textbook
Issues: Report bugs and request features via GitHub issues
Contributing
Contributions are welcome! Areas for expansion:
Additional quantum algorithms (Shor's, HHL, quantum simulation)
Noise modeling and error mitigation tools
Advanced visualization capabilities
Hardware backend integration
Educational content and examples
License
This project is open source. See license file for details.
Available Tools
13 toolsadd_advanced_gatesA
Add advanced quantum gates to a circuit beyond basic H, X, Y, Z, CX.
Args: circuit_name: Name of the circuit to modify gates: List of advanced gate operations Supported gates: 'rx', 'ry', 'rz', 'rxx', 'ryy', 'rzz', 'u', 'swap', 's', 'sdg', 't', 'tdg'
Returns: Success message with applied gates
Inputs: circuit_name (required), gates (required). Returns: result
add_gatesA
Add quantum gates to a circuit.
Args: circuit_name: Name of the circuit to modify gates: List of gate operations, each with 'type' and 'qubits' keys Supported gates: 'h', 'x', 'y', 'z', 'cx', 'measure', 'measure_all'
Returns: Success message with applied gates
Inputs: circuit_name (required), gates (required). Returns: result
analyze_statevectorA
Analyze the quantum state vector of a circuit.
Args: circuit_name: Name of the circuit to analyze
Returns: JSON string with state vector analysis including probabilities and amplitudes
Inputs: circuit_name (required). Returns: result
compute_density_matrixA
Compute and analyze the density matrix of a quantum circuit.
Args: circuit_name: Name of the circuit to analyze
Returns: JSON string with density matrix analysis including purity and entropy
Inputs: circuit_name (required). Returns: result
create_quantum_circuitA
Create a new quantum circuit with auto-generated unique name.
Args: num_qubits: Number of quantum bits (must be an integer) num_classical_bits: Number of classical bits (must be an integer, defaults to num_qubits if not provided) name: Optional custom name for the circuit (auto-generated if not provided)
Returns: Success message with circuit details and generated name
Inputs: num_qubits (required), num_classical_bits, name. Returns: result
create_variational_circuitA
Create a variational quantum circuit (ansatz) for quantum machine learning.
Args: num_qubits: Number of qubits num_layers: Number of repetitions of the ansatz entanglement: Entanglement strategy ('full', 'linear', 'circular') name: Optional custom name for the circuit
Returns: Success message with circuit details
Inputs: num_qubits (required), num_layers, entanglement, name. Returns: result
get_circuit_infoA
Get information about a quantum circuit.
Args: circuit_name: Name of the circuit
Returns: JSON string with circuit information
Inputs: circuit_name (required). Returns: result
implement_qftB
Implement Quantum Fourier Transform circuit.
Args: num_qubits: Number of qubits for QFT inverse: Whether to implement inverse QFT name: Optional custom name for the circuit
Returns: Success message with QFT circuit details
Inputs: num_qubits (required), inverse, name. Returns: result
list_circuitsA
List all created circuits.
Returns: JSON string with circuit names and basic info
Inputs: no named parameters. Returns: result
optimize_circuitB
Optimize a quantum circuit using Qiskit transpiler passes.
Args: circuit_name: Name of the circuit to optimize optimization_level: Optimization level (0-3, where 0 is no optimization)
Returns: Success message with optimization results and new circuit name
Inputs: circuit_name (required), optimization_level. Returns: result
run_circuitB
Run a quantum circuit on the simulator.
Args: circuit_name: Name of the circuit to run shots: Number of measurement shots
Returns: JSON string with measurement results
Inputs: circuit_name (required), shots. Returns: result
visualize_circuitB
Get a text visualization of the quantum circuit.
Args: circuit_name: Name of the circuit to visualize
Returns: Text representation of the circuit
Inputs: circuit_name (required). Returns: result
visualize_circuit_mermaidA
Generate a Mermaid flowchart diagram of the quantum circuit.
Args: circuit_name: Name of the circuit to visualize
Returns: Mermaid flowchart syntax representing the quantum circuit
Inputs: circuit_name (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 13 tools
Each tool targets a distinct operation: circuit creation (general vs variational), gate addition (basic vs advanced), analysis (state vector vs density matrix), visualization (text vs mermaid), etc. No two tools have overlapping purposes.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., 'add_gates', 'analyze_statevector', 'create_quantum_circuit'. The naming is predictable and uniform across the set.
With 13 tools covering creation, modification, analysis, simulation, and visualization, the count is well-scoped for a quantum computing SDK. Each tool serves a clear purpose without redundancy.
The tool surface covers the full lifecycle of circuit creation, modification, analysis, and simulation. Minor gaps exist, such as the absence of a tool to delete or reset circuits, but core workflows are well-supported.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn educational implementation of a Model Context Protocol server that demonstrates how to build a functional MCP server integrating with various LLM clients.2MIT
- FlicenseAqualityDmaintenanceThis MCP server enables Claude Desktop to create, visualize, and simulate quantum circuits using Qiskit and Qiskit Aer, with support for preset circuits, custom QASM, and noise modeling.3-
- AlicenseNot gradedqualityDmaintenanceMCP server exposing Qiskit quantum computing functionality through the Model Context Protocol. Enables LLMs to create, manipulate, and execute quantum circuits via standardized MCP tools and resources.39 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceMCP server wrapping Google's Stim stabilizer circuit simulator. Wire it up to an LLM and you can build and sample circuits through conversation.-