Skip to content

Integration tests: MCP STDIO end-to-end with temp DB #5

@BrainSlugs83

Description

@BrainSlugs83

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

  1. 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.

  2. PTY wrapper — Use node-pty (or similar) to spawn index.js and
    interact via MCP JSON-RPC over stdin/stdout.

  3. 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
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions