# ANUKA MCP Skill

Connect your AI agent to ANUKA — the Founder Operating System — via Model Context Protocol (MCP).

## What is ANUKA MCP

ANUKA MCP is the application/API layer of ANUKA Founder OS. It gives any MCP-compatible
AI agent (Claude Code, Cursor, ChatGPT, VS Code, Codex, Grok, custom agents) access to:

- **Memory** — persistent cross-session memory (`list_memories`, `save_memory`)
- **Goals & Tasks** — create, track, complete goals and tasks
- **Projects** — multi-project workspaces with role-based access (founder / manager / lead / member / viewer)
- **Agent Onboarding** — guided bootstrap: interview → capability checklist → active

Working access for an agent is an `ank_` API key the agent claims itself, under its
own identity, through the key-session handshake below — bound to (project, role),
with the binding's scopes written at birth. OAuth is how a human connects their
own client with their own account; it is never how an agent gets working access.

> **Agent rule — key-only connection (founder directive, ANUKA #3280).** If YOU are an
> agent being onboarded as a team worker, connect ONLY with an `ank_` key issued to
> YOUR OWN identity (bound agent, project binding, scopes of the binding) — before
> doing any work. A user OAuth session is NOT agent access, even if it is offered to
> you during setup: if a flow leads you into signing in as a user (above all as the
> founder), STOP, use that session for nothing, and escalate to your coordinator.
> OAuth below is for a human connecting THEIR OWN client with THEIR OWN account.

> **Three mistakes every agent makes once — do not make them:**
> 1. **Nobody will send you a key.** Not by email, not in chat, not from your human.
>    You claim your own key through the handshake below; that is the only way one exists.
> 2. **You create the session yourself, with no authorization.** `create_key_session`
>    works before you hold any credential — starting it signed-in is the mistake.
> 3. **The server gives you the link.** The approval URL comes back in the server's
>    response. Never construct, guess or shorten it — pass it to your human as returned.

## Server

- **URL:** `https://mcp.anuka.pro`
- **Legacy alias:** `https://api.anuka.pro/mcp` (deprecated - do not use in new configs; strict OAuth clients reject it)
- **Protocol:** MCP `2025-06-18`
- **Transport:** Streamable HTTP
- **Auth:** `Authorization: Bearer ank_...` header

## Quick connect

### 1. Claim your `ank_` key (the handshake — you do this yourself)

Nobody will send you a key, and no human picks one for you. You claim it,
unauthenticated:

1. Call `create_key_session` with your agent name, project and role — no
   credential needed. Keep the **session token** it returns.
2. If the result says approval is required, show your human the approval URL
   from that same response, exactly as returned.
3. Poll `get_key_session` with the **original session token** — the raw token
   from step 1, NOT its hash and NOT an `ank_` key; the server hashes it
   itself. When the human approves, the poll returns your `ank_` key.

The self-service page https://auth.anuka.pro/mcp-key and invite links are
human-side tools for people managing keys in a browser. They are NOT the
agent path, and an agent never needs either of them to get its key.

### 2. Configure your agent

**Claude Code:**
```bash
claude mcp add --transport http anuka https://mcp.anuka.pro \
  --header "Authorization: Bearer ank_PASTE_KEY_HERE"
```

**Cursor** (`~/.cursor/mcp.json` or Settings → MCP):
```json
{
  "mcpServers": {
    "anuka": {
      "url": "https://mcp.anuka.pro",
      "headers": { "Authorization": "Bearer ank_PASTE_KEY_HERE" }
    }
  }
}
```

**VS Code** (`.vscode/mcp.json`):
```json
{
  "servers": {
    "anuka": {
      "url": "https://mcp.anuka.pro",
      "headers": { "Authorization": "Bearer ank_PASTE_KEY_HERE" }
    }
  }
}
```

**ChatGPT** (Developer Mode → MCP):
- Server URL: `https://mcp.anuka.pro`
- Auth: OAuth (the human's own ANUKA account) or a Bearer `ank_` key (an agent being onboarded uses its own key — see the agent rule above)

**Generic (curl test):**
```bash
curl -X POST https://mcp.anuka.pro \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ank_PASTE_KEY_HERE" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

### Local OAuth callback (styled result page)

Some clients finish OAuth by redirecting to a callback on your own machine
(`http://127.0.0.1:<port>/callback`) and render their own bare result page.
Where the flow lets you supply the redirect URI (scripted or headless
connects), run the ANUKA listener instead — the human sees the result in
the auth.anuka.pro design, and you get the code as JSON:

```bash
curl -O https://mcp.anuka.pro/mcp/anuka-mcp-connect.py
python3 anuka-mcp-connect.py            # prints READY http://127.0.0.1:<port>/callback
```

Use the printed URI as the redirect URI. The listener serves one callback,
prints `RESULT {"code": ..., "state": ...}` (or the OAuth error), and exits.
Clients with a built-in callback listener keep their own page — that surface
belongs to the client, not to ANUKA.

## 3. Start onboarding

Call these tools in order:

1. `get_bootstrap` — load your contract: projects, role, permissions
2. `get_onboarding_state` (project_id) — check your state
3. `advance_onboarding` (action: `interview_complete`) — bootstrap → interview
4. `advance_onboarding` (action: `interview_complete`) — interview → checklist
5. `get_capability_checklist` — see required capabilities
6. `update_capability_checklist` (capability, status, evidence) — mark progress
   (`verified` requires `evidence: {type, value}`)
7. `advance_onboarding` (action: `checklist_reviewed`) — checklist → active

## Key tools reference

| Tool | Role | Purpose |
|------|------|---------|
| `get_bootstrap` | any | Agent contract: projects, role, permissions |
| `get_onboarding_state` | any | Current onboarding state |
| `advance_onboarding` | any | Move through states |
| `list_memories` / `save_memory` | member+ | Persistent memory |
| `list_tasks` / `create_task` | member+ | Task management |
| `create_project` | any | Create a new project (you become founder) |
| `create_mcp_invite` | founder / manager | Invite agents/members (founder invites are founder-only) |
| `get_capability_checklist` | any | Project capabilities |
| `update_capability_checklist` | member+ | Update capability status |
| `request_capability` | member+ | Request a capability from founder |

## Roles

- **founder** — full access: invites, keys, resolve requests
- **manager** — agents and team leads: manage members, keys and invites, resolve requests; everything the founder can do except project ownership (deleting or transferring the project, granting the founder role)
- **lead** — member rights plus distributing tasks and accepting results inside its own project; no role management, no cross-project rights
- **member** — read + write: tasks, memories, checklist updates
- **viewer** — read-only

## Full instructions

https://anuka.pro/start
