Sponsored by Deepsite.site

Quantum Simulator

Created By
YuChenSSR9 months ago
Content

Quantum Simulator MCP Server

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.

Features

  • Support for OpenQASM 2.0 quantum circuits
  • Quantum circuit simulation using Qiskit
  • Support for various noise models (depolarizing, thermal relaxation, readout error)
  • Multiple result types including counts, statevector, and visualized histograms
  • Pre-configured example circuits
  • Seamless integration with MCP clients

Quick Start

get the docker image

docker pull ychen94/quantum-simulator-mcp:latest

Simply 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:

  • Mounts the /tmp directory on your host to store histogram output files
  • Sets the HOST_OUTPUT_DIR environment variable to /tmp
  • Keeps the container running with -i (interactive mode)
  • Automatically removes the container when it exits with --rm

Using with Claude for Desktop

  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 configuration 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 available MCP tools

MCP Tools

The server provides the following MCP tools:

  • run_circuit: Run a quantum circuit with specified noise model
  • list_noise_models: List all available noise models and their descriptions
  • list_result_types: List all available result types and their descriptions
  • get_circuit_stats: Analyze a quantum circuit and return statistics
  • create_test_histogram: Create a test histogram file to verify output directory configuration

MCP Resources

The server provides example quantum circuits:

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

Example Usage in Claude

Here are some prompts you can use in 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"

chat

result_pic

Volume Mapping

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.

Environment Variables

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

Multi-Architecture Support

This image supports the following architectures:

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

Note: The image has not been tested on Windows systems yet, but should work as long as Docker Desktop is properly configured.

Troubleshooting

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.

License

This project is licensed under the MIT License. For more details, please see the LICENSE file in this project repository.

Server Config

{
  "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"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Amap Maps高德地图官方 MCP Server
WindsurfThe new purpose-built IDE to harness magic
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server