The Quantum Simulator MCP Server provides a Docker-based quantum circuit simulator that implements the Model Context Protocol (MCP), enabling integration with MCP clients such as Claude for Desktop. It allows you to run quantum simulations, apply various noise models, and visualize results through a user-friendly interface.
First, pull the Docker image:
docker pull ychen94/quantum-simulator-mcp:latest
Run the container with:
docker run -i --rm -v /tmp:/data/quantum_simulator_results -e HOST_OUTPUT_DIR="/tmp" ychen94/quantum-simulator-mcp:latest
This command:
/tmp
directory to store output filesHOST_OUTPUT_DIR
environment variable-i
)--rm
)Install Claude for Desktop
Edit the Claude configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the following to the mcpServers
section:
{
"mcpServers": {
"quantum-simulator": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v", "/tmp:/data/quantum_simulator_results",
"-e", "HOST_OUTPUT_DIR=/tmp",
"ychen94/quantum-simulator-mcp:latest"
]
}
}
}
The server provides several MCP tools:
Pre-configured example quantum circuits include:
qasm://examples/bell-state.qasm
: Basic Bell state preparationqasm://examples/grover-2qubit.qasm
: 2-qubit Grover's algorithmqasm://examples/qft-4qubit.qasm
: 4-qubit Quantum Fourier Transformquantum://noise-models/examples.json
: Example noise model configurationsHere are sample prompts for Claude:
Histogram PNG files are generated in /data/quantum_simulator_results
inside the container and mapped to your host's /tmp
directory (or another directory if you changed the volume mapping).
Two key environment variables control file output:
QUANTUM_OUTPUT_DIR
: Output directory inside the container (default: /data/quantum_simulator_results
)HOST_OUTPUT_DIR
: Corresponding path on your host system (default: /tmp
)Problem: Claude cannot access histogram files
Solution: Verify the volume mapping and ensure HOST_OUTPUT_DIR
matches the host path in your volume mapping
Problem: Docker container exits immediately
Solution: Use the -i
flag to keep stdin open (required for MCP communication)
The Docker image supports:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "quantum-simulator" '{"command":"docker","args":["run","-i","--rm","-v","/tmp:/data/quantum_simulator_results","-e","HOST_OUTPUT_DIR=/tmp","ychen94/quantum-simulator-mcp:latest"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"quantum-simulator": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/tmp:/data/quantum_simulator_results",
"-e",
"HOST_OUTPUT_DIR=/tmp",
"ychen94/quantum-simulator-mcp:latest"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"quantum-simulator": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/tmp:/data/quantum_simulator_results",
"-e",
"HOST_OUTPUT_DIR=/tmp",
"ychen94/quantum-simulator-mcp:latest"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect