GuidesRecipesAPI Reference
Log In
Guides

Use with Code

You can connect Quantium MCP from code using an API client that supports remote MCP tools. This is useful when building your own application, automation workflow, or AI agent on top of Quantium MCP

What you need

  • Quantium MCP Server URL:
    • CN environment: https://mcp.quantiumpe.com/mcp
    • SG environment: https://mcp.quantiumportal.com/mcp
    • EU environment: https://mcp-eu.quantiumportal.com/mcp
  • OpenAI API key
  • Authentication token from Quantium system

Authentication token

Quantium MCP requires a bearer token in the Authorization header.

For production or long-running workflows, it is recommended to retrieve a fresh token programmatically instead of manually copying tokens from the Quantium platform.

Refer to:

Python example

import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

resp = client.responses.create(
    model="gpt-5",
    tools=[
        {
            "type": "mcp",
            "server_label": "quantium",
            "server_url": "https://mcp.quantiumportal.com/mcp",
            "headers": {
                "Authorization": f"{your_quantium_token}"
            }
        }
    ],
    input="Use quantium tools to get the asset summary for asset 'ABC'. If you need scopeId/token, ask me."
)

print(resp.output_text)

JavaScript example

import OpenAI from "openai";

var client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

var resp = await client.responses.create({
  model: "gpt-5",
  tools: [
    {
      type: "mcp",
      server_label: "quantium",
      server_url: "https://mcp.quantiumportal.com/mcp",
      headers: {
        Authorization: `${your_quantium_token}`
      }
    }
  ],
  input: "Use quantium tools to get the asset summary for asset 'ABC'. If you need scopeId/token, ask me.",
});

console.log(resp.output_text);