Code mode is the point: the functions sit behind a namespace that one execute_code call reaches, so the tool list stays small and a single execution can check project health, branch on the answer, and pull the flaky tests without a round trip in between.
An MCP server over Gaffer's test history and coverage data. It runs in code mode: three tools plus a namespace of 17 functions called from JavaScript, so few tool definitions occupy the context window and one execution can chain several calls.
- execute_code runs JavaScript against codemode.<function>(), up to 20 API calls with a 30-second timeout
- search_tools finds available functions by keyword; an empty query lists all of them
- list_projects lists your projects, and is registered only when the token is a user API key
- Test health functions — get_project_health for score, pass rate and trend, get_test_history for one test, get_flaky_tests by flip rate, list_test_runs, get_test_run_details, get_failure_clusters grouped by root cause, get_slowest_tests by P95 duration, compare_test_metrics between commits or runs, search_failures by error or test-name pattern
- Coverage functions — get_coverage_summary, get_coverage_for_file, get_untested_files below a threshold, find_uncovered_failure_areas for files with low coverage and failures at once
- Reports — get_report for a run's report files, get_report_browser_url for a signed browser link valid 30 minutes, get_upload_status for whether CI results have landed
- Every function is read-only except upload_test_results, which is rate-limited and audit-logged
The npm package @gaffer-sh/mcp over stdio; one claude mcp add command wires it in. GAFFER_API_KEY is required — either a gaf_ user key or a gfr_ project token from Account Settings under API Keys, and the project-token case does not register list_projects. GAFFER_API_URL overrides the base URL, defaulting to https://app.gaffer.sh. You need a Gaffer account with test results already uploaded.
One command plus a key — npx -y @gaffer-sh/mcp, then supply credentials
