Skip to main content

MCP server for the Kipu Quantum Hub

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

qhub-mcp

MCP server for the Kipu Quantum Hub. Exposes the Hub and Quantum Workloads APIs as tools for MCP-compatible agents and editors (Claude Desktop, Claude Code, Cursor, VS Code, and any other MCP client).

What it provides

Tools are grouped into two namespaces:

  • hub_* — core Hub platform API (services, data pools, applications, use cases, ...)
  • quantum_* — Quantum Workloads API (quantum jobs, sessions, backends, ...)

Plus a top-level run_subscribed_service tool to invoke services you are subscribed to.

Prerequisites

  • Python >= 3.12
  • uv (provides uvx)
  • A Kipu Quantum Hub personal access token

Authentication

The server picks up credentials in the following order:

  1. KQH_PERSONAL_ACCESS_TOKEN environment variable.
  2. Credentials stored by qhubctl after qhubctl login -t <YOUR_PERSONAL_ACCESS_TOKEN>.

When you authenticate with qhubctl, the MCP server transparently reuses the same access token — no need to duplicate the token in your MCP client config. This is the recommended setup for local use so the token does not live in config files, and it keeps the CLI and the MCP server in sync on a single session.

Optional environment variables

  • QHUB_API_BASE_URL — override the API base URL (defaults to https://api.hub.kipu-quantum.com). Useful for staging or self-hosted Hubs.

Configuration

The server is launched via uvx qhub-mcp. The snippets below show the minimal configuration for common MCP clients. Add the environment block from Option B if you prefer passing the token inline instead of using qhubctl.

Option A — with qhubctl (recommended): run qhubctl login -t <TOKEN> once, then use the config without an env block.

Option B — inline token: add "env": { "KQH_PERSONAL_ACCESS_TOKEN": "<TOKEN>" } to the server entry.

Claude Desktop

One-click install (recommended): download qhub-mcp.mcpb from the latest release and double-click it, drag it into Claude Desktop, or install via Settings → Extensions → Advanced settings → Install Extension. Claude Desktop prompts for your personal access token on install and stores it in the OS keychain. uv must be installed on your machine — see the Prerequisites section.

Manual setup: edit claude_desktop_config.json (Settings → Developer → Edit Config) and add:

{
  "mcpServers": {
    "qhub-mcp": {
      "command": "uvx",
      "args": [
        "qhub-mcp"
      ]
    }
  }
}

Claude Code

Register the server with the CLI:

claude mcp add qhub-mcp -- uvx qhub-mcp

Or add it to .mcp.json / ~/.claude.json:

{
  "mcpServers": {
    "qhub-mcp": {
      "command": "uvx",
      "args": [
        "qhub-mcp"
      ]
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

{
  "mcpServers": {
    "qhub-mcp": {
      "command": "uvx",
      "args": [
        "qhub-mcp"
      ]
    }
  }
}

VS Code

Register the server with the CLI:

code --add-mcp "{\"name\":\"qhub-mcp\",\"command\":\"uvx\",\"args\":[\"qhub-mcp\"]}"

Or add to your user or workspace settings.json (requires an MCP-capable extension such as GitHub Copilot Chat in agent mode):

{
  "mcp": {
    "servers": {
      "qhub-mcp": {
        "command": "uvx",
        "args": [
          "qhub-mcp"
        ]
      }
    }
  }
}

Other MCP clients

Any MCP client that supports stdio servers can launch qhub-mcp with:

  • command: uvx
  • args: ["qhub-mcp"]
  • optional env: { "KQH_PERSONAL_ACCESS_TOKEN": "<TOKEN>", "QHUB_API_BASE_URL": "<URL>" }

Remote deployment (Keycloak OAuth)

The same package runs as a remote HTTP server protected by Keycloak. Local stdio remains the default. Remote mode is opt-in via environment variables, so uvx qhub-mcp is unchanged.

Server environment variables

Variable Required Description
QHUB_MCP_TRANSPORT yes (http) Set to http to enable remote mode. Defaults to stdio.
KEYCLOAK_REALM_URL yes (remote) Keycloak realm URL, e.g. https://auth.example.com/realms/kipu.
MCP_PUBLIC_URL yes (remote) The externally reachable base URL of this server, e.g. https://mcp.hub.kipu-quantum.com. Must match what clients connect to.
MCP_AUDIENCE no Expected token audience to validate (recommended).
QHUB_MCP_HOST no Bind host (default 0.0.0.0).
QHUB_MCP_PORT no Bind port (default 8000).

Keycloak realm setup

Enable Dynamic Client Registration for the realm so MCP clients can register themselves. Add a trusted-host / client-registration policy for the server URL (e.g. https://mcp.hub.kipu-quantum.com/*).

Running

QHUB_MCP_TRANSPORT=http \
KEYCLOAK_REALM_URL="https://auth.example.com/realms/kipu" \
MCP_PUBLIC_URL="https://mcp.hub.kipu-quantum.com" \
MCP_AUDIENCE="qhub-mcp" \
uvx qhub-mcp

Or with Docker:

docker build -t qhub-mcp:remote .
docker run --rm -p 8000:8000 \
  -e KEYCLOAK_REALM_URL="https://auth.example.com/realms/kipu" \
  -e MCP_PUBLIC_URL="https://mcp.hub.kipu-quantum.com" \
  qhub-mcp:remote

Deploy behind TLS so the public URL is https://… and matches MCP_PUBLIC_URL. The server advertises its OAuth metadata at /.well-known/oauth-protected-resource/mcp.

Authentication and account scope

Clients authenticate to the server via the Keycloak OAuth flow. The server forwards the caller's verified token to the Kipu Hub API as a Bearer token, so no personal access token is needed in remote mode.

Each tool accepts an optional organization parameter (the x-OrganizationId header parameter). Omit it to act on the user's personal account, or pass an organization UUID to act within that organization. Use hub_getMyAccounts or hub_getOrganizations to discover available organizations.

Local development

  1. Clone this repository.
  2. Install uv if you don't have it.
  3. Run uv sync.
  4. Point your MCP client at the local checkout:
    {
      "mcpServers": {
        "qhub-mcp": {
          "command": "uv",
          "args": [
            "--directory",
            "<PROJECT_PATH>",
            "run",
            "src/qhub_mcp/server.py"
          ],
          "env": {
            "KQH_PERSONAL_ACCESS_TOKEN": "<YOUR_PERSONAL_ACCESS_TOKEN>"
          }
        }
      }
    }
    

Building the MCPB package

The Claude Desktop one-click installer is shipped as an .mcpb file built from mcpb/manifest.json. To rebuild it locally:

npm install -g @anthropic-ai/mcpb
mcpb pack ./mcpb qhub-mcp.mcpb

# or with npx:
npx @anthropic-ai/mcpb pack ./mcpb qhub-mcp.mcpb

The resulting qhub-mcp.mcpb can be double-clicked to install into Claude Desktop. See the MCPB documentation for details on the format.

Debugging

Use the MCP Inspector to interactively explore the server's tools, inspect requests and responses, and troubleshoot issues:

npx @modelcontextprotocol/inspector uvx qhub-mcp

To inspect a local checkout instead of the published package:

npx @modelcontextprotocol/inspector uv --directory <PROJECT_PATH> run src/qhub_mcp/server.py

Authentication follows the same order as the server itself (see Authentication). Pass the token inline if you are not using qhubctl:

KQH_PERSONAL_ACCESS_TOKEN=<TOKEN> npx @modelcontextprotocol/inspector uvx qhub-mcp

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

qhub_mcp-1.11.0.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

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

qhub_mcp-1.11.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file qhub_mcp-1.11.0.tar.gz.

File metadata

  • Download URL: qhub_mcp-1.11.0.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for qhub_mcp-1.11.0.tar.gz
Algorithm Hash digest
SHA256 4d1faf5426474a51e60a413ccf4f2fed1340d61632f863004a719bda095dd416
MD5 58e2091e7fe87759a2dc4244c04b1ef0
BLAKE2b-256 b49c20427a20f6d9cd9f5f34952580c8c12481732743cecd3dd5e7538b75c6a3

See more details on using hashes here.

File details

Details for the file qhub_mcp-1.11.0-py3-none-any.whl.

File metadata

  • Download URL: qhub_mcp-1.11.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for qhub_mcp-1.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e621bf80090431cbdc363f3e2ed4e705aaee4e070472bde6da3f07e88feddb95
MD5 ebb23c26490c96056785a48656826f9c
BLAKE2b-256 d13bcd8779ebd9e05ab3d72dcfc3c9835ae008641da50977b1bfbebf4860db94

See more details on using hashes here.

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