Step-by-step guide for AI agents and server-to-server clients to authenticate with the Nichify API and MCP server using Personal Access Tokens. If you're an AI agent, follow these exactly - no browser, no cookies, no OAuth dance.
nch_), paste it into your agent's secret store.Authorization: Bearer nch_... on every request to /api/* (REST) or /mcp (MCP).session_token cookie are not used for agent traffic.| Caller | Credential | Header / storage |
|---|---|---|
| Human (browser) | Email+password or Google OAuth | Cookie session_token, HttpOnly, Secure, SameSite=Lax |
| AI agent / CLI / server | Personal Access Token (PAT) | Authorization: Bearer nch_... |
| Stripe webhook | Stripe-Signature header | HMAC SHA-256 verified server-side |
read for list/get/export, write for create analyses/monitors). The plaintext token is shown once - copy it immediately into your agent's secret store.
Authorization: Bearer nch_.... Works the same for REST and MCP:
# REST
curl -H "Authorization: Bearer nch_abcdef..." \
https://nichify.app/api/analyses
# MCP (JSON-RPC over Streamable HTTP)
curl -X POST https://nichify.app/mcp \
-H "Authorization: Bearer nch_abcdef..." \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
401 Unauthorized with RFC-7807 problem+json:
{
"error": {
"code": "unauthorized",
"message": "Not authenticated",
"docs_url": "/account/keys",
"suggest": [
"Issue a PAT at /account/keys",
"Send Authorization: Bearer nch_..."
]
}
}
Branch your retry logic on error.code, not on the human message.
| Scope | What it grants | Tools / endpoints |
|---|---|---|
read | List, get, export | list_analyses, get_analysis, list_monitorings, list_runs, all GET /api/* |
write | Create, update, delete | create_monitor, create_analysis, POST/PUT/DELETE /api/* |
A PAT can carry both scopes. Omit write if your agent only reads.
Authorization headers.
The MCP server at /mcp uses the same PAT. Discovery (manifest, server card, JSON-RPC initialize and tools/list at /.well-known/mcp/manifest.json) works without auth so scanners can enumerate tools. tools/call requires a PAT.
For Claude Desktop: add an entry to claude_desktop_config.json:
{
"mcpServers": {
"nichify": {
"url": "https://nichify.app/mcp",
"headers": {
"Authorization": "Bearer nch_your_token_here"
}
}
}
}
300 requests/minute per IP on /mcp. REST endpoints inherit per-plan quotas (see /pricing.md). On 429, the response includes retry_after_seconds and a Retry-After header.
/agent-instructions.md - full when-to-use / when-not-to-use rules./openapi.json - OpenAPI 3.1 spec with auth scheme declarations./.well-known/oauth-protected-resource - RFC 9728 metadata./developers/ - full developer hub.