Skip to content

Add Docker-based MCP smoke test harness #3

@CaliLuke

Description

@CaliLuke

Motivation

Streamable HTTP previously failed with Graphium client not initialized. We fixed the root cause, but we still lack an automated way to validate the MCP server end-to-end. Setting up a repeatable local harness will let us catch regressions before they land and gives CI a ready-made path once we’re ready to automate it.

Proposal

  1. Docker compose for testing
    • Add mcp_server/docker-compose.testing.yml that only runs the graphium-mcp service.
    • The service should:
      • build from the existing mcp_server/Dockerfile
      • mount the repo (..:/workspace:delegated)
      • point NEO4J_URI at bolt://host.docker.internal:7687
      • expose 8000 for FastMCP HTTP
      • leave --transport streamable-http as the default command.
  2. Smoke script
    • Create scripts/run_mcp_smoke.sh that:
      1. spins up the compose file (docker compose -f mcp_server/docker-compose.testing.yml up --build -d)
      2. polls http://localhost:8000/healthz until it returns status=ok
      3. hits http://localhost:8000/mcp with a minimal MCP request (curl or small Python snippet) and fails if the response contains Graphium client not initialized
      4. tears down the stack (docker compose … down -v) even on failure.
    • Make the script return non-zero if any check fails so we can wire it into CI later.
  3. Optional helper test
    • Add mcp_server/tests/test_streamable_http.py that exercises the same MCP POST logic. This gives a reusable probe we can call from the shell script (e.g. uv run pytest mcp_server/tests/test_streamable_http.py).
  4. Documentation
    • Update docs/testing.md with a “MCP smoke harness” section explaining prerequisites (local Neo4j, fastapi install), how to run the script, and how to interpret failures.

Success Criteria

  • Running scripts/run_mcp_smoke.sh on a machine with Neo4j running locally exits 0 and prints a summary.
  • The script fails fast (non-zero) if health check never returns ok, the MCP POST returns an error, or docker compose fails.
  • Documentation mirrors the exact command names/paths.

Follow-ups (not in scope here)

  • Add the script to CI once the local workflow proves reliable.
  • Extend the harness to spin up a throwaway Neo4j when we don’t have one pre-existing.

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