Set up with MCP

Connect Claude Code, Cursor, Codex or OpenCode to NativePort as a remote MCP server
View as Markdown

NativePort speaks the Model Context Protocol over Streamable HTTP at https://api.nativeport.ai/mcp. Your agent authenticates with your NativePort API key in the Authorization header and gets four tools that mirror the Agent API: find an endpoint, read its price, call it, check the balance. No SDK, no skill file, no per-provider setup.

1

Get a key

Create an account at accounts.nativeport.ai/sign-up and copy the Default key from panel.nativeport.ai/keys.

2

Claude Code

claude mcp add --transport http nativeport https://api.nativeport.ai/mcp \
--header "Authorization: Bearer $NATIVEPORT_API_KEY"

/mcp inside Claude Code then lists the nativeport server with its four tools and one resource.

3

Cursor, Codex, OpenCode and other JSON-configured clients

{
"mcpServers": {
"nativeport": {
"url": "https://api.nativeport.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}

Put the block in the client’s MCP configuration file (for example .cursor/mcp.json). Clients that support type accept "type": "http".

Tools

ToolReads or writesWhat it does
find_endpointsreadRanks catalog entries for 2-3 English keywords, by fit then expected price. Same ranking as GET /v1/catalog?q=.
inspect_endpointreadThe full entry for an id: admitted actions, minimal example, price (what the ledger debits), restrictions, docs URL, plus a ready-to-send native request and its curl.
call_endpointdebits the balanceExecutes a native route with your key. Arguments: id (recommended), method, path, optional query and JSON body. Returns status, requestId, the parsed body and the entry’s price label.
accountreadbalanceMicro, balanceUsd, status and, while under trial probation, trialState.

The resource nativeport://skill returns the same SKILL.md the gateway serves over HTTP.

call_endpoint runs the ordinary gateway route internally, so billing, logging and every restriction apply exactly as for a direct HTTP call. Only your Authorization header and a JSON content-type are forwarded; other request headers cannot be set through MCP.

What comes back

  • Responses are read for a model: JSON is parsed, text is capped at 512 KB (truncated: true when cut), binary bodies under the cap come back base64-encoded with their MIME type and larger ones are omitted with a note. Do not request streaming through call_endpoint.
  • A non-2xx answer is a tool result with isError: true and the gateway’s body verbatim. 402 means the balance is empty and the agent should stop and tell you; 403 with "Account suspended." or a trial-restriction body should be reported as is; 404 on a documented path means the action is not admitted for this key.

Connection semantics

SituationResult
No or unknown key401 {"error":"Unauthorized."} at connection time
Suspended account403 {"error":"Account suspended."}
Empty balanceThe server still connects: find_endpoints, inspect_endpoint and account work, and call_endpoint returns the 402 as an error result, so the agent can ask you to top up.
Any method other than POST405 with Allow: POST
Accept without both application/json and text/event-stream406 (Streamable HTTP requires both; every mainstream client sends them)

The server is stateless: there are no sessions to resume, and each request stands alone.