A Docker image providing a quantum circuit simulator that implements the Model Context Protocol (MCP), allowing integration with MCP clients such as Claude for Desktop.
Get the Docker image:
docker pull ychen94/quantum-simulator-mcp:latest
Run the container with the following command:
docker run -i --rm -v /tmp:/data/quantum_simulator_results -e HOST_OUTPUT_DIR="/tmp" ychen94/quantum-simulator-mcp:latest
This command:
/tmp
directory on your host to store histogram output filesHOST_OUTPUT_DIR
environment variable to /tmp
-i
(interactive mode)--rm
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
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 the following MCP tools:
The server provides example quantum circuits:
qasm://examples/bell-state.qasm
: Bell state preparation circuitqasm://examples/grover-2qubit.qasm
: 2-qubit Grover's algorithm implementationqasm://examples/qft-4qubit.qasm
: 4-qubit Quantum Fourier Transformquantum://noise-models/examples.json
: Example noise model configurationsHere are some prompts you can use in Claude:
The container generates histogram PNG files in /data/quantum_simulator_results
. These files need to be accessible from your host system. The volume mapping (-v /tmp:/data/quantum_simulator_results
) makes these files available in your host's /tmp
directory.
QUANTUM_OUTPUT_DIR
: Output directory for histogram files inside the container (default: /data/quantum_simulator_results
)HOST_OUTPUT_DIR
: Corresponding path on the host system (default: /tmp
)This image supports the following architectures:
Note: The image has not been tested on Windows systems yet, but should work as long as Docker Desktop is properly configured.
Issue: Claude cannot access the histogram files.
Solution: Ensure the volume mapping is correct and the HOST_OUTPUT_DIR
environment variable matches the host path in your volume mapping.
Issue: Docker container exits immediately.
Solution: Make sure to use the -i
flag to keep stdin open, which is required for the MCP STDIO transport.
This project is licensed under the MIT License. For more details, please see the LICENSE file in this project repository.