GJQ Runtime MCP Server

GJQ Runtime MCP Server

An MCP server that enables AI assistants to interact with the CETC-ICQ quantum cloud platform via the gjq-client Qiskit 2.0 SDK, supporting account management, device listing, circuit submission, and task management.

Category
Visit Server

README

GJQ Runtime MCP Server(中文)

一个 Model Context Protocol(MCP)服务器, 让 AI 助手通过 gjq-client Qiskit 2.0 SDK 与国基 / CETC-ICQ 量子云平台交互。

<img src="docs/brief.png" alt="brief" width="800">

功能

  • 账号管理:配置并查看云平台凭据
  • 设备管理:列出后端、查询配置 / 校准信息、获取最空闲后端
  • 计算任务:从 OpenQASM 提交采样(sampling)与期望估计(estimation)任务
  • 任务管理:轮询状态、获取结果 / 日志 / 详情、列出任务
  • 示例电路:Bell / GHZ / 叠加 / 随机,以 MCP 资源形式提供

功能展示

<img src="docs/sample1.png" alt="sample1" width="320"> <img src="docs/sample2.png" alt="sample2" width="320"> <img src="docs/sample3.png" alt="sample3" width="320">

安装与启动(以Cursor为例)

  1. 克隆仓库并创建虚拟环境
git clone <this-repo>
cd gjq-runtime-mcp-server
python -m venv .venv

# Windows
.\.venv\Scripts\activate
# Linux/macOS
source .venv/bin/activate

pip install -e .
  1. .env.example重命名为.env,进入设置 GJQ_API_KEY=你的_api_key。(API key 从 https://www.tiangongqs.com/cloud 获取)

  2. 本地启动 MCP Server(先验证可运行)

python -m gjq_runtime_mcp_server
  1. 在项目根目录创建 .cursor/mcp.json
# Windows(该行去除)
{
  "mcpServers": {
    "gjq-runtime": {
      "command": ".venv\\Scripts\\python.exe",
      "args": ["-m", "gjq_runtime_mcp_server"],
      "cwd": "/path/to/gjq-runtime-mcp-server",
      "env": { "GJQ_API_KEY": "你的_api_key" }
    }
  }
}

# Linux/macOS(该行去除)
{
  "mcpServers": {
    "gjq-runtime": {
      "command": ".venv/bin/python",
      "args": ["-m", "gjq_runtime_mcp_server"],
      "cwd": "/path/to/gjq-runtime-mcp-server",
      "env": { "GJQ_API_KEY": "你的_api_key" }
    }
  }
}
  1. 在 Cursor 中验证
  • 重启 Cursor。
  • 打开 Cursor Settings → Tools & MCPs → Installed MCP Servers。
  • 确认有 gjq-runtime,打开开关,并检查显示小绿点。

MCP 工具

  • 账号:setup_gjq_account_tool、active_account_info_tool
  • 设备:list_backends_tool、get_backend_configuration_tool、get_backend_properties_tool、least_busy_tool
  • 计算:sample_tool、estimate_tool
  • 任务:get_task_status_tool、get_task_result_tool、get_task_log_tool、get_task_detail_tool、list_my_tasks_tool

所有工具返回 {"status": "success" | "error", ...}。

提交电路时 OpenQASM 2.0 开箱即用;如需提交 OpenQASM 3 电路,请额外安装解析库: pip install qiskit_qasm3_import。

MCP 资源

gjq://status、circuits://bell-state、circuits://ghz-state、circuits://superposition、circuits://random

其他 MCP 客户端配置

上面的 JSON 适用于 Cursor、Claude Desktop 等基于 JSON 配置的客户端。

客户端 配置文件
Cursor .cursor/mcp.json(项目根目录)
Claude Desktop macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Codex ~/.codex/config.toml(TOML 格式,见下)

Codex 使用 TOML 而非 JSON,在 ~/.codex/config.toml 中添加如下内容 (顶层表名必须是 mcp_servers):

[mcp_servers.gjq-runtime]
command = "/path/to/gjq-runtime-mcp-server/.venv/bin/python"
args = ["-m", "gjq_runtime_mcp_server"]
cwd = "/path/to/gjq-runtime-mcp-server"

[mcp_servers.gjq-runtime.env]
GJQ_API_KEY = "你的_api_key"

Agent 技能

配套技能位于 skills/gjq-quantum-runtime/。 在 Cursor 中使用时,把该目录复制到 .cursor/skills/(项目级)或 ~/.cursor/skills/(个人级)。

安全说明

  • API key 以明文存储在 ~/.gjq_client/gjq_client_account.json 以及 MCP 客户端配置的 env 中,请当作机密妥善保管,切勿提交 .env。

开发

pip install -e ".[test]"
pytest

许可证

Apache License 2.0

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured