Skip to navigation

Set up with MCP

Connect Claude, Claude Code, ChatGPT, Codex, Cursor 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 connects in one of two ways: it signs in with your NativePort account in the browser, or it sends an API key in the Authorization header. Either way it 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.

A client with a sign-in flow for MCP servers connects without a key; Claude, Claude Code, ChatGPT and Codex already do. No key is copied or pasted, so none can end up in a chat or a config file.

1

Create your account

Sign up at accounts.nativeport.ai/sign-up. You land on panel.nativeport.ai, and that first visit sets up your account.

2

Add the server without a key

Claude Code:

claude mcp add --transport http nativeport https://api.nativeport.ai/mcp

Then run /mcp inside Claude Code, select nativeport and choose Authenticate.

Claude (web or desktop): Settings → Connectors → Add custom connector, with the URL https://api.nativeport.ai/mcp.

Other clients: add https://api.nativeport.ai/mcp with no Authorization header. The server answers 401 with a WWW-Authenticate header, and the client starts the sign-in from there.

3

Approve in the browser

Your browser opens the NativePort sign-in. Sign in with the account from the first step and approve the connection. The client then lists the nativeport server with its four tools and one resource.

Calls from a signed-in app are billed to your account’s balance, exactly like calls made with a key.

Connected apps

Every app you approve appears under Connected apps at panel.nativeport.ai/keys. Revoke cuts it off on its next request, even while its sign-in is still valid.

For now, a revoked app cannot sign in to the same account again: approving it a second time still gets 401. To use that app again, connect it with an API key. Revoke only an app you want gone.

If your account is not set up yet

Signing up on the client’s sign-in page, without ever opening the panel, leaves the account unfinished. The server still connects and find_endpoints and inspect_endpoint work, but account and call_endpoint answer:

Your NativePort account is not set up yet. Sign in once at https://panel.nativeport.ai, then try again.

Open panel.nativeport.ai once with that account. The next call works, and the client does not need to reconnect.

Clients that cannot sign in

The sign-in identifies each client by a metadata document it publishes at a URL (Client ID Metadata Documents). A client that only supports dynamic client registration cannot sign in yet; connect it with an API key.

Use an API key (no browser)

For servers, CI and agents without a browser, send your key in the Authorization header.

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 on your account. Arguments: id (recommended), method, path, optional query, and either a JSON body or text form fields. 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 the body’s content-type are forwarded; other request headers cannot be set through MCP.

A few routes take a form instead of JSON: ElevenLabs speech-to-text answers a JSON body with 422. Pass their fields in form (strings, numbers or booleans), and call_endpoint sends them as multipart/form-data. body and form cannot be combined. Uploading a file still needs a direct HTTP call.

What comes back

  • Responses are read for a model: JSON is parsed, text is capped at 512 KB (truncated: true when cut), a JSON array over the cap comes back as its first complete items with truncated: true and returnedItems (page the rest with the endpoint’s own limit/offset), a JSON object over the cap is cut down to fit when it can be, with truncated: true and each cut listed in omitted with its path and size (a list keeps its first items whole and counts the rest in omittedItems, a string keeps its start and ends in …[cut], and anything else is left out as [left out: N bytes]), an object over 8 MB or one that cannot be cut down comes back as cut text, 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.", a trial-restriction body or the account-not-set-up sentence should be reported as is; 404 on a documented path means the action is not admitted for your account.

Connection semantics

SituationResult
No credential401 {"error":"Unauthorized."} with WWW-Authenticate: Bearer resource_metadata="https://api.nativeport.ai/.well-known/oauth-protected-resource"; a client with a sign-in flow starts it from there
Unknown or revoked key401 {"error":"Unauthorized."} at connection time
Revoked app401 on its next request; for now it cannot sign in to the same account again (see Connected apps)
Signed in, account not set up yetThe server still connects: find_endpoints and inspect_endpoint work, and account and call_endpoint answer with the sentence in If your account is not set up yet.
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.