Commit 36342de
test(mcp): add HTTP transport integration tests covering every endpoint
29 integration tests in crates/axon-server/tests/mcp_contract.rs exercise
the full MCP JSON-RPC stack against an in-process server backed by
SQLite in-memory storage — same router as production, no mocks.
Coverage:
Protocol: ping, initialize (capabilities + serverInfo), notifications
(→ 204), unknown method (-32601), malformed JSON (-32700),
session header issued on first request
tools/list: axon.query always present; CRUD tools appear after collection
tools/call: item.create, item.get (missing → isError), item.patch
(success + version conflict → isError), item.delete,
unknown tool → isError, item.aggregate count
resources/list: _collections and _schemas always present; axon://item
appears after collection created
resources/templates/list: entity-by-id and audit templates present
resources/read: axon://_collections, axon://item (listing), axon://item/{id}
(entity), missing entity → JSON-RPC error (-32602)
resources/subscribe / unsubscribe: subscriptionId returned; unsubscribe ok
prompts/list: all four known prompts present
prompts/get: axon.schema_review returns user message; unknown → error
SSE endpoint: GET /mcp/sse delivers text/event-stream over real HTTP transport
Verification: cargo test -p axon-server --test mcp_contract,
cargo clippy -p axon-server --tests -- -D warnings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0cdcf6c commit 36342de
1 file changed
Lines changed: 733 additions & 0 deletions
0 commit comments