Technical reference

MCP

Connect AI tools through the same API. Technical reference in English.

Browse documentation

The connector lets an MCP client use the same public HTTP API as a custom integration. It runs on your computer as a stdio process. Your MCP client must be able to reach the AssetRouter API.

Install Python 3.12 or later. Download the MCP connector and its pinned dependencies into a private folder.

From that folder:

python -m venv .venv-mcp
.venv-mcp/bin/python -m pip install -r requirements-mcp.txt

On Windows, use PowerShell (not Command Prompt). If py --version gives an error or a version below 3.12, install Python with winget install -e --id Python.Python.3.12 and open a new PowerShell window; the Microsoft Store Python has no py launcher. Then the same steps are:

New-Item -ItemType Directory -Force "$HOME\assetrouter-mcp" | Out-Null
Set-Location "$HOME\assetrouter-mcp"
Invoke-WebRequest https://assetrouter.eu/docs/mcp/download/connector/ -OutFile assetrouter-mcp.py
Invoke-WebRequest https://assetrouter.eu/docs/mcp/download/requirements/ -OutFile requirements-mcp.txt
py -3 -m venv .venv-mcp
.\.venv-mcp\Scripts\python.exe -m pip install -r requirements-mcp.txt

Configure your MCP client to launch the downloaded assetrouter-mcp.py with this environment's Python executable. On Windows the executable is .venv-mcp\Scripts\python.exe; on macOS/Linux it is .venv-mcp/bin/python.

Sign in through the browser

Set only ASSETROUTER_API_URL and sign in once, from the same folder:

ASSETROUTER_API_URL=https://assetrouter.eu .venv-mcp/bin/python assetrouter-mcp.py sign-in

On Windows, in PowerShell:

$env:ASSETROUTER_API_URL = "https://assetrouter.eu"
.\.venv-mcp\Scripts\python.exe assetrouter-mcp.py sign-in

It opens the browser on your workspace, prints a code and waits. Approve the code for your organisation; the connector saves its credential in ~/.assetrouter/mcp-credentials.json (or the path in ASSETROUTER_CREDENTIALS_FILE) and uses it from then on. From inside an MCP client the sign_in tool does the same: its first call returns the link and the code, a second call after approval finishes. The quick start has a prompt that lets the agent do the whole setup.

Sign in with a credential

For servers and CI, supply these environment variables through your client's private configuration or secret store instead:

Variable Value
ASSETROUTER_API_URL API origin, for example https://assetrouter.eu. No /api suffix.
ASSETROUTER_CLIENT_ID The organization's API client identifier.
ASSETROUTER_CLIENT_SECRET The matching API secret.

For clients using a mcpServers JSON configuration, the equivalent setup is below. Replace both absolute paths and the credential placeholders. Launching the file directly avoids a working-directory requirement:

{
  "mcpServers": {
    "assetrouter": {
      "command": "/absolute/path/to/.venv-mcp/bin/python",
      "args": ["/absolute/path/to/assetrouter-mcp.py"],
      "env": {
        "ASSETROUTER_API_URL": "https://assetrouter.eu",
        "ASSETROUTER_CLIENT_ID": "YOUR_CLIENT_ID",
        "ASSETROUTER_CLIENT_SECRET": "YOUR_CLIENT_SECRET"
      }
    }
  }
}

Use your service's HTTPS origin outside local testing. Other clients may expose command, arguments and environment as separate form fields. Do not put credentials in prompts, source control or shared configuration. Anyone allowed to use this connector acts with the configured organization's API credentials. This is a local connector; there is no hosted MCP endpoint.

Tools

MCP tool HTTP API call Purpose
sign_in() POST /api/v1/sign-in, then POST /api/v1/sign-in/token Connect through the browser when no credential is configured. Returns connected, or a link and code for the user to approve.
list_licenses() GET /api/v1/library Discover recorded resource URLs, collection coverage, accepted conditions and license states.
list_authorization_requests() GET /api/v1/records Read its request and authorization records. These do not prove download or actual use of content.
request_authorization(tenant_id, resource, usage) POST /api/v1/authorizations Request an access token under existing rights. usage defaults to ai-input.
report_problem(kind, text, resource_url) POST /api/v1/reports Report a refused token (token_not_working), a misuse (misuse) or anything else (other). Returns a case number and its state.
list_reports() GET /api/v1/reports Read the organization's reports with case number and state.
spending_status() GET /api/v1/spending Read this agent's spending cap: how much it has spent this period, how much is left and when the period restarts. cap is null when the organization set none. Read only.
request_data(description, usage) POST /api/v1/data-requests Ask AssetRouter for data the agent could not find: what, how much, in what form, and the intended use (ai-input by default). AssetRouter looks for an owner who has it. Nothing is bought, and no owner sees the request until AssetRouter has checked that it fits.
list_data_requests() GET /api/v1/data-requests Read the organization's data requests and their state (open, matched, closed).

Example tool arguments (replace the identifier and URL with a resource in your library):

{"tenant_id": "publisher-id", "resource": "https://publisher.example/report.pdf", "usage": "ai-input"}

A normal agent flow is: call list_licenses, inspect the entry's coverage, selected_offer, verification, validity and next_step, then request authorization for the intended URL and use. Declared rights are visible immediately but cannot authorize access before confirmation. A collection pattern is not an exhaustive file list. After authorization, the agent's HTTP tool or application fetches the resource directly from the publisher using Authorization: License <access_token>. Send that token only to the intended resource server; never send your organization API secret there.

The connector forwards JSON responses from the API. Apart from buy_license below, it does not buy licenses, confirm declared rights or download the requested resource. Treat returned access tokens as credentials. Content retrieval and token validation remain the publisher integration's responsibility. Library and record results follow the API's limits; the connector does not silently collect additional pages.

Requests time out after 15 seconds, responses are limited to 1 MiB, and redirects are not followed. API credentials are sent only to the configured origin. HTTP errors report their status and, for recognized refusal codes, a fixed explanation of the next step without exposing remote response text or credentials. There are no automatic retries: after a timeout, check the request records before repeating an authorization request because the API may already have processed it.

Buy a license

buy_license(resource_url, max_price_usd, usage="ai-input") buys access to one URL and pays in USDC through x402. It needs the full connector, not the single file: download assetrouter-agent.zip, unzip it, install requirements-mcp.txt as above and point your MCP client at assetrouter-agent/assetrouter-mcp.py.

What it does, in order: reads the owner's robots.txt License: line, reads the RSL license, picks the offer for the use you asked, pays, checks the signed license certificate against the issuer's public keys and saves the resource next to the connector. It returns the outcome, the price, the network, the transaction hash and the path of the saved file.

Which file (11/11/2026). When the owner declared the SHA-256 fingerprint of the file sold, the result also carries it as artifact_sha256, and digest_matches says whether the saved file has that fingerprint. Both are null when the owner declared none. With digest_matches: false the purchase stands, because the file arrived, and a next field tells the agent to keep the file and the log, tell the user and call report_problem with both fingerprints. A refund is the owner's to decide.

Variable Required Meaning
ASSETROUTER_WALLET_KEY for paid offers Private key of the wallet that pays. Keep it in your MCP client's environment, never in a prompt.
ASSETROUTER_BUYER_ORG for paid offers Your company name (sales are business to business).
ASSETROUTER_BUYER_VAT for paid offers Your VAT number with the country prefix, for example IT01234567890.
ASSETROUTER_MAX_SPEND_USD no A ceiling per purchase, applied even if the agent asks for more.

Fences, always on:

  • it never signs more than max_price_usd (or the ceiling), checked on the amount the server asks for, not only on the published price;
  • it pays only USDC on Base or Base Sepolia, and refuses any other network or token even if offered;
  • the payment must be for the exact URL you asked;
  • the wallet key, the payment signature and your organization secret never appear in the tool's output.

The tool spends real money on Base. Tell your agent to ask you before calling it.

Spending cap per agent (11/11/2026). ASSETROUTER_MAX_SPEND_USD lives on the agent's own computer, where the agent could change it. The cap that binds is set by an owner or administrator of your organization in the workspace, under Connect your agents, for each agent and for a day, a week or a month. Your organization answers for the purchases of its agents. A purchase that would go over it is refused before any payment with unauthorized_client and reason spending_cap_reached, or spending_cap_currency when the sale is in another currency than the cap. buy_license then returns outcome: "blocked" and a next field telling the agent to call spending_status and not to retry: no tool and no API route lets an agent change its own cap.