Skip to content

feat!: remove agentage mcp stdio command, MCP served by daemon#254

Merged
vreshch merged 1 commit into
masterfrom
feature/remove-mcp-command
Jul 8, 2026
Merged

feat!: remove agentage mcp stdio command, MCP served by daemon#254
vreshch merged 1 commit into
masterfrom
feature/remove-mcp-command

Conversation

@vreshch

@vreshch vreshch commented Jul 8, 2026

Copy link
Copy Markdown
Member

Why

The standalone agentage mcp stdio command spun up a second in-process engine in its own process, violating the daemon's single-writer invariant (the daemon at 127.0.0.1:4243 is the sole writer that serializes vault mutations to avoid concurrent git index.lock collisions). It also duplicated a surface the daemon already serves: the identical frozen 6-tool MCP contract is exposed at http://127.0.0.1:4243/mcp over Streamable HTTP. One surface, one writer.

What changed

Removed

  • src/commands/mcp/ (mcp.ts + mcp.test.ts) and its registration in src/cli.ts
  • e2e/mcp-stdio.test.ts
  • The only StdioServerTransport import in src/ (lived in the deleted command)

Kept

  • src/mcp/local-server.ts - the daemon's /mcp handler (loadLocalMemoryServer) is unchanged
  • e2e/mcp-contract.test.ts already drives the daemon /mcp HTTP endpoint, not stdio - no rewire needed; the frozen 6-tool contract assertions are untouched
  • e2e/mcp-daemon.test.ts stays

Added - disable gate

  • agentage daemon start --no-mcp and env var AGENTAGE_DAEMON_NO_MCP=1: daemon-entry.ts reads the env var (mcpEnabled()) and skips buildMcpServer, so /mcp 404s (that path already existed in src/daemon/server.ts). The --no-mcp flag sets the env var on the spawned daemon process. ensureDaemon autostart keeps MCP on by default.
  • /api/health now reports mcp: boolean; daemon status and daemon start output the MCP serving state.
  • Unit tests: mcpEnabled gate, server-level /mcp 404 + health flag when gated, and the daemon start --no-mcp / status wiring.

Docs

  • README: MCP section leads with the HTTP config (claude mcp add --transport http agentage http://127.0.0.1:4243/mcp and the .mcp.json {"url": ...} form), notes the daemon must be running, documents --no-mcp / AGENTAGE_DAEMON_NO_MCP.
  • docs/architecture.md + docs/architecture.svg: MCP is now a single daemon capability (HTTP /mcp), stdio entry removed, disable gate described. SVG re-rendered and inspected - single MCP arrow, no overlap.
  • CLAUDE.md: dropped agentage mcp from the command/layout prose.

Migration

Old stdio config:

{ "mcpServers": { "agentage-memory": { "command": "agentage", "args": ["mcp"] } } }

New HTTP config (daemon autostarts on first memory verb, or agentage daemon start):

{ "mcpServers": { "agentage": { "url": "http://127.0.0.1:4243/mcp" } } }

or claude mcp add --transport http agentage http://127.0.0.1:4243/mcp.

Verify

  • npm run verify green (409 unit tests pass, type-check + lint + format + build).
  • Manual smoke on an isolated config dir + port 45777:
    • node dist/cli.js --help -> no mcp command listed.
    • daemon start -> mcp on; POST /mcp initialize returns a valid MCP response (serverInfo.name: agentage-memory, 6-tool capabilities); daemon status shows mcp on.
    • daemon start --no-mcp -> mcp off; POST /mcp returns HTTP 404 {"error":"not found"}; daemon status shows mcp off.
    • daemon stop clean both times; temp dirs cleaned up.
  • SVG render check: wrapped in an <img width=900>, screenshotted via Playwright chromium - single "MCP - HTTP /mcp -> 127.0.0.1:4243/mcp" arrow into the daemon, command box reads status daemon update, no overlap or mis-centering.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: 31a2e54340c22a6956a83afcbb558ddcb8c41070
Branch: feature/remove-mcp-command

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-07-08T21:51:14.905Z

@vreshch
vreshch marked this pull request as ready for review July 8, 2026 21:53
@vreshch
vreshch merged commit 11e04c6 into master Jul 8, 2026
3 checks passed
@vreshch
vreshch deleted the feature/remove-mcp-command branch July 8, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant