Skip to content

API & MCP

API/MCP tokens let AI agents and your own scripts work with your PikaPods account without your password or second factor.

A token can list your pods with their settings, show live usage and recent events, read logs and, if you allow it, run checked shell commands, while all other changes stay in the PikaPods panel.

The same token works in two ways:

  • As an MCP server for coding agents such as Claude Code, which can then diagnose a pod for you.
  • As a JSON-RPC API for your own scripts and monitoring.

Create a token in the PikaPods panel under Account > API/MCP. Give the token a name that identifies where it is used, choose an expiry and its permissions:

  • View pods: List your pods with their settings, live usage and recent events. Tools: list_pods, pod_status.
  • Read logs: Read your pods’ logs. Tool: pod_logs.
  • Run commands: Run checked shell commands in your pods. Tool: run_command. Only shown when Troubleshooting > Shell is available on your account.

The token is shown only once, so copy it to a safe place before closing the dialog.

  • Create a separate token for each agent, script or machine, so you can revoke it on its own. You can have up to 10 tokens.
  • Only grant the permissions you need and set an expiry where possible.
  • Treat tokens like passwords and remove them under Account > API/MCP when they are no longer needed.
  • We email you whenever a new token is created. All tokens are revoked when you change or reset your password.

Our Model Context Protocol (MCP) server lets a coding agent look at your pods, read their logs and find out why an app is down or slow. It is available at:

https://api.pikapods.com/mcp

The server only supports the latest MCP revision (2026-07-28, stateless Streamable HTTP) and authenticates with an Authorization: Bearer <YOUR TOKEN> header. Older clients that start with an initialize handshake can’t connect. Client support is tracked on Is MCP Good Yet?. At the moment, Claude Code works best.

Replace <YOUR TOKEN> with the token from Account > API/MCP.

Terminal window
claude mcp add --transport http --scope user pikapods https://api.pikapods.com/mcp --header "Authorization: Bearer <YOUR TOKEN>"

Run claude mcp list to check the connection. Claude Code supports the 2026-07-28 revision by default. MCP skills are in public beta and show up as pikapods:pod-debug.

Without an agent, you can call the same tools from scripts using plain JSON-RPC over HTTPS. Each request is a POST to https://api.pikapods.com/mcp and is independent, so there’s no session or handshake.

The tools available depend on the token’s permissions:

Tool Permission Arguments Description
list_pods View pods – All your pods with their settings, update status and help page link. No live data.
pod_status View pods pod One pod’s settings, live usage (state, CPU, memory, storage, uptime) and recent events, newest first.
pod_logs Read logs pod, num_entries (1–500, default 100), container, since, until, grep, exclude, timestamps A pod’s logs, oldest first. since and until take -2h or 2026-10-21 05:00. grep and exclude are regular expressions.
run_command Run commands pod, command Run one shell command in the pod’s main container. Same checks and limits as Troubleshooting > Shell.

pod takes the pod’s <slug>.pikapod.net hostname, the bare slug or its custom domain. pod_status and pod_logs count toward a limit of 120 reads per hour. run_command shares the hourly command limit with the panel’s shell.

Besides the token, every request needs these headers, matching the JSON-RPC body:

  • MCP-Protocol-Version: 2026-07-28
  • Mcp-Method: the JSON-RPC method, e.g. tools/call or tools/list.
  • Mcp-Name: the tool name, only for tools/call.

The body’s params._meta must repeat the protocol version and list the client’s capabilities, which can be empty. A tool’s result is in result.structuredContent. If the tool failed, for example because a limit was reached, result.isError is true and result.content[0].text has the reason.

Show the status of one pod:

Terminal window
curl -s https://api.pikapods.com/mcp \
-H "Authorization: Bearer $PIKAPODS_TOKEN" \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: tools/call" \
-H "Mcp-Name: pod_status" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "pod_status",
"arguments": {"pod": "my-pod.pikapod.net"},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}'

To list the tools your token can use, send "method": "tools/list" with Mcp-Method: tools/list, no Mcp-Name header and only _meta in params.