Skip to main content

Model Context Protocol servers for IBM Quantum services and Qiskit

Project description

Qiskit MCP Servers

Tests License Python Version Code style: ruff Type checked: mypy

qiskit-mcp-server qiskit-ibm-runtime-mcp-server qiskit-ibm-transpiler-mcp-server qiskit-code-assistant-mcp-server qiskit-docs-mcp-server qiskit-gym-mcp-server

A collection of Model Context Protocol (MCP) servers that provide AI assistants, LLMs, and agents with seamless access to IBM Quantum services and Qiskit libraries for quantum computing development and research.

๐ŸŒŸ What is This?

This repository contains production-ready MCP servers that enable AI systems to interact with quantum computing resources through Qiskit. Instead of manually configuring quantum backends, writing boilerplate code, or managing IBM Quantum accounts, AI assistants can now:

  • ๐Ÿค– Generate intelligent quantum code with context-aware suggestions
  • ๐Ÿ”Œ Connect to real quantum hardware automatically
  • ๐Ÿ“Š Analyze quantum backends and find optimal resources
  • ๐Ÿš€ Execute quantum circuits and monitor job status
  • ๐Ÿ’ก Provide quantum computing assistance with expert knowledge

๐Ÿ› ๏ธ Available Servers

๐Ÿ”ฌ Qiskit MCP Server

Core Qiskit quantum computing capabilities

Provides quantum circuit creation, manipulation, transpilation, and serialization utilities (QASM3, QPY) for local quantum development using Qiskit

๐Ÿ“ Directory: ./qiskit-mcp-server/


๐Ÿง  Qiskit Code Assistant MCP Server

Intelligent quantum code completion and assistance

Provides access to IBM's Qiskit Code Assistant for AI-assisted quantum programming

๐Ÿ“ Directory: ./qiskit-code-assistant-mcp-server/


โš™๏ธ Qiskit IBM Runtime MCP Server

Complete access to IBM Quantum cloud services

Comprehensive interface to IBM Quantum hardware via Qiskit IBM Runtime

๐Ÿ“ Directory: ./qiskit-ibm-runtime-mcp-server/


๐Ÿš€ Qiskit IBM Transpiler MCP Server

AI-powered circuit transpilation

Access to the qiskit-ibm-transpiler library for AI-optimized circuit routing and optimization.

๐Ÿ“ Directory: ./qiskit-ibm-transpiler-mcp-server/


๐Ÿ“š Qiskit Documentation MCP Server

Qiskit documentation retrieval and search

Query and retrieve Qiskit documentation, guides, and API references. No authentication required.

๐Ÿ“ Directory: ./qiskit-docs-mcp-server/


๐Ÿ‹๏ธ Community Servers

๐Ÿ‹๏ธ Qiskit Gym MCP Server

Reinforcement learning for quantum circuit synthesis

Uses qiskit-gym to train RL models for optimal quantum circuit synthesis, including permutation routing, linear function synthesis, and Clifford circuits.

๐Ÿ“ Directory: ./qiskit-gym-mcp-server/

๐Ÿ“š Examples

Each MCP server includes example code demonstrating how to build AI agents using LangChain:

Server Examples
Qiskit MCP Server qiskit-mcp-server/examples/
Qiskit Code Assistant MCP Server qiskit-code-assistant-mcp-server/examples/
Qiskit IBM Runtime MCP Server qiskit-ibm-runtime-mcp-server/examples/
Qiskit IBM Transpiler MCP Server qiskit-ibm-transpiler-mcp-server/examples/
Qiskit Documentation MCP Server qiskit-docs-mcp-server/examples/
Qiskit Gym MCP Server (Community) qiskit-gym-mcp-server/examples/

Each examples directory contains:

  • Jupyter Notebook (langchain_agent.ipynb) - Interactive tutorial with step-by-step examples
  • Python Script (langchain_agent.py) - Command-line agent with multiple LLM provider support

Advanced: Quantum Volume Finder

The examples/ directory contains a multi-agent system that combines multiple MCP servers to find the highest achievable Quantum Volume for IBM Quantum backends through actual hardware execution. It demonstrates multi-server orchestration, local tool wrappers to keep large data out of the LLM context, and both single-circuit and full statistical protocol modes. See the examples README for details.

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10+ (3.11+ recommended)
  • uv package manager (fastest Python package manager)
  • IBM Quantum account and API token
  • Qiskit Code Assistant access (for code assistant server)

Installation

Install from PyPI

# Install all MCP servers (core + community)
pip install qiskit-mcp-servers[all]

# Install just the core servers (default)
pip install qiskit-mcp-servers

# Install individual servers
pip install qiskit-mcp-servers[qiskit]          # Qiskit server only
pip install qiskit-mcp-servers[code-assistant]  # Code Assistant server only
pip install qiskit-mcp-servers[runtime]         # IBM Runtime server only
pip install qiskit-mcp-servers[transpiler]      # IBM Transpiler server only
pip install qiskit-mcp-servers[docs]            # Documentation server only
pip install qiskit-mcp-servers[gym]             # Qiskit Gym server only (community)

# Install community servers only
pip install qiskit-mcp-servers[community]

Install from Source

Each server is designed to run independently. Choose the server you need:

๐Ÿ”ฌ Qiskit Server

cd qiskit-mcp-server
uv run qiskit-mcp-server

๐Ÿง  Qiskit Code Assistant Server

cd qiskit-code-assistant-mcp-server
uv run qiskit-code-assistant-mcp-server

โš™๏ธ IBM Runtime Server

cd qiskit-ibm-runtime-mcp-server
uv run qiskit-ibm-runtime-mcp-server

๐Ÿš€ IBM Transpiler Server

cd qiskit-ibm-transpiler-mcp-server
uv run qiskit-ibm-transpiler-mcp-server

๐Ÿ“š Documentation Server

cd qiskit-docs-mcp-server
uv run qiskit-docs-mcp-server

๐Ÿ‹๏ธ Qiskit Gym Server (Community)

cd qiskit-gym-mcp-server
uv run qiskit-gym-mcp-server

๐Ÿ”ง Configuration

Environment Variables

# For IBM Runtime Server
export QISKIT_IBM_TOKEN="your_ibm_quantum_token_here"

# For Code Assistant Server  
export QISKIT_IBM_TOKEN="your_ibm_quantum_token_here"
export QCA_TOOL_API_BASE="https://qiskit-code-assistant.quantum.ibm.com"

Using with MCP Clients

All servers are compatible with any MCP client. Test interactively with MCP Inspector:

# Replace <server-name> with any server command
npx @modelcontextprotocol/inspector uv run qiskit-mcp-server
npx @modelcontextprotocol/inspector uv run qiskit-docs-mcp-server
npx @modelcontextprotocol/inspector uv run qiskit-ibm-runtime-mcp-server
# etc.

Claude Desktop / Cline Configuration

Add to your MCP client configuration (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "qiskit": {
      "command": "uvx",
      "args": ["qiskit-mcp-server"]
    },
    "qiskit-docs": {
      "command": "uvx",
      "args": ["qiskit-docs-mcp-server"]
    },
    "qiskit-runtime": {
      "command": "uvx",
      "args": ["qiskit-ibm-runtime-mcp-server"],
      "env": {
        "QISKIT_IBM_TOKEN": "your_ibm_quantum_token_here"
      }
    }
  }
}

See each server's README for the full list of environment variables and configuration options.

๐Ÿ—๏ธ Architecture & Design

๐ŸŽฏ Unified Design Principles

All servers follow a consistent, production-ready architecture:

  • ๐Ÿ”„ Async-first: Built with FastMCP for high-performance async operations
  • ๐Ÿงช Test-driven: Comprehensive test suites with 65%+ coverage
  • ๐Ÿ›ก๏ธ Type-safe: Full mypy type checking and validation
  • ๐Ÿ“ฆ Modern packaging: Standard pyproject.toml with hatchling build system
  • ๐Ÿ”ง Developer-friendly: Automated formatting (ruff), linting, and CI/CD

๐Ÿ”Œ MCP Protocol Support

All servers implement the full Model Context Protocol specification:

  • ๐Ÿ› ๏ธ Tools: Execute quantum operations (code completion, job submission, backend queries)
  • ๐Ÿ“š Resources: Access quantum data (service status, backend information, model details)
  • โšก Real-time: Async operations for responsive AI interactions
  • ๐Ÿ”’ Secure: Proper authentication and error handling

๐Ÿงช Development

๐Ÿƒโ€โ™‚๏ธ Running Tests

# Run tests for any server
cd qiskit-code-assistant-mcp-server  # or any server directory
./run_tests.sh

๐Ÿ” Code Quality

All servers maintain high code quality standards:

  • โœ… Linting: ruff check and ruff format
  • ๐Ÿ›ก๏ธ Type checking: mypy src/
  • ๐Ÿงช Testing: pytest with async support and coverage reporting
  • ๐Ÿš€ CI/CD: GitHub Actions for automated testing

๐Ÿ“– Resources & Documentation

๐Ÿ”— Essential Links

AI Development Assistant Support

This repository includes AI-generated code and offers comprehensive guidance for AI coding assistants (like IBM Bob, Claude Code, GitHub Copilot, Cursor AI, and others) in AGENTS.md. This helps AI assistants provide more accurate, context-aware suggestions when working with this codebase.

๐Ÿ“„ License

This project is licensed under the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qiskit_mcp_servers-0.9.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qiskit_mcp_servers-0.9.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file qiskit_mcp_servers-0.9.0.tar.gz.

File metadata

  • Download URL: qiskit_mcp_servers-0.9.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qiskit_mcp_servers-0.9.0.tar.gz
Algorithm Hash digest
SHA256 f46186e0de7d065a57eea78104bc6f80b84b680821a381dd260d5c61ad9dc147
MD5 d73bd7a7b692d520c4418edb1d1345e2
BLAKE2b-256 e0af730833080c709d62b26047c3ea600c0055e7bca9acb42cd06f160e861490

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_mcp_servers-0.9.0.tar.gz:

Publisher: publish-pypi.yml on Qiskit/mcp-servers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qiskit_mcp_servers-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_mcp_servers-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 872fff50ae27a4e58b1331c40d2c54863b6301ef9840ef9323185a7a16d0bc9a
MD5 2537bb94dd92053fe22b33e632f3e72b
BLAKE2b-256 f3e91e1f949d15d2ea1523e0a963b1e95273de214c25182c202725582eaac00b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_mcp_servers-0.9.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Qiskit/mcp-servers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page