Skip to content

feat: add packages/mex-mcp — MCP server for mex-agent#84

Draft
rudi193-cmd wants to merge 1 commit into
mex-memory:mainfrom
rudi193-cmd:feat/mex-mcp
Draft

feat: add packages/mex-mcp — MCP server for mex-agent#84
rudi193-cmd wants to merge 1 commit into
mex-memory:mainfrom
rudi193-cmd:feat/mex-mcp

Conversation

@rudi193-cmd

Copy link
Copy Markdown

Follows up on #81 and your design guidance.

What this adds

packages/mex-mcp — a TypeScript MCP server over stdio that lets AI agents call mex as native tools.

Five tools (v1 scope):

Tool Calls Returns
mex_check runDriftCheck DriftReport (score, issues, filesChecked)
mex_log readEvents / appendEvent events array / { ok }
mex_timeline readEvents + client filter events filtered by kind / since
mex_heartbeat checkHeartbeat HeartbeatResult (ok, staleFiles, memoryCleanupDue)
mex_read_file fs read raw scaffold file content

mex_sync is deferred — leaving it for when the structured return shape is clear.

Design choices (per your comment)

  • All tools import directly from mex-agent public API — no subprocess wrapping
  • stdio transport only
  • All responses are structured JSON (or raw text for mex_read_file)
  • projectRoot param on every tool (defaults to cwd) so agents can target any project

What needs discussion / maintainer input

  1. Workspace setup — the root package.json doesn't have workspaces yet. Should I add "workspaces": ["packages/*"] here, or do you prefer a different approach?
  2. readEvents opts — I'm passing { limit } to readEvents based on the exported LogOpts type; if the signature is different let me know and I'll adjust.
  3. appendEvent shape — calling as appendEvent(config, { kind, summary }); please correct if the actual signature differs.
  4. npm / pnpm / bunpackage.json uses workspace:* (pnpm-style); adjust if you prefer npm workspaces syntax.

Happy to co-develop this with you — treat this as a starting scaffold to iterate on.

Adds packages/mex-mcp with five MCP tools over stdio transport:
- mex_check     — runs runDriftCheck, returns DriftReport
- mex_log       — read/write via readEvents/appendEvent
- mex_timeline  — readEvents with kind + since filters
- mex_heartbeat — checkHeartbeat, returns HeartbeatResult
- mex_read_file — reads scaffold files relative to .mex/

All tools call the public mex-agent API directly (Option B, per mex-memory#81).
mex_sync deferred until structured return shape is settled.

Closes mex-memory#81
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