Quantum Simulator MCP server

Provides a Docker-based quantum circuit simulator using Qiskit to run, visualize, and analyze quantum computations with various noise models without requiring specialized quantum computing knowledge.
Back to servers
Setup instructions
Provider
YuChenSSR
Release date
Mar 22, 2025
Language
Python
Stats
10 stars

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.

Installation

Docker Setup

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:

  • Mounts your host's /tmp directory to store output files
  • Sets the HOST_OUTPUT_DIR environment variable
  • Runs in interactive mode (-i)
  • Automatically removes the container when it exits (--rm)

Integration with Claude for Desktop

Configuration Steps

  1. Install Claude for Desktop

  2. Edit the Claude configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. 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"
      ]
    }
  }
}
  1. Restart Claude for Desktop
  2. Look for the hammer icon in the Claude UI, indicating the quantum simulator tool is available

Available Tools

The server provides several MCP tools:

  • run_circuit: Execute quantum circuits with specified noise models
  • list_noise_models: Display available noise models and descriptions
  • list_result_types: Show available result types and descriptions
  • get_circuit_stats: Analyze a quantum circuit for statistics
  • create_test_histogram: Generate a test histogram to verify configuration

Example Circuits

Pre-configured example quantum circuits include:

  • qasm://examples/bell-state.qasm: Basic Bell state preparation
  • qasm://examples/grover-2qubit.qasm: 2-qubit Grover's algorithm
  • qasm://examples/qft-4qubit.qasm: 4-qubit Quantum Fourier Transform
  • quantum://noise-models/examples.json: Example noise model configurations

Using the Simulator

Here are sample prompts for Claude:

  1. "Run a Bell state circuit and show me the results"
  2. "What noise models are available in the quantum simulator?"
  3. "Simulate a 2-qubit Grover's algorithm with 0.01 depolarizing noise"
  4. "Create a test histogram and show me the file path"
  5. "Please provide a simple QAOA algorithm, only get the result_types: histogram, and view the histogram using iterm"

Output File Access

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).

Environment Variables

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)

Troubleshooting

Common Issues

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)

System Compatibility

The Docker image supports:

  • linux/amd64
  • linux/arm64 (works on Mac M-series chips)

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later