Security, OAuth and MCP
The rules for partner keys, user consent, and agent access.
Key rules
- Keep keys on your server. A key in a browser, an app or a public repo is a leaked key.
- Use a test key until you ship. Use one key per service, with only the scopes it needs.
- Revoke a key at krexa.xyz/developers. The revoke works at once.
- Keys have a checksum, so secret scanners can find a leaked
kxp_key. Krexa-End-Usermust be a stable id that you own. Never let the end user choose it.
Connect a Krexa user (OAuth)
Use this only when a person already has a Krexa account and wants to link it. It is OAuth 2.1 with PKCE (S256).
- Metadata:
https://api.krexa.xyz/.well-known/oauth-authorization-serverand/.well-known/oauth-protected-resource. - Send the user to
GET /api/v1/oauth/authorizewithclient_id,redirect_uri,scope,state,code_challenge,code_challenge_method=S256andresource. - They approve on krexa.xyz. You get a
codethat is good for 60 seconds. POST /api/v1/oauth/tokenwith yourX-API-Key(grantsauthorization_codeorrefresh_token).- Send the user token as
Authorization: Bearer kxu_…next to yourX-API-Key. It lasts 1 hour. The refresh token lasts 30 days and changes on each use. - The user can disconnect your app at any time.
MCP for agents
Your AI agent can use Krexa tools over MCP at https://api.krexa.xyz/api/v1/mcp. Send the same two headers:
{
"mcpServers": {
"krexa": {
"url": "https://api.krexa.xyz/api/v1/mcp",
"headers": { "X-API-Key": "kxp_…", "Krexa-End-User": "user_123" }
}
}
}A partner key gets research and paper tools only. Tools that need a wallet or move money are not offered.
Money
- A partner key can never take custody of funds or withdraw.
- Live deploys need a Krexa review of your org, a live key with
live:propose, and the end user's approval on krexa.xyz for each deploy.
Report a problem
Found a security issue? Email partners@krexa.xyz. Do not open a public issue.
