Docs/MCP

Anomalia MCP

Anomalia exposes a Model Context Protocol server so coding agents (Cursor, Claude, and others) can manage brands, posts, plans, studio, SEO/GEO, and blog — with the same OAuth login as the CLI.

Your agent
   │  stdio (local)     →  bun run mcp  /  anomalia-mcp
   │  HTTPS (remote)    →  https://mcp.anomalia.so/mcp  + Bearer
   ▼
Anomalia API  (/api/v1/*)
No static API tokens. Authentication is always OAuth (browser login or Bearer from your session).

Quick start

Pick a transport: local stdio is simplest on your machine; remote HTTP is for cloud hosts.

Option A — Local stdio

Best for Cursor and other local agents.

  1. Install Bun and clone the anomalia-cli repo (or install the CLI binary so anomalia-mcp is on your PATH).
  2. Authenticate once:
    anomalia login
    # or, after MCP is connected, call the login tool
  3. Add to Cursor MCP config (absolute path required when using Bun):
    {
      "mcpServers": {
        "anomalia": {
          "command": "bun",
          "args": ["run", "/ABS/PATH/to/anomalia-cli/mcp/stdio.ts"]
        }
      }
    }

    If the binary is on PATH after install:

    {
      "mcpServers": {
        "anomalia": { "command": "anomalia-mcp" }
      }
    }
  4. Restart Cursor / reload MCP. Call list_brands, then work with a brand slug.

Session file (shared with the CLI): ~/.config/anomalia/session.json.

Option B — Remote HTTP

  1. Confirm the server is up:
    curl -sS https://mcp.anomalia.so/health

    Expect a JSON health payload with ok: true and mcp: "/mcp".

  2. Cursor MCP config:
    {
      "mcpServers": {
        "anomalia": {
          "url": "https://mcp.anomalia.so/mcp"
        }
      }
    }
  3. Clients that speak MCP OAuth (opencode, Claude Code, Cursor, the Inspector…) authenticate on their own: on first connect they open anomalia.so, you approve, and the token is stored by the client. The initial 401 is the start of that handshake, not a crash.

Custom option — if your client cannot do OAuth, attach the token by hand: Authorization: Bearer <access_token>, using the Supabase access token that anomalia login saves in ~/.config/anomalia/session.json. Static API keys (anomalia_…) are not accepted by the remote server.

Option C — Local HTTP

bun install
bun run mcp:http
# → http://localhost:8787/mcp
#    http://localhost:8787/health

Auth: Bearer or the local session file.

Auth rules

ContextHow you authenticate
Local stdio / local HTTPBrowser login tool or anomalia login → session file
Remote HTTPOAuth 2.1 + PKCE, or Authorization: Bearer <access_token>
Static API keyNot supported

Protected resource metadata: GET /.well-known/oauth-protected-resource.

What to call first

  1. list_brands — discover brand slugs
  2. get_dashboard — brand overview
  3. list_posts with status pending_user — approval queue
  4. Prefer specific tools (approve_posts, edit_post, …) over chat for precise actions

Post and article ids accept short unambiguous prefixes from list results (same rule as the CLI).

Tool areas

AreaExamples
Authlogin, logout, whoami, list_brands
Postslist_posts, get_post, edit_post, approve_posts, regenerate_slide, make_video
Plansget_plan, propose_plan, plan_week, produce_week
Studioget_studio, add_note, research_competitors
Webget_seo, get_geo, generate_article, chat

Troubleshooting

SymptomLikely causeFix
401 on /mcpMissing or invalid Bearer on remoteLogin locally and pass the access token, or use stdio
Tools missingMCP not connected in the hostCheck the Cursor MCP panel and restart the host
Auth works in CLI but not MCPDifferent machine / no session fileRun login in the MCP process environment

Next

  • Agent skill — install the Anomalia skill so agents know when and how to call MCP or the CLI
  • CLI — terminal commands when MCP is not available
  • API reference — REST endpoints the MCP and CLI call
  • anomalia-cli — source, tools map, and development notes