Integrations
Connect Claude Code and Cursor with P/9Dev MCP
Connect Claude Code, Cursor or opencode to your P/9 account with P/9Dev MCP to check balance and usage, read request logs and manage API keys from chat.
P/9Dev MCP is a Model Context Protocol server for your P/9 account. Add it to your AI coding tool once, then ask things like:
- "What's my P/9 balance, and what did we spend this week?"
- "Which key made the 5xx errors in the last hour?"
- "Create an API key for CI, capped at 500 PKR, that expires at the end of the month."
- "Lower the rate limit on the staging key to 30 requests per minute."
The server is at https://sovereign.paranine.com/api/mcp and works with any MCP client that supports remote (Streamable HTTP) servers and custom headers.
Note: P/9Dev MCP manages your account: usage, spend, models and API keys. It does not run inference. To call models from your tool, set up a provider as well, for example with the OpenCode guide.
1. Create a developer token
Anyone signed in to the dashboard can create their own developer tokens. Open Developer tokens in the sidebar (under API keys) and choose Create token.
- Name: something you'll recognise, like
laptop opencode. - Access:
- Read only (the default) covers balance, usage, models, projects, keys, request logs and account activity.
- Read and manage keys also lets your tool create, tighten and revoke API keys. Only owners and admins can choose it.
- Expires after: 7, 30, 60 or 90 days.
- Show new keys in the chat: off by default, and offered only with Read and manage keys (see Keys created from chat).
The token (p9_mcp_…) is shown once, together with the setup for your tool. Copy it then. You can have up to 10 active tokens.
A developer token is not an API key: it can't call models, and an API key (sk_p9_…) can't be used with P/9Dev MCP.
2. Connect your tool
Replace <TOKEN> with your developer token. Keep the token out of files you commit.
claude mcp add --transport http p9dev https://sovereign.paranine.com/api/mcp \
--header "Authorization: Bearer <TOKEN>"To check the connection, ask your tool "who am I on P/9?". It calls whoami and lists what your token can do.
Tools
| Tool | Access | What it does |
|---|---|---|
whoami | Read | Your user, organisation, token access and available tools |
list_projects | Read | Projects and their ids |
list_keys | Read | Your organisation's API keys that aren't revoked, newest first: prefix, project, limits, expiry, last use. Never the key values |
get_balance | Read | Credit limit, spend and remaining balance in PKR |
list_models | Read | Models your organisation can call |
usage_summary | Read | Requests, latency, tokens (and cost for one key) over up to 30 days |
usage_timeseries | Read | A usage metric over time, by model, key or project |
list_requests | Read | Recent requests with status, tokens, latency and cost. A request id or model name your caller sent (rather than one P/9 assigned) is shown under untrusted |
list_activity | Read | Recent account changes. Your own actions show as "you", other members' as "another member" with their role, never their email |
create_key | Manage keys | Create an API key. A credit limit is required and must fit your organisation's unallocated budget. The key expires 30 days from now unless you choose another date, at most 90 days out. The name must be 1-100 characters and not already used by an active key in the project |
update_key_limits | Manage keys | Lower a key's rate or credit limit, or bring its expiry earlier (at least 1 hour away). Your tool must give the key's prefix to confirm |
revoke_key | Manage keys | Revoke a key. Your tool must give the key's prefix to confirm |
Amounts are in PKR and times in Pakistan time (+05:00).
Built to be safe with an AI agent
An AI tool reads web pages, files and tool output, and any of them can contain instructions meant to mislead it. P/9Dev MCP is built so that a misled agent can't do much harm:
- Read only unless you choose otherwise. Managing keys needs a token an owner or admin created for that purpose.
- Keys can only be tightened from chat. Raising a limit, extending an expiry or removing a cap happens in the dashboard only.
- Tokens can't make tokens. Creating and revoking developer tokens happens in the dashboard only.
- Changing or revoking a key needs confirmation. Your tool has to give the key's prefix, so it can't act on a key by guessing an id. Tightening can stop a key's traffic, so it needs the same confirmation as revoking.
- Keys made from chat are always capped. Every key created through P/9Dev MCP has a credit limit and expires within 90 days.
- Text other people wrote is marked. Request metadata, user agents, and any request id or model name your callers sent come back under an
untrustedfield, with hidden characters removed. Key, project and token names are typed by members of your organisation; your tool is told to treat them as data too. - Browser pages can't call it. A request carrying a browser
Originheader is refused with403, so a web page you visit cannot reach your account through your token. - Colleagues stay private. Other members' email addresses are never sent to your AI tool.
- Limits. Per token: 120 calls a minute and 30 changes an hour. Per person, across all their tokens: 240 calls a minute and 60 changes an hour. The key-list, usage and request-log tools share 120 calls a minute per organisation. Every call counts toward these limits.
Keys created from chat
By default a key created through P/9Dev MCP is not put in the chat. Your tool gets a one-time link instead:
https://sovereign.paranine.com/dashboard/keys/reveal#…
Open it while signed in to see and copy the key. The link works once, only for you, and expires after 15 minutes. So the key never enters the AI's context, its chat history, or the model provider's logs.
If you want keys delivered in chat anyway (for example, so the agent can write them into an untracked .env), turn on Show new keys in the chat when you create the token. It needs Read and manage keys.
Retrying safely
If a create_key call times out, don't just repeat it. Either check list_keys first, or have your tool pass the same idempotency_key (8-64 letters, digits, - or _) again from the same token within 24 hours: the repeat returns the first result instead of creating a second key. The key value itself is not repeated; a key delivered by link comes back with the same link while it is unused.
Revoking a token
Developer tokens → Revoke stops it at once. Owners and admins also see every member's tokens in the Everyone's tokens table on the same page, and can revoke any of them, for example after a lost laptop.
Revoking a token does not revoke the API keys it created; revoke those separately if you need to.
A token also stops working when:
- it expires;
- its owner changes their password (this revokes all of their tokens);
- its owner leaves the organisation or is deactivated.
If the owner's role changes, the token can only do what the new role allows.
Troubleshooting
| Message | Meaning |
|---|---|
That is a Paranine API key (sk_p9_...) | You pasted an API key. Create a developer token instead. |
Invalid, expired or revoked developer token | Create a new token. If you just changed your password, your old tokens were revoked. |
Unknown tool: 'create_key' | Your token is read only, or your role no longer allows managing keys. |
Invalid arguments. credit_limit_pkr: ... | Every new key needs a credit limit. Tell your tool how much, in PKR. |
can only tighten a key through the MCP | Raise limits in the dashboard. |
key_prefix does not match that key | Your tool named the wrong key. Check list_keys and confirm which key you meant. |
expires_at must be at least 1 hour from now | To stop a key sooner, revoke it. |
Too many failed authentications | Too many requests from your network used a missing or invalid token. Fix the token in your tool's settings, then wait for the time in Retry-After. |
A Paranine developer token is required | Your tool sent no token. Add the Authorization: Bearer <TOKEN> header from step 2. |
Origin not allowed | The request came from a browser page. Use a desktop or command-line MCP client. |
Rate limit exceeded | Wait for the time in Retry-After. |
Something unclear or wrong on this page? Tell us. Machine-readable copies: llms.txt.