Skip to content

A collection of MCP servers to allow LLMs to use the qiskit,qiskit-ibm-runtime library, qiskit-ibm-transpiler, qiskit-code-assistant service library and others

License

Notifications You must be signed in to change notification settings

Qiskit/mcp-servers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

582 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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-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/


πŸ‹οΈ 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 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[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

πŸ‹οΈ 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

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

# Test Code Assistant Server
npx @modelcontextprotocol/inspector uv run qiskit-code-assistant-mcp-server

# Test IBM Runtime Server
npx @modelcontextprotocol/inspector uv run qiskit-ibm-runtime-mcp-server

πŸ—οΈ Architecture & Design

🎯 Unified Design Principles

Both 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

Both 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 Code Assistant server
cd qiskit-code-assistant-mcp-server
./run_tests.sh

# Run tests for IBM Runtime server  
cd qiskit-ibm-runtime-mcp-server
./run_tests.sh

πŸ” Code Quality

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

About

A collection of MCP servers to allow LLMs to use the qiskit,qiskit-ibm-runtime library, qiskit-ibm-transpiler, qiskit-code-assistant service library and others

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors