# Forge Management MCP

Manage Forge — projects, tasks, pipelines, schedules, jobs, connectors, usage — from an
MCP client like Claude Code, instead of clicking through the UI. It manages Forge; it does
not read your project files or run coding tasks (that's the separate workspace agent MCP
on `:8406`).

## Add it to Claude Code

```bash
forge mcp install
```

This mints an API key if you don't have one and registers the server with Claude Code.
Run `/mcp` in a session to confirm. No admin password — running `forge` already proves
local access, so the key is minted directly on disk (into `FORGE_DATA_DIR`, else
`~/.forge/data`; set `FORGE_DATA_DIR` for a non-default instance); the running server
picks it up automatically (and need not even be up).

Options: `--http` (register the HTTP transport instead of the stdio proxy), `--scope user`
(use it in every project), `--remote https://forge.example.com` (target a remote Forge —
set `FORGE_API_KEY` first, since the remote's data dir isn't local), `--print` (print the
`claude mcp add` command instead of running it).

## What you can do

Tools cover projects, tasks, pipelines, schedules and jobs, connectors, the marketplace,
usage and status, log tailing, and workspace agents. Ask "what forge tools do you have?"
to list them.

## How it works

Runs in-process at `/api/mcp` (Streamable HTTP), behind Forge's existing auth — same port
as the web UI. All logic stays in the server: tools call `lib/` in-process and the wire
carries named intents, never SQL. The `forge mcp` proxy (`cli/mcp-proxy.ts`) is
transport-only; the same `mcp/server.ts` backs both the HTTP route and the proxy.

Manual setup, if you're not using `forge mcp install`:

```bash
forge key create "claude-code" --save     # mint + save a key (no password — local)
claude mcp add forge -- forge mcp          # stdio proxy (reads ~/.forge/mcp-key)
# or, direct HTTP:
claude mcp add --transport http forge http://localhost:8403/api/mcp \
  --header "Authorization: Bearer forge_sk_..."
```
