Configuration

April 16, 2026 ยท View on GitHub

One-Click Setup

See Installation for the full one-click setup instructions.

# Linux / macOS
./scripts/setup_configure.sh --api-key YOUR_KEY --mcp claude-desktop

# Windows (PowerShell)
.\scripts\setup_configure.ps1 -ApiKey "YOUR_KEY" -McpClient claude-desktop

The scripts handle: dependency installation, API key configuration, and MCP client setup automatically.

Environment Variables

VariableDescriptionRequiredDefault
QPANDA3_API_KEYYour Origin Quantum API keyYes-
QPANDA3_CONFIG_PATHPath to config fileNo-
QPANDA3_SERVER_URLOverride default server URLNohttps://qpanda3-runtime.qpanda.cn
QPANDA3_LOG_LEVELLog level (DEBUG, INFO, WARNING, ERROR)NoINFO

Setting Your API Key

Option A: .env file (recommended)

cp .env.example .env
# Edit .env: QPANDA3_API_KEY=your_api_key

Option B: Environment variable

# Linux/macOS
export QPANDA3_API_KEY="your_api_key"

# Windows (PowerShell)
$env:QPANDA3_API_KEY="your_api_key"

Option C: config.yml

api_key: 'your_api_key_here'

MCP Client Configuration

Use the setup scripts (setup_configure.sh / setup_configure.ps1) to auto-configure MCP clients. The instructions below are for manual setup.

Replace /path/to/qpanda3-runtime-mcp-server with your actual project path. Windows users: Use .venv\Scripts\python.exe instead of .venv/bin/python.

Configuration Template

All MCP clients use the same configuration format:

{
  "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" }
    }
  }
}

Client Config File Locations

ClientConfig Location
Claude Code~/.claude.json
Claude DesktopSee below
Cline~/.vscode-server/data/User/globalStorage/saoudrizwan.cline/settings/cline_mcp_settings.json
Cursor.cursor/mcp.json (project root)
Windsurf~/.codeium/windsurf/mcp_config.json
Trae.trae/mcp.json (project root)
Amazon Q~/.aws/amazonq/mcp.json
Continue.continue/mcpServers/mcp.json or ~/.continue/mcpServers/mcp.json
OpenCode~/.config/opencode/opencode.json

!!! note "Claude Desktop Config Locations"

- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Linux: `~/.config/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`

Setup Script CLI Reference

Linux / macOS (setup_configure.sh)

./scripts/setup_configure.sh [OPTIONS]
OptionDescription
--api-key KEYSet API key directly
--mcp CLIENTConfigure specific client: claude-code, claude-desktop, cline, cursor
--interactive / -iInteractive mode (prompts for API key and client)
--skip-depsSkip dependency installation
--skip-mcpSkip MCP client configuration

API key resolution order: --api-key > QPANDA3_API_KEY env > interactive prompt > .env.example fallback

Windows PowerShell (setup_configure.ps1)

.\scripts\setup_configure.ps1 [-ApiKey KEY] [-McpClient CLIENT] [-Interactive] [-SkipDeps] [-SkipMcpClient] [-ProjectDir DIR]

Same resolution order as above. The -ProjectDir parameter overrides the auto-detected project directory.

Troubleshooting

ProblemSolution
"No credentials provided"Set QPANDA3_API_KEY env var or check .env file
"Authentication failed"Verify your API key is correct
"Connection timeout"Check network and firewall settings
ModuleNotFoundErrorRun uv sync to install dependencies
Tools not availableEnsure QPANDA3_API_KEY is set in MCP config env block

Debug mode:

export QPANDA3_LOG_LEVEL=DEBUG
.venv/bin/python -m qpanda3_runtime_mcp_server --verbose