Phase 6 — Agent Integration
Goal
The MCP server’s tool surface is validated end-to-end against the tools an external agent would actually use. The external agent project does not exist yet — it will be built after this server is usable. Until then, exercise the server with the MCP Inspector and small curl/script harnesses.
Scope / Deliverables
- Public
/mcpendpoint reachable from outside the VPS, bearer-token gated - Validate all tools end-to-end with MCP Inspector
- Document the tool surface (signatures + example payloads) for the future agent project
- First connection from the Claude-based agent (Anthropic SDK) once that project starts
- End-to-end smoke test: Telegram message → agent → tool call → response
Automated Unit Testing
No new application-layer unit tests originate in this phase — all behavior under test was introduced in Phases 1–5. What this phase does add to the automated test story:
- Regression discipline: the full unit-test suite from Phases 1–5 must pass green in CI on every push. No new code merges if any prior phase’s tests regress.
- Tool-surface contract snapshot (
mcp/contract.test.ts): assert thattools/listreturns the exact set of registered tools with stable names and unchanged input/output schemas. This is the early-warning system for accidental breaking changes once the external agent project starts depending on the surface. - Example-payload smoke tests (
mcp/examples.test.ts): for each documented example payload (the ones being written for the future agent project), execute it through the in-process MCP server and assert a successful response shape. Keeps the docs in sync with reality.
Manual scope (Phase 6 owns this): MCP Inspector connected to https://bot.<domain>/mcp, exercise every tool. End-to-end smoke test with a real Claude agent once that project exists. See operations-and-strategy.md.
Definition of Done
-
/mcpis reachable from outside the VPS over HTTPS, gated byMCP_AUTH_TOKEN. - Every tool registered in Phases 2–5 has been called successfully via MCP Inspector and returns the documented shape.
- Tool surface documentation (signatures + example payloads) exists in ../api/ and links resolve.
- When the Claude-based agent project starts, its first connection to
/mcpsucceeds. - End-to-end smoke test passes: Telegram message → agent → tool call → Telegram reply.