@tokenfactory/acc-mcp-server
v0.2.0-internal
Published
Agent Control Center MCP server. Stdio-transport subprocess spawned by acc-runner alongside Claude Code; exposes ACC tools (6 read-only + 4 mutating with approval gating) and telemeters every call to acc.mcp_tool_calls.
Readme
@tokenfactory/acc-mcp-server
Agent Control Center MCP server. Stdio-transport subprocess spawned by
@tokenfactory/acc-runner alongside each Claude Code session. Exposes
six read-only ACC tools (query_tasks, query_prs, query_cost,
query_decisions, query_runners, query_approvals) over the Model
Context Protocol and telemeters every tool call to acc.mcp_tool_calls.
How agents reach it
The runner writes a .mcp.json into the task working directory before
spawning Claude Code:
{
"mcpServers": {
"acc": {
"command": "npx",
"args": [
"-y", "@tokenfactory/acc-mcp-server",
"--task-id", "T-12345",
"--runner-id", "local-priyas-mbp",
"--access-token", "<runner JWT>"
]
}
}
}Claude Code auto-discovers the server, lists the tools at session
start, and the agent can call any of the six during a task. Each call
writes one row to acc.mcp_tool_calls (latency, request args, response
summary) via POST /api/mcp/record-tool-call — service-role only, so
the agent surface cannot fabricate telemetry.
Tool catalog
The catalog is a duplicate of api/chat/_tools.ts (the Ask-ACC chat
contract). A parity test in tests/tools.test.ts cross-checks the two
arrays so additions in one place fail CI in the other.
Environment
| Var | Notes |
| --- | --- |
| SUPABASE_URL / ACC_SUPABASE_URL | Project URL |
| SUPABASE_ANON_KEY / ACC_SUPABASE_ANON_KEY | Anon key for the user-scoped client |
| ACC_PUBLIC_URL | ACC API host. Defaults to https://acc.techarch.dev. Overridable via --public-url. |
| ACC_MCP_ACCESS_TOKEN | Runner JWT. Overridable via --access-token (visible in ps). |
Security notes
- The runner's JWT is passed as a CLI arg. Visible in
psoutput for the subprocess lifetime — acceptable for v0.5-C1 because the runner itself owns the process tree, but tracked for v0.6 hardening (env-only handoff or token-broker pattern). - Telemetry writes go through
POST /api/mcp/record-tool-call, which validates the JWT and uses the service-role to callacc.record_mcp_tool_call. Direct RPC access is denied.
Versioning
Pin @modelcontextprotocol/sdk exactly — MCP SDK churns on minor
releases. Update via the standard checklist in
docs/acc/MCP_SERVER.md (peer-dep cycle, schema-shape diff, parity
test against the latest Claude Code release).
