Skip to main content
Glama
OriginQ

QPanda3 Runtime MCP Server

by OriginQ

QPanda3 런타임 MCP 서버

Python 3.10+ FastMCP License Documentation

AI 어시스턴트가 QPanda3 런타임을 통해 Origin Quantum 컴퓨팅 서비스와 상호 작용할 수 있도록 하는 모델 컨텍스트 프로토콜(MCP) 서버입니다.

기능

  • 계정 관리: Origin Quantum 클라우드 계정 인증 구성 및 관리

  • 장치 관리: 사용 가능한 QPU 장치 목록 조회 및 확인

  • 양자 컴퓨팅 작업: 샘플링 및 추정 작업 실행

  • 배치 작업: 여러 회로를 효율적으로 실행

  • 다중 목표 결정: 복잡한 최적화를 위한 CircuitObservableBinding 지원

  • 작업 관리: 작업 상태 조회, 결과 검색, 작업 취소

  • 예제 회로: 일반적인 양자 회로 예제 리소스 제공

문서

문서

설명

영어 문서

영어 문서 사이트

中文文档

중국어 문서 사이트

시작하기

초보자를 위한 완벽 가이드 - 여기서 시작하세요

설치 가이드

상세 설치 지침

빠른 시작

숙련된 사용자를 위한 빠른 설정

구성

환경 및 클라이언트 구성

사용자 가이드

상세 기능 문서

API 참조

자동 생성된 API 문서

설치

원클릭 설정 (권장)

이 프로젝트는 전체 과정을 자동화하는 설정 스크립트를 제공합니다:

Linux / macOS:

git clone https://github.com/OriginQ/qpanda3-runtime-mcp-server.git
cd qpanda3-runtime-mcp-server
chmod +x scripts/setup_configure.sh
./scripts/setup_configure.sh

Windows (PowerShell):

git clone https://github.com/OriginQ/qpanda3-runtime-mcp-server.git
cd qpanda3-runtime-mcp-server
.\scripts\setup_configure.ps1

스크립트가 의존성 설정, API 키 구성, MCP 클라이언트 설정 등 모든 것을 처리합니다.

수동 설치 옵션은 설치 가이드를 참조하세요.

빠른 시작

# 1. Configure your API key
cp .env.example .env
# Edit .env and set QPANDA3_API_KEY=your_api_key_here

# 2. Run the server
.venv/bin/python -m qpanda3_runtime_mcp_server       # Linux/macOS
# .venv\Scripts\python.exe -m qpanda3_runtime_mcp_server  # Windows

MCP 클라이언트 설정 및 고급 옵션은 구성을 참조하세요.

MCP 도구

계정 관리

도구

설명

setup_origin_quantum_account_tool

Origin Quantum 클라우드 계정 인증 구성

list_saved_accounts_tool

저장된 계정 정보 나열 (세션 기반)

active_account_info_tool

현재 활성 계정 정보 가져오기

장치 관리

도구

설명

list_qpu_devices_tool

사용 가능한 모든 QPU(양자 처리 장치) 장치 나열

get_qpu_properties_tool

특정 QPU 장치의 상세 속성 가져오기

양자 컴퓨팅 작업

도구

설명

sample_tool

QPU 장치에서 양자 회로 샘플링 작업 실행

estimate_tool

양자 회로에 대한 기대값 추정 작업 실행

batch_sample_tool

여러 양자 회로 샘플링 작업을 배치 실행

batch_estimate_tool

하나의 관측 가능량(observable)으로 여러 회로에 대한 추정 작업 배치 실행

다중 목표 결정 (CircuitObservableBinding)

도구

설명

create_circuit_observable_binding_tool

여러 회로와 관측 가능량에 대한 바인딩 생성

add_product_rule_tool

데카르트 곱 조합 규칙 추가 (모든 조합)

add_zip_rule_tool

일대일 조합 규칙 추가 (쌍 조합)

estimate_with_binding_tool

생성된 바인딩을 사용하여 추정 실행

list_bindings_tool

저장된 모든 CircuitObservableBinding 객체 나열

delete_binding_tool

저장된 CircuitObservableBinding 객체 삭제

작업 관리

도구

설명

get_task_status_tool

작업 실행 상태 가져오기 (PENDING/RUNNING/DONE/FAILED/CANCELLED)

get_task_results_tool

완료된 작업의 계산 결과 가져오기

cancel_task_tool

실행 중이거나 대기 중인 작업 취소

list_my_tasks_tool

사용자의 최근 양자 컴퓨팅 작업 나열

MCP 리소스

리소스 URI

설명

qpanda://status

서비스 상태

circuits://bell-state

벨 상태 회로 예제

circuits://ghz-state

GHZ 상태 회로 예제

circuits://random

난수 생성기 회로

circuits://superposition

중첩 회로 예제

사용 예시

계정 구성

# Auto-configure via environment variables
# Or call explicitly
await setup_origin_quantum_account_tool(
    api_key="your_api_key"
)

장치 나열

devices = await list_qpu_devices_tool()
print(f"Available devices: {devices['total_devices']}")

샘플링 작업 실행

# Bell state circuit
circuit = """QINIT 2
CREG 2
H q[0]
CNOT q[0],q[1]
MEASURE q[0],c[0]
MEASURE q[1],c[1]"""

result = await sample_tool(
    circuit=circuit,
    device_id="20",
    shots=1000
)
task_id = result["task_id"]

# Check status and get results
status = await get_task_status_tool(task_id)
if status["task_status"] == "DONE":
    results = await get_task_results_tool(task_id)
    print(f"Measurement results: {results['results']}")

AI 코딩 플랫폼에서 구성

자동 구성: ./scripts/setup_configure.sh --mcp claude-desktop (또는 --mcp cline, --mcp cursor 등) 사용

모든 클라이언트는 동일한 구성 형식을 사용합니다 (/path/to/...를 실제 경로로 대체하세요):

{
  "mcpServers": {
    "qpanda3-runtime": {
      "command": "/path/to/qpanda3-runtime-mcp-server/.venv/bin/python",
      "args": ["-m", "qpanda3_runtime_mcp_server"],
      "cwd": "/path/to/qpanda3-runtime-mcp-server",
      "env": { "QPANDA3_API_KEY": "your_api_key_here" }
    }
  }
}

클라이언트

구성 파일 위치

Claude Code

~/.claude.json

Claude Desktop

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Cline

~/.vscode-server/data/User/globalStorage/saoudrizwan.cline/settings/cline_mcp_settings.json

Cursor

.cursor/mcp.json (프로젝트 루트)

Windsurf

~/.codeium/windsurf/mcp_config.json

더 많은 클라이언트(Trae 등)는 구성 가이드를 참조하세요.

개발

개발 의존성 설치

uv sync --extra dev --extra test

테스트 실행

uv run pytest

코드 린팅

uv run ruff check .
uv run mypy src/

문서 빌드

# Install documentation dependencies
uv sync --extra docs

# Build documentation (English + Chinese)
./scripts/build-docs.sh

# Local preview with live reload (language switching supported)
mkdocs serve

프로젝트 구조

qpanda3-runtime-mcp-server/
├── src/
│   └── qpanda3_runtime_mcp_server/
│       ├── __init__.py          # Package entry point
│       ├── server.py            # MCP server definition
│       ├── runtime.py           # QPanda3 Runtime core logic
│       └── utils.py             # Utility functions
├── scripts/
│   ├── setup_configure.sh       # One-click setup (Linux/macOS)
│   ├── setup_configure.ps1      # One-click setup (Windows PowerShell)
│   ├── setup_configure.bat      # One-click setup (Windows CMD)
│   ├── build-docs.sh            # Build all documentation
│   └── serve-docs.sh            # Serve docs with live reload
├── tests/
│   ├── __init__.py
│   ├── conftest.py              # pytest configuration
│   ├── test_server.py           # Server tests
│   └── test_runtime.py          # Runtime tests
├── docs/
│   ├── *.md                     # English documentation (default)
│   └── cn/                      # Chinese documentation
├── mkdocs.yml                   # MkDocs configuration (i18n)
├── .github/
│   └── workflows/               # GitHub Actions workflows
├── pyproject.toml               # Project configuration
├── README.md                    # Project documentation
├── LICENSE                      # Apache 2.0 License
├── .env.example                 # Environment variable example
└── .gitignore                   # Git ignore file

참고 사항

  1. 기본 서버: 서버는 기본적으로 https://qpanda3-runtime.qpanda.cn에 연결됩니다. QPANDA3_SERVER_URL을 설정하여 재정의할 수 있습니다.

  2. 채널: 서버는 기본적으로 qcloud 채널을 사용합니다.

  3. 비동기 지원: 모든 도구 함수는 async 함수입니다.

  4. 오류 처리: 모든 함수는 status 필드를 포함하는 딕셔너리를 반환합니다.

  5. 타입 힌트: 코드 가독성을 높이기 위해 Python 타입 힌트가 사용되었습니다.

라이선스

이 프로젝트는 Apache License 2.0에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.

관련 링크

기여

자세한 내용은 기여 가이드를 참조하세요.

변경 로그

버전 기록은 변경 로그를 참조하세요.

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - A tier

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OriginQ/qpanda3-runtime-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server