Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ Specs live in git (`docs/specs/*.md` by convention), not in CodePlans. Link a sp

---

## Connect Claude Code or Cursor (MCP)
## Connect an AI coding agent (MCP)

CodePlans ships an MCP server at `/api/mcp/mcp` (Streamable HTTP). Create an API key in **Settings → API Keys** — the settings page shows these snippets with your host and freshly minted key pre-filled.
CodePlans ships an MCP server at `/api/mcp/mcp` (Streamable HTTP, bearer-token auth). Create an API key in **Settings → API Keys** — the settings page shows these snippets with your host and freshly minted key pre-filled, for Claude Code, Cursor, Codex, GitHub Copilot, and Antigravity.

**Claude Code** (user scope — available in every project):

Expand All @@ -346,6 +346,37 @@ claude mcp add --scope user --transport http codeplans http://localhost:3000/api
}
```

**Codex CLI** — reads the bearer token from an environment variable rather than storing it in `~/.codex/config.toml` directly:

```bash
export CODEPLANS_API_KEY="cpk_your_key"
codex mcp add codeplans \
--url http://localhost:3000/api/mcp/mcp \
--bearer-token-env-var CODEPLANS_API_KEY
```

**GitHub Copilot CLI**:

```bash
copilot mcp add --transport http codeplans http://localhost:3000/api/mcp/mcp \
--header "Authorization: Bearer cpk_your_key"
```

In VS Code's Copilot Chat instead, add the same URL/header under a `"servers"` entry in `.vscode/mcp.json` with `"type": "http"`.

**Antigravity** — add to `~/.gemini/config/mcp_config.json` (note the field is `serverUrl`, not `url`), then reload MCP servers from the agent panel:

```json
{
"mcpServers": {
"codeplans": {
"serverUrl": "http://localhost:3000/api/mcp/mcp",
"headers": { "Authorization": "Bearer cpk_your_key" }
}
}
}
```

Your agent can then read plans/work items/tech debt and (with a write-scope key) model products, assets, and dependencies, manage plans end-to-end (create, target assets, activate/complete), file work items, manage tasks, and record branch/PR status on plan assets. Keys act as your user, so org access rules and mirrored-field protections apply unchanged. See [`docs/specs/mcp-server-spec.md`](docs/specs/mcp-server-spec.md).

---
Expand Down
48 changes: 46 additions & 2 deletions app/(dashboard)/settings/api-keys-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ function ConnectCard({ mintedKey }: { mintedKey: string | null }) {
}
}
}`
const codexSnippet = `export CODEPLANS_API_KEY="${key}"
codex mcp add codeplans \\
--url ${origin}/api/mcp/mcp \\
--bearer-token-env-var CODEPLANS_API_KEY`
const copilotSnippet = `copilot mcp add --transport http codeplans ${origin}/api/mcp/mcp \\
--header "Authorization: Bearer ${key}"`
const antigravitySnippet = `{
"mcpServers": {
"codeplans": {
"serverUrl": "${origin}/api/mcp/mcp",
"headers": { "Authorization": "Bearer ${key}" }
}
}
}`

function copy(label: string, text: string) {
navigator.clipboard.writeText(text)
Expand Down Expand Up @@ -188,7 +202,7 @@ function ConnectCard({ mintedKey }: { mintedKey: string | null }) {
<CardHeader>
<div className="flex items-center gap-2">
<TerminalSquare className="h-5 w-5 text-muted-foreground" />
<CardTitle className="text-base">Use with Claude Code &amp; Cursor</CardTitle>
<CardTitle className="text-base">Use with your AI coding agent</CardTitle>
</div>
<CardDescription>
{mintedKey
Expand All @@ -198,9 +212,12 @@ function ConnectCard({ mintedKey }: { mintedKey: string | null }) {
</CardHeader>
<CardContent>
<Tabs defaultValue="claude">
<TabsList className="bg-muted mb-3">
<TabsList className="bg-muted mb-3 flex-wrap h-auto">
<TabsTrigger value="claude">Claude Code</TabsTrigger>
<TabsTrigger value="cursor">Cursor</TabsTrigger>
<TabsTrigger value="codex">Codex</TabsTrigger>
<TabsTrigger value="copilot">Copilot</TabsTrigger>
<TabsTrigger value="antigravity">Antigravity</TabsTrigger>
</TabsList>
<TabsContent value="claude" className="space-y-2">
<p className="text-xs text-muted-foreground">
Expand All @@ -217,6 +234,33 @@ function ConnectCard({ mintedKey }: { mintedKey: string | null }) {
</p>
<Snippet label="cursor" text={cursorSnippet} />
</TabsContent>
<TabsContent value="codex" className="space-y-2">
<p className="text-xs text-muted-foreground">
Run once in a terminal. Codex reads the key from an env var rather than storing it in{' '}
<code>~/.codex/config.toml</code> directly:
</p>
<Snippet label="codex" text={codexSnippet} />
<p className="text-xs text-muted-foreground">
Verify with <code>codex mcp list</code>. Re-export <code>CODEPLANS_API_KEY</code> in new shells, or add it to your shell profile.
</p>
</TabsContent>
<TabsContent value="copilot" className="space-y-2">
<p className="text-xs text-muted-foreground">
GitHub Copilot CLI — run once in a terminal:
</p>
<Snippet label="copilot" text={copilotSnippet} />
<p className="text-xs text-muted-foreground">
Verify with <code>copilot mcp list</code>. In VS Code&apos;s Copilot Chat instead, add the same URL/header under a{' '}
<code>&quot;servers&quot;</code> entry in <code>.vscode/mcp.json</code> with <code>&quot;type&quot;: &quot;http&quot;</code>.
</p>
</TabsContent>
<TabsContent value="antigravity" className="space-y-2">
<p className="text-xs text-muted-foreground">
Add to <code>~/.gemini/config/mcp_config.json</code>, then reload MCP servers from the agent panel. Note the field is{' '}
<code>serverUrl</code>, not <code>url</code>:
</p>
<Snippet label="antigravity" text={antigravitySnippet} />
</TabsContent>
</Tabs>
</CardContent>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ <h2>Current feature status</h2>
<tr><td>GitHub &amp; GitLab Issues integrations (pull-only)</td><td><span class="status-pill done">Available</span></td></tr>
<tr><td>Milestone-linked plans &amp; PR auto-linking</td><td><span class="status-pill done">Available</span></td></tr>
<tr><td>Write-back: plan-completion comments on tracker issues</td><td><span class="status-pill done">Available</span></td></tr>
<tr><td>MCP server (Claude Code/Desktop, API-key auth, 25 tools)</td><td><span class="status-pill done">Available</span></td></tr>
<tr><td>MCP server (Claude Code, Cursor, Codex, Copilot, Antigravity — API-key auth, 28 tools)</td><td><span class="status-pill done">Available</span></td></tr>
<tr><td>Jira / Asana / Linear connectors</td><td><span class="status-pill plan">Planned</span></td></tr>
<tr><td>AI-assisted effort estimation</td><td><span class="status-pill plan">Planned</span></td></tr>
</tbody>
Expand Down
8 changes: 8 additions & 0 deletions docs/specs/mcp-server-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
> **Status: SHIPPED in v0.3.1; management tools added in v0.3.2** (28 tools; plans and work items carry ownerEmail:
> products, assets, dependencies, plan lifecycle/targets, full work-item edit). Companion to
> `design-spec-v3.md`; reuses its data layer and access model unchanged.
>
> **Client support expanded:** the Settings → API Keys page now shows connection
> snippets for Codex CLI, GitHub Copilot (CLI + VS Code), and Antigravity, alongside Claude
> Code and Cursor. No server changes were needed — all five speak Streamable HTTP with a
> bearer-token `Authorization` header against the same `/api/mcp/mcp` endpoint; only the
> client-side config format differs (CLI command vs. JSON, and Antigravity's `serverUrl`
> field instead of `url`). See the "Connect an AI coding agent" section of the README for
> per-client snippets.

## Goal

Expand Down
Loading