Description
Add integration tests that exercise the full MCP STDIO pipeline end-to-end:
spawn the proxy (index.js) via a PTY, send JSON-RPC messages, and validate responses.
Requirements
-
Temp DB isolation — Add VECTOR_MEMORY_DATA_DIR env var override to
vector-memory-server.js so tests can point at a temp directory instead
of ~/.copilot/. Delete the temp dir after tests.
-
PTY wrapper — Use node-pty (or similar) to spawn index.js and
interact via MCP JSON-RPC over stdin/stdout.
-
Test cases (positive + negative):
vector_search with a valid query → returns results array
vector_search with missing query param → returns error
vector_reindex → returns count
tools/list → lists both tools with correct schemas
- Initialize handshake completes successfully
-
Cleanup — Temp DB directory is removed after test run.
Notes
- The three HTTP endpoints on the server are
/ping, /search, /reindex
- The proxy forwards MCP tool calls to the HTTP server via
callServerWithRetry()
- DB paths are currently hardcoded in
vector-memory-server.js:17-19
Description
Add integration tests that exercise the full MCP STDIO pipeline end-to-end:
spawn the proxy (
index.js) via a PTY, send JSON-RPC messages, and validate responses.Requirements
Temp DB isolation — Add
VECTOR_MEMORY_DATA_DIRenv var override tovector-memory-server.jsso tests can point at a temp directory insteadof
~/.copilot/. Delete the temp dir after tests.PTY wrapper — Use
node-pty(or similar) to spawnindex.jsandinteract via MCP JSON-RPC over stdin/stdout.
Test cases (positive + negative):
vector_searchwith a valid query → returns results arrayvector_searchwith missing query param → returns errorvector_reindex→ returns counttools/list→ lists both tools with correct schemasCleanup — Temp DB directory is removed after test run.
Notes
/ping,/search,/reindexcallServerWithRetry()vector-memory-server.js:17-19