- Qiskit Mcp Server
Qiskit Mcp Server
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)
- create_quantum_circuit Create a new quantum circuit with specified qubits and classical bits.
Parameters:
num_qubits (int): Number of quantum bits num_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 modify gates (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 run shots (int, optional): Number of measurement shots (default: 1000) Returns: JSON with measurement results and counts
- 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.)
- 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
- 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
- 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
- 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
- optimize_circuit Optimize a quantum circuit using Qiskit transpiler passes.
Parameters:
circuit_name (string): Name of the circuit to optimize optimization_level (int): Optimization level 0-3 Returns: JSON with optimization results and performance metrics
- add_advanced_gates Add advanced quantum gates beyond basic H, X, Y, Z, CX.
Parameters:
circuit_name (string): Name of the circuit to modify gates (array): List of advanced gate operations Supported advanced gates:
Rotation gates: rx, ry, rz, rxx, ryy, rzz Universal gate: u Clifford gates: s, sdg, t, tdg swap: SWAP gate 12. create_variational_circuit Create a variational quantum circuit for quantum machine learning.
Parameters:
num_qubits (int): Number of qubits num_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
- implement_qft Implement Quantum Fourier Transform circuit.
Parameters:
num_qubits (int): Number of qubits for QFT inverse (bool): Whether to implement inverse QFT (default: false) name (string, optional): Custom name for the circuit Returns: Success message with QFT circuit details
Server Config
{
"mcpServers": {
"qiskit-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/qiskit-mcp-server",
"run",
"main.py"
]
}
}
}