Qiskit MCP 量子电路集成服务

该服务通过MCP协议将Qiskit量子计算与大型语言模型集成,用户可用自然语言描述量子操作,系统自动生成OpenQASM电路并在IBM Quantum模拟器或真实硬件上执行。

  • by avilches
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 avilches/mcp-qiskit

使用说明

Qiskit MCP

Quantum circuit integration using Model Context Protocol (MCP) endpoints.

About

This project bridges quantum computing with large language models through a Model Context Protocol (MCP) interface. Built on Qiskit, it lets Claude and other MCP-compatible LLMs create and run quantum circuits based on natural language instructions.

Users can describe quantum operations in plain English, and the system handles the translation to OpenQASM code, executes it on IBM Quantum simulators or real hardware, and returns measurement results - all without writing a single line of Qiskit code.

Perfect for quantum exploration without the steep learning curve of quantum programming.

Check out the demo video below to see how it works

Key capabilities

  • Bell state circuit generation (demo)
  • OpenQASM 2.0 circuit creation
  • Circuit execution on simulators or IBM Quantum hardware
  • Backend discovery

Prerequisites

  • Python 3.10+
  • Qiskit installed with an IBM Quantum account
  • Claude Desktop (or any MCP-compatible LLM client)

Setup

  1. Clone the repo:
git clone https://github.com/yourusername/mcp-qiskit.git
cd mcp-qiskit
  1. Install qiskit and the dependencies:
pip install -r requirements.txt
  1. Configure your IBM Quantum account in https://quantum.ibm.com/ and get your API key.

  2. Create a file $HOME/.qiskit/config.json like this with the api token:

{
  "ibm_token": "<put here your IBM Quantum API token>"
}
  1. Add to your Claude config:
{
  "mcp_servers": [
    {
      "name": "Qiskit",
      "path": "/path/to/mcp-qiskit/run_server.sh"
    }
  ]
}
  1. Run or restart Claude Desktop

MCP tools

The server provides these functions:

  • list_backends - Shows available Qiskit backends
  • create_bell_circuit - Creates a basic entanglement circuit
  • create_custom_circuit - Builds a circuit from OpenQASM code
  • execute_circuit - Runs circuits and returns measurement results

License

CC0 1.0 Universal (Creative Commons Zero). See LICENSE for the full text.