qiskit-sim-mcp
This 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.
README
qiskit-sim-mcp
A Model Context Protocol (MCP) server that lets Claude Desktop create, visualize, and simulate quantum circuits using Qiskit and Qiskit Aer.
What It Does
Once connected to Claude Desktop, you can have natural conversations like:
- "Create a Bell state and simulate it with 1024 shots"
- "Show me the GHZ circuit diagram"
- "Run the Bell state with high noise and explain what changed"
- "Create a custom circuit from this QASM string"
Claude will call the underlying tools automatically ā no manual tool invocation needed.
Features
- 3 Tools:
create_circuit,visualize_circuit,run_simulation - 5 Preset Circuits: Bell state, GHZ-3, Superposition, Deutsch-Jozsa, Random-4
- Custom QASM: Accepts any valid OpenQASM 2.0 string
- Noise Modeling: Ideal, low noise (p=0.001), high noise (p=0.01) via depolarizing error
- 1 Resource:
resource://noise-presetsā lists available noise configurations - 1 Prompt:
simulate_walkthroughā guided conversation template
Requirements
- Python 3.13+
- Anaconda or any Python environment manager
- Claude Desktop
Setup
1. Clone the Repository
git clone <repo-url>
cd qiskit-sim-mcp
2. Install Dependencies
pip install -e .
This installs mcp[cli], qiskit, and qiskit-aer into your Python environment.
3. Verify the Installation
python -c "
import asyncio
from quantum_mcp_demo.server import mcp
tools = asyncio.run(mcp.list_tools())
resources = asyncio.run(mcp.list_resources())
prompts = asyncio.run(mcp.list_prompts())
print('Tools:', [t.name for t in tools])
print('Resources:', [r.uri for r in resources])
print('Prompts:', [p.name for p in prompts])
"
Expected output:
Tools: ['create_circuit', 'visualize_circuit', 'run_simulation']
Resources: [AnyUrl('resource://noise-presets')]
Prompts: ['simulate_walkthrough']
4. Test with MCP Inspector (Optional)
uv run mcp dev src/quantum_mcp_demo/server.py
Open http://localhost:6274 in your browser. Use the Tools tab to call each tool manually before connecting to Claude Desktop.
5. Connect to Claude Desktop
Find your Claude Desktop config file:
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
Add this entry inside the mcpServers object:
{
"mcpServers": {
"qiskit-sim-mcp": {
"command": "/opt/anaconda3/bin/python",
"args": [
"-m",
"quantum_mcp_demo.server"
]
}
}
}
Note: Replace
/opt/anaconda3/bin/pythonwith your actual Python path. Runwhich pythonto find it.
6. Restart Claude Desktop
Quit Claude Desktop completely (Cmd+Q on macOS), then reopen it. In a new conversation, the hammer icon (šØ) in the chat input confirms MCP tools are loaded.
Usage Examples
Bell State Simulation
"Create a Bell state circuit, show me the diagram, then simulate it 1024 times with ideal and high noise."
Claude will call:
create_circuit(preset="bell")ā gets acircuit_idvisualize_circuit(circuit_id=...)ā shows the H + CNOT gate diagramrun_simulation(circuit_id=..., shots=1024, noise_preset="ideal")ā ~50%|00ā©, ~50%|11ā©run_simulation(circuit_id=..., shots=1024, noise_preset="high_noise")ā degraded counts,|01ā©and|10ā©appear
Custom QASM Circuit
"Run this circuit: OPENQASM 2.0; include "qelib1.inc"; qreg q[2]; creg c[2]; h q[0]; cx q[0],q[1]; measure q -> c;"
Claude parses the QASM string and runs it through the same simulation pipeline.
Noise Comparison
"Compare the GHZ state under ideal vs high noise ā what does the noise do to the entanglement?"
Project Structure
src/quantum_mcp_demo/
āāā server.py # MCP server entry point
āāā circuits/
ā āāā presets.py # 5 named preset circuits
ā āāā store.py # In-memory circuit storage (UUID-keyed)
āāā tools/
ā āāā create_circuit.py # Tool: create from preset or QASM
ā āāā visualize.py # Tool: HTML diagram + gate JSON
ā āāā simulate.py # Tool: AerSimulator + noise modeling
āāā resources/
ā āāā noise_presets.py # Resource: noise configuration list
āāā prompts/
ā āāā walkthrough.py # Prompt: guided simulation conversation
āāā utils/
āāā serialization.py # numpy ā Python int conversion
āāā errors.py # MCP error response builder
Preset Circuits
| Preset | Qubits | Demonstrates |
|---|---|---|
bell |
2 | Entanglement ā 50/50 split on |00ā© and |11ā© |
ghz_3 |
3 | Multi-qubit entanglement |
superposition |
1 | Equal superposition via Hadamard |
deutsch_jozsa |
3 | Quantum algorithm ā interference |
random_4 |
4 | Noise stress test ā fixed-seed random gates |
Noise Presets
| Preset | Depolarizing p | Description |
|---|---|---|
ideal |
none | Perfect simulation |
low_noise |
0.001 | Realistic near-term device |
high_noise |
0.01 | Aggressive noise ā visible degradation |
Troubleshooting
Claude Desktop doesn't show the hammer icon
- Quit and fully relaunch Claude Desktop after editing the config
- Check the config JSON is valid (no trailing commas)
- Verify the Python path:
which python
python -m quantum_mcp_demo.server fails
- Make sure you ran
pip install -e .from the project root - Confirm Python version:
python --version(needs 3.13+)
Port conflict when running MCP Inspector
kill -9 $(lsof -t -i :6274) 2>/dev/null; kill -9 $(lsof -t -i :6277) 2>/dev/null
Simulation returns unexpected counts
- Shot count mismatches are caught automatically and returned as
isError: true - Try reducing
shots(e.g. 512) if you see errors
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.