Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.driftless.icu/llms.txt

Use this file to discover all available pages before exploring further.

Driftless ships an MCP (Model Context Protocol) server that exposes your workspace context to AI clients. ChatGPT, Claude, Copilot, and any MCP-compatible client can read and write topics through it.

How it works

The MCP adapter runs at apps/mcp and translates MCP tool calls to the existing Driftless REST API. It is a protocol adapter only — it never accesses Postgres, internal libraries, or workspace admin operations directly.
AI Client (ChatGPT / Claude / Copilot)

    ▼ OAuth 2.0 bearer token
MCP Server (apps/mcp)

    ▼ REST API calls
Driftless API (apps/api)


Postgres (Supabase)

Available tools

ToolDescription
driftless_context_searchFull-text search across topics
driftless_context_listList topics with filters
driftless_context_getRetrieve a single topic by slug
driftless_context_load_for_filesMatch topics to file paths
driftless_context_createCreate a new topic
driftless_context_updateUpdate an existing topic (append-safe)
driftless_context_diffGet topics matching your local diff
All tools are context-only — no workspace admin, no repo registration, no key management, no mutation of integrations.

OAuth 2.0 setup

Third-party AI clients authorize through OAuth 2.0 with PKCE support.

For AI client developers

Register your client:
curl -X POST https://api.driftless.icu/api/v1/oauth/register \
  -H "x-api-key: drift_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My AI Client",
    "redirect_uris": ["https://myapp.com/oauth/callback"],
    "scopes": ["context:read", "topics:create", "topics:write"]
  }'

OAuth scopes

ScopeDescription
context:readRead topics and context
topics:createCreate new topics
topics:writeUpdate existing topics
context:diffRead topic diff for local changes

Authorization flow

  1. Redirect the user to https://api.driftless.icu/api/v1/oauth/authorize?client_id=...&response_type=code&redirect_uri=...&scope=context:read+topics:write
  2. The user consents in the dashboard at https://driftless.icu/oauth/authorize
  3. The dashboard redirects back to your redirect_uri with an authorization code
  4. Exchange the code at https://api.driftless.icu/api/v1/oauth/token for an access token
  5. Use the bearer token in MCP tool calls

Endpoints

MethodPathPurpose
GET/oauth/authorizeAuthorization consent screen
POST/oauth/tokenExchange code for access token
POST/oauth/registerRegister an OAuth client
POST/oauth/revokeRevoke an access token

Token security

  • Authorization codes, access tokens, and refresh tokens are stored as hashes only — never plaintext
  • Tokens are never logged or returned after initial issuance
  • The MCP server does not import @driftless/db, @driftless/scanner, typeorm, or any internal library — it calls the REST API exclusively

Connecting your AI client

Claude Desktop

Add this to your claude_desktop_config.json:
{
  "mcpServers": {
    "driftless": {
      "url": "https://api.driftless.icu/mcp",
      "headers": {
        "Authorization": "Bearer drift_your_api_key_here"
      }
    }
  }
}

ChatGPT / Copilot / other clients

Use the MCP endpoint URL directly:
https://api.driftless.icu/mcp
Authenticate with a Bearer token in the Authorization header — either an API key (drift_...) for local/CI use, or an OAuth access token for published apps.

Local development

For local development, the MCP server runs on http://localhost:3020/mcp:
{
  "mcpServers": {
    "driftless": {
      "url": "http://localhost:3020/mcp",
      "headers": {
        "Authorization": "Bearer drift_your_api_key_here"
      }
    }
  }
}
OAuth is for published AI client apps (ChatGPT, Claude) that need per-user consent. CLI and CI continue to use API keys.

Roadmap

FeatureStatus
MCP server with 7 context toolsShipped (pending external review)
OAuth 2.0 authorize/token/register/revokeShipped (pending external review)
Dashboard consent screen /oauth/authorizeShipped (pending external review)
ChatGPT app submissionPending
Claude integration testingPending
pre_edit_check toolPlanned
freshness toolPlanned
suggest_topic toolPlanned