QIMA Logo

QIMA API MCP

Latest Update Time: 2026-07-07 00:00:00

QIMA API MCP turns any Model Context Protocol client (Cursor, Claude Desktop, and other AI assistants) into a hands-on assistant for the QIMA Public API. Instead of reading the docs and hand-writing requests, you can just ask your AI assistant to explore endpoints, explain fields, generate request scripts, and even call the APIs for you.

It runs locally on your machine and talks to the same QIMA Public API documented on this portal.

Download

⬇ Download QIMA API MCP (.zip)

The archive is self-contained: it bundles the server code plus a copy of the API specification and guides, so it works offline for exploration and scripting. The source also lives in the developer portal repository under src/mcp.

What it can do

CapabilityDescription
Explore APIsList modules, search endpoints, and describe an endpoint's parameters, request-body fields, and responses.
Explain fieldsLook up what any request/response field means — its type, whether it is required, and its allowed values.
Generate scriptsProduce ready-to-run curl or Python snippets for any endpoint, including the authentication step.
Authenticate & callObtain a short-lived token from POST /auth/v2/token using your credentials, then call other endpoints on your behalf.

Requirements

  • Python 3.10 or newer
  • A QIMA customer account, plus your Ai-Api-Access-Token (from QIMA sales or IT support)
  • Recommended: uv — then there is nothing to install manually

Installation

Unzip the download. That's it — no virtualenv, no pip install. The server declares its own dependencies, and uv installs them automatically the first time your AI client launches it. Just point your client at server.py with the uv command (see the configuration below).

Install uv once if you don't already have it:

curl -LsSf https://astral.sh/uv/install.sh | sh   # macOS / Linux
# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Option B — with a virtualenv + pip

cd qima-api-mcp
python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Configuration

The server is configured entirely through environment variables set in your MCP client. Exploration tools need no configuration; only authenticate and call_api require credentials.

VariableRequired forDefaultDescription
QIMA_ACCESS_TOKENauth / callsYour Ai-Api-Access-Token, provided by QIMA.
QIMA_ACCOUNTauth / callsYour QIMA login / username.
QIMA_PASSWORDauth / callsYour password (plain text or a 32-char MD5 hash). Plain text is hashed automatically.
QIMA_API_BASE_URLhttps://ppapi.qima.comAPI host. Override for production.
QIMA_REFERERhttps://preprodmy.qima.com/Referer header value (must stay constant across a session).
QIMA_USER_TYPEclientclient or employee.

Security: your password and access token are never embedded in generated scripts or tool output. The access token is masked, and scripts read secrets from the environment at runtime.

Add the server to your MCP config — Cursor's ~/.cursor/mcp.json or Claude Desktop's claude_desktop_config.json — pointing at where you unzipped the download. With uv, the command is simply uv run server.py:

{
  "mcpServers": {
    "qima-api": {
      "command": "uv",
      "args": ["run", "/absolute/path/to/qima-api-mcp/server.py"],
      "env": {
        "QIMA_ACCESS_TOKEN": "<your-ai-api-access-token>",
        "QIMA_ACCOUNT": "<your-username>",
        "QIMA_PASSWORD": "<your-password>"
      }
    }
  }
}

Without uv (virtualenv + pip)

If you used Option B, point command at that virtualenv's Python instead:

{
  "mcpServers": {
    "qima-api": {
      "command": "/absolute/path/to/qima-api-mcp/.venv/bin/python",
      "args": ["/absolute/path/to/qima-api-mcp/server.py"],
      "env": {
        "QIMA_ACCESS_TOKEN": "<your-ai-api-access-token>",
        "QIMA_ACCOUNT": "<your-username>",
        "QIMA_PASSWORD": "<your-password>"
      }
    }
  }
}

After saving, reload your client's MCP servers. The qima-api server should appear with its tools available.

Available tools

ToolPurpose
list_api_categoriesList API modules and endpoint counts.
list_apisList endpoints (optionally filtered by category).
search_apisKeyword search across endpoints.
get_api_detailsFull parameters / request-body fields / responses for one endpoint.
explain_fieldExplain a field's meaning, type, required flag, and enum values.
read_api_guideReturn a human-written guide (e.g. getting-started).
generate_request_scriptGenerate a curl or python script for an endpoint.
get_config_statusShow configured values (masked) and auth readiness.
authenticateCall POST /auth/v2/token and cache the session token.
call_apiDirectly call any endpoint with the right headers injected.

Example prompts

Once connected, try asking your AI assistant:

  • "List the Inspection endpoints and explain how to create a booking."
  • "What does announcementType mean in the audit order create request?"
  • "Generate a Python script to search inspection orders."
  • "Authenticate and get the details of a specific order for my user."

How authentication works

  1. The server sends account + MD5(password) + userType with the Ai-Api-Access-Token and Referer headers to POST /auth/v2/token.
  2. The returned token, userId, refreshKey, and validBefore are cached in memory. Business calls add the Ai-User-Id and Authorization: Bearer <token> headers automatically.
  3. The token is re-fetched automatically when it is missing or near expiry.