qiskit-sim-mcp
qiskit-sim-mcp
Un servidor del Protocolo de Contexto de Modelo (MCP) que permite a Claude Desktop crear, visualizar y simular circuitos cuánticos utilizando Qiskit y Qiskit Aer.
Qué hace
Una vez conectado a Claude Desktop, puedes tener conversaciones naturales como:
"Crea un estado de Bell y simúlalo con 1024 disparos"
"Muéstrame el diagrama del circuito GHZ"
"Ejecuta el estado de Bell con mucho ruido y explica qué cambió"
"Crea un circuito personalizado a partir de esta cadena QASM"
Claude llamará a las herramientas subyacentes automáticamente; no se necesita invocación manual de herramientas.
Related MCP server: Qiskit MCP Server
Características
3 herramientas:
create_circuit,visualize_circuit,run_simulation5 circuitos preestablecidos: estado de Bell, GHZ-3, superposición, Deutsch-Jozsa, aleatorio-4
QASM personalizado: Acepta cualquier cadena válida de OpenQASM 2.0
Modelado de ruido: Ideal, ruido bajo (p=0.001), ruido alto (p=0.01) mediante error de despolarización
1 recurso:
resource://noise-presets— enumera las configuraciones de ruido disponibles1 prompt:
simulate_walkthrough— plantilla de conversación guiada
Requisitos
Python 3.13+
Anaconda o cualquier gestor de entornos de Python
Configuración
1. Clonar el repositorio
git clone <repo-url>
cd qiskit-sim-mcp2. Instalar dependencias
pip install -e .Esto instala mcp[cli], qiskit y qiskit-aer en tu entorno de Python.
3. Verificar la instalación
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])
"Salida esperada:
Tools: ['create_circuit', 'visualize_circuit', 'run_simulation']
Resources: [AnyUrl('resource://noise-presets')]
Prompts: ['simulate_walkthrough']4. Probar con el Inspector MCP (Opcional)
uv run mcp dev src/quantum_mcp_demo/server.pyAbre http://localhost:6274 en tu navegador. Usa la pestaña Tools para llamar a cada herramienta manualmente antes de conectarte a Claude Desktop.
5. Conectar a Claude Desktop
Busca tu archivo de configuración de Claude Desktop:
SO | Ruta |
macOS |
|
Windows |
|
Añade esta entrada dentro del objeto mcpServers:
{
"mcpServers": {
"qiskit-sim-mcp": {
"command": "/opt/anaconda3/bin/python",
"args": [
"-m",
"quantum_mcp_demo.server"
]
}
}
}Nota: Reemplaza
/opt/anaconda3/bin/pythoncon tu ruta real de Python. Ejecutawhich pythonpara encontrarla.
6. Reiniciar Claude Desktop
Cierra Claude Desktop por completo (Cmd+Q en macOS), luego vuelve a abrirlo. En una nueva conversación, el icono del martillo (🔨) en la entrada de chat confirma que las herramientas MCP están cargadas.
Ejemplos de uso
Simulación del estado de Bell
"Crea un circuito de estado de Bell, muéstrame el diagrama y luego simúlalo 1024 veces con ruido ideal y alto."
Claude llamará a:
create_circuit(preset="bell")→ obtiene uncircuit_idvisualize_circuit(circuit_id=...)→ muestra el diagrama de puertas H + CNOTrun_simulation(circuit_id=..., shots=1024, noise_preset="ideal")→ ~50%|00⟩, ~50%|11⟩run_simulation(circuit_id=..., shots=1024, noise_preset="high_noise")→ conteos degradados, aparecen|01⟩y|10⟩
Circuito QASM personalizado
"Ejecuta este circuito: OPENQASM 2.0; include "qelib1.inc"; qreg q[2]; creg c[2]; h q[0]; cx q[0],q[1]; measure q -> c;"
Claude analiza la cadena QASM y la ejecuta a través de la misma tubería de simulación.
Comparación de ruido
"Compara el estado GHZ bajo ruido ideal frente a ruido alto: ¿qué le hace el ruido al entrelazamiento?"
Estructura del proyecto
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 builderCircuitos preestablecidos
Preajuste | Qubits | Demuestra | ||
| 2 | Entrelazamiento — división 50/50 en ` | 00⟩ | 11⟩` |
| 3 | Entrelazamiento de múltiples qubits | ||
| 1 | Superposición igual mediante Hadamard | ||
| 3 | Algoritmo cuántico — interferencia | ||
| 4 | Prueba de estrés de ruido — puertas aleatorias con semilla fija |
Preajustes de ruido
Preajuste | p de despolarización | Descripción |
| ninguno | Simulación perfecta |
| 0.001 | Dispositivo realista a corto plazo |
| 0.01 | Ruido agresivo — degradación visible |
Solución de problemas
Claude Desktop no muestra el icono del martillo
Cierra y reinicia completamente Claude Desktop después de editar la configuración
Comprueba que el JSON de configuración sea válido (sin comas finales)
Verifica la ruta de Python:
which python
python -m quantum_mcp_demo.server falla
Asegúrate de haber ejecutado
pip install -e .desde la raíz del proyectoConfirma la versión de Python:
python --version(necesita 3.13+)
Conflicto de puerto al ejecutar el Inspector MCP
kill -9 $(lsof -t -i :6274) 2>/dev/null; kill -9 $(lsof -t -i :6277) 2>/dev/nullLa simulación devuelve conteos inesperados
Los desajustes en el recuento de disparos se detectan automáticamente y se devuelven como
isError: trueIntenta reducir los
shots(p. ej., 512) si ves errores
Available Tools
3 toolscreate_circuitA
Create a quantum circuit from a named preset or an OpenQASM 2.0 string. Provide exactly one of: preset (bell|ghz_3|superposition|deutsch_jozsa|random_4) or qasm.
| Name | Required | Description | Default |
|---|---|---|---|
| preset | No | ||
| qasm | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry full burden. It only states 'create', which implies mutation, but does not disclose side effects, permissions, rate limits, or whether the operation is reversible. Minimal behavioral context beyond the action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with purpose, and contains no unnecessary words. Every sentence adds value, making it highly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that an output schema exists (implied), the description need not explain return values. It covers the essential parameter modes and preset list. However, it lacks error handling guidance (e.g., what happens if both or neither are provided) and interaction with sibling tools, but the description remains adequate for a simple creation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, so the description compensates by specifying that exactly one parameter must be provided and listing the preset options. It clarifies that qasm is an OpenQASM 2.0 string, adding semantic value. However, it does not detail the format or constraints further.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool creates a quantum circuit from a named preset or an OpenQASM 2.0 string, listing specific preset options. This distinguishes it from siblings (run_simulation, visualize_circuit) which perform different actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for circuit creation but does not explicitly state when to use this tool over alternatives or provide exclusions. It lacks guidance on prerequisites or context for using presets versus QASM.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_simulationA
Run a stored circuit on AerSimulator with optional depolarizing noise. noise_preset: ideal | low_noise | high_noise. Returns counts, probabilities, metadata.
| Name | Required | Description | Default |
|---|---|---|---|
| circuit_id | Yes | ||
| shots | Yes | ||
| noise_preset | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions returns (counts, probabilities, metadata) but does not state whether the operation is read-only, has side effects, or requires specific permissions. The behavior is partially transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loads the core purpose, and presents noise options succinctly. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 required parameters, no annotations, and an output schema, the description covers the platform and noise but omits parameter constraints and fails to distinguish output structure beyond mentioning three fields. It is adequate but not rich.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description must compensate. It explains noise_preset with enumerated values, but leaves circuit_id and shots undocumented (no hint on circuit_id source or shots default/range). Only 1 of 3 parameters gains meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool runs a stored circuit on AerSimulator with optional noise, and the verb 'Run' paired with 'stored circuit' distinguishes it from sibling tools 'create_circuit' and 'visualize_circuit'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context (run a stored circuit) and provides specific noise preset options (ideal, low_noise, high_noise), but does not explicitly exclude alternatives or state prerequisites like needing a pre-existing circuit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
visualize_circuitB
Visualize a stored circuit as HTML and a structured gate list for narration.
| Name | Required | Description | Default |
|---|---|---|---|
| circuit_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits such as whether the operation is read-only, any side effects, or prerequisites (e.g., circuit must exist). This leaves uncertainty about its safety and failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no unnecessary words. It front-loads the key action and outputs.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema and no annotations, the description is adequate but incomplete. It fails to specify error conditions, the format of the gate list, or prerequisite existence checks for the circuit.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter 'circuit_id' has 0% schema description coverage, and the description does not add any meaning beyond the schema's title. No guidance on what constitutes a valid circuit_id or how to obtain it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'visualize' and resource 'stored circuit', and specifies the output as HTML and a gate list for narration. This distinguishes it from siblings 'create_circuit' and 'run_simulation'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance is provided. Usage is implied by the context of having a stored circuit to visualize, but alternatives like run_simulation are not differentiated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
create_circuit - First observed
run_simulation - First observed
visualize_circuit
TDQS
Scored across 3 tools
Each tool addresses a distinct phase of quantum circuit workflow: creation, simulation, and visualization. No overlap in functionality.
All tools follow a consistent verb_noun convention (create_circuit, run_simulation, visualize_circuit), making their purpose immediately clear.
Three tools cover the core lifecycle adequately. While more tools (e.g., list, delete) could be added, the current count is reasonable for a focused server.
The tools enable creating, running with noise, and visualizing circuits. Missing operations like listing or deleting circuits are minor gaps but do not severely hinder basic usage.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
MCP server for Qwen Image 3 AI image generation
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP 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.26 PyPIMIT
- FlicenseAqualityFmaintenanceUnofficial Model Context Protocol (MCP) server that enables LLMs to build and execute quantum circuits using Qiskit.137-

SpinQit MCP Toolsofficial
FlicenseNot gradedqualityDmaintenanceSpinQit MCP Tools is a Python MCP server that connects AI assistants to SpinQ Cloud, enabling QASM circuit submission, platform discovery, and quantum task result retrieval through the Model Context Protocol.2-- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives Claude hands-on access to quantum computing via Qiskit, enabling building circuits, simulation, statevector inspection, transpilation, and optional execution on real IBM quantum computers.MIT