Authentication

Every MindWiki request authenticates with one of two credentials. Pick based on what's calling.

Personal API key (REST + legacy MCP)

For scripts, automations, and AI clients that can't use remote MCP / OAuth.

Get a key

Keys start with mw_.

Using a key with REST

Send the key in a Bearer header:

Authorization: Bearer mw_xxxxxxxxxxxxxxxx

Using a key with MCP (legacy fallback)

For MCP clients that don't speak remote OAuth, append the key as a query parameter:

https://api.mindwiki.io/mcp?token=mw_xxxxxxxxxxxxxxxx

The same scope rules apply.

Scopes

ScopeAllows
readSearch, read, list, ask, similar, graph, lint, export, stats
writeCapture, create / update / delete pages, rebuild index, create proposals

Calling a tool or endpoint that requires a scope your key doesn't include returns:

json
{
  "error": "API key does not include write scope",
  "code": "INSUFFICIENT_SCOPE",
  "required_scope": "write"
}

with HTTP 403.

For Claude.ai, Claude Desktop, ChatGPT, and other AI clients that support remote MCP.

Connection

Add https://api.mindwiki.io/mcp as a remote MCP server in your AI client. The client discovers OAuth metadata and triggers a browser approval on mindwiki.io. After approval, the client receives a token that grants both read and write scopes.

Endpoints

For client implementers building OAuth flows:

  • Issuer: https://api.mindwiki.io
  • Discovery (resource): https://api.mindwiki.io/.well-known/oauth-protected-resource
  • Discovery (auth server): https://api.mindwiki.io/.well-known/oauth-authorization-server
  • Authorize: https://mindwiki.io/oauth/authorize
  • Token: https://api.mindwiki.io/oauth/token
  • Register (DCR): https://api.mindwiki.io/oauth/register
  • Revoke: https://api.mindwiki.io/oauth/revoke
  • Code challenge: S256 (PKCE required)
  • Grant types: authorization_code, refresh_token
  • Scope: mcp

Errors

HTTPCodeMeaning
401TOKEN_INVALIDThe key was revoked, mistyped, or never existed
403INSUFFICIENT_SCOPEThe key is valid but lacks the required scope
409CONFLICTOptimistic concurrency mismatch on a write — see the response body for the current hash
429(none)Rate limited — retry after the time in Retry-After

Security guidance

  • Use scoped keys. A key for a read-only integration should not have write.
  • One key per integration. Granular keys make revocation painless.
  • Don't commit keys to source. Use environment variables or a secrets manager.
  • Rotate after exposure. Revoke and re-mint immediately if a key may have leaked.
  • Audit periodically. The keys list shows last-used timestamps.