Skip to Content
HeyBug docs
MCP

MCP

HeyBug speaks the Model Context Protocol, so an AI assistant can test a URL, read failures and re-run.

HeyBug speaks the Model Context Protocol, so an AI assistant can test a URL, read failures and re-run. Two ways to connect:

  • Remote server (recommended). Nothing to install. Your client calls https://opentest.nagara.cloud/api/mcp with an API key.
  • Local stdio. heybug mcp runs on your machine. Use it when the tools must read your project folder or reach localhost.

1. Remote server

  1. Create a key. In HeyBug open API keys (/settings/tokens), create one and copy it. It is shown once. The setup page at /connect does this and fills in the snippets for you. Or run heybug login, then heybug connect claude|cursor|vscode (add --print to see the config).
  2. Add the server. The URL is https://opentest.nagara.cloud/api/mcp and the header is Authorization: Bearer <key>.

Claude Code

claude mcp add --transport http heybug https://opentest.nagara.cloud/api/mcp \
  --header "Authorization: Bearer YOUR_KEY"

Cursor

.cursor/mcp.json:

{
  "mcpServers": {
    "heybug": {
      "url": "https://opentest.nagara.cloud/api/mcp",
      "headers": { "Authorization": "Bearer YOUR_KEY" }
    }
  }
}

VS Code

.vscode/mcp.json:

{
  "servers": {
    "heybug": {
      "type": "http",
      "url": "https://opentest.nagara.cloud/api/mcp",
      "headers": { "Authorization": "Bearer YOUR_KEY" }
    }
  }
}

Then ask: "Use HeyBug to check my account." The /connect page can also check the connection and lists the tools.

2. Local stdio

{
  "mcpServers": {
    "heybug": {
      "command": "heybug",
      "args": ["mcp"],
      "env": {
        "HEYBUG_SERVER": "https://opentest.nagara.cloud",
        "HEYBUG_TOKEN": "YOUR_KEY"
      }
    }
  }
}

HEYBUG_SERVER defaults to http://localhost:8080. The server speaks JSON-RPC 2.0, one message per line, protocol 2025-06-18. Stdout carries protocol messages only; logs go to stderr. heybug mcp-config <client> prints a config for other clients.

3. Tools

Every tool returns Markdown text and, where useful, structuredContent. A failing test is a result, not an error: isError is true only for auth, network or validation problems. Required inputs are marked *. The live list is GET /api/mcp/tools; backend/internal/cli/serve_mcp_tools_w3_test.go checks it.

ToolInputsReturnsExample prompt
heybug_check_accountnoneUser, workspace, role, plan."Check that HeyBug is connected."
heybug_get_server_infononeServer version, tool count and signed-in workspace, read from GET /api/mcp/info."Which HeyBug workspace am I connected to?"
heybug_runurl*, instructions, projectId, wait (default true)Counts, each failing case with step, Expected, Actual, web link."Test https://staging.crate.so with HeyBug."
heybug_list_projectsnoneProjects with id, name, url, last run."List my HeyBug projects."
heybug_create_projecturl*, nameThe new project id and dashboard link."Create a HeyBug project for https://kitchen.protheolabs.space."
heybug_set_loginprojectId, username, password, loginUrl, notesSaved sign-in for the target app: username, hasPassword, login page and settings link. The password is write-only and never echoed."Sign into the kitchen app as ada@example.com with this password."
heybug_exploreprojectId*, instructionsExploration id and page URL."Explore project p_1, focus on checkout."
heybug_planprojectId, type (frontend/backend), needLogin, instructions, pathnameUse cases, case keys, titles, pending card id."Propose a test plan for p_1."
heybug_get_planprojectId*Current plan as numbered cases with steps."Show the current plan for p_1."
heybug_apply_planprojectId*, caseKeys, runApplied cases; starts a run when run is true."Apply the plan for p_1 and run it."
heybug_generate_and_runprojectId*, testIds, additionalInstructionPer-case results with failing step, Expected, Actual."Run the pending plan for p_1."
heybug_list_testsprojectId*, statusPlan cases with last status."Which tests fail in p_1?"
heybug_get_testprojectId, caseKeySteps and last 10 results."Show test checkout-1 in p_1."
heybug_searchq*Matching projects, tests and runs."Search HeyBug for 'coupon'."
heybug_list_runsprojectId*, limitRecent runs with verdict."List the last 5 runs of p_1."
heybug_get_runrunId*, wait (seconds, up to 45)Verdict, counts, failed cases with web URLs."Get run r_9 and wait for it."
heybug_read_reportrunId*, wait (seconds, up to 45)Verdict, pass rate, summary, root causes and failing cases with step, Expected and Actual, read from GET /api/runs/{runId}/report."Read the report for r_9."
heybug_get_case_resultcaseResultId*, screenshot (default true)Steps, failing step, Expected vs Actual, screenshot links (/api/artifacts/{id})."Show why case result cr_3 failed."
heybug_rerunrunId*, onlyFailed, additionalInstructionNew per-case results."Re-run only the failed cases of r_9."
heybug_rerun_failedrunId*A new run of the failed cases."Rerun the failures from r_9."
heybug_cancel_runrunId*The cancelled run."Cancel run r_9."
heybug_fixcaseResultId*, wait (default true)status, prUrl, proofRunId, reason. Opens a pull request only."Fix the failure in cr_3."
heybug_fix_loopcaseResultId*, retest (default false)state (open, verifying, fixed, still_failing), failure, video, fixPrompt. With retest it re-runs the affected tests and answers "Fixed ✓" or "Not fixed yet"."Re-test cr_3 now that I changed the cart."
heybug_flaky_testsprojectId*, windowFlaky tests ranked by score."Is this failure a known flake in p_1?"
heybug_past_failuresprojectId*, caseKey, limitKnown failure signatures."Have we seen this error before in p_1?"
heybug_case_historyprojectId, caseKeyPass/fail timeline, flaky score."Show history of checkout-1 in p_1."
heybug_open_runrunId or projectIdDashboard URL."Open the latest run of p_1."
heybug_bootstraplocalPort, pathname, type, projectName, instructionsChecks localhost, finds or creates the project."Connect my app on port 5173 to HeyBug."
heybug_standardize_prdprojectId, projectPathNormalised PRD; writes heybug/standard_prd.json."Standardize the PRD in this folder."
heybug_summarize_codeprojectPath*Frameworks, routes, scripts, ports."Summarize this codebase for HeyBug."

heybug_bootstrap, heybug_standardize_prd and heybug_summarize_code read your machine. They need the local stdio server.

4. Test a signed-in app end to end

This is the whole loop for a public app that needs an account, driven from the agent. Use a real URL and a real sign-in; the same tools work for the demo site.

  1. "Check that HeyBug is connected." The agent calls heybug_check_account and heybug_get_server_info and reports the workspace.
  2. "List my HeyBug projects." The agent calls heybug_list_projects. If the site is missing, it calls heybug_create_project with the address, for example https://kitchen.protheolabs.space.
  3. "Sign into that app as ada@example.com with password ...." The agent calls heybug_set_login. The password is sent once and is never returned or shown again. If the sign-in page is not the site's home page, also pass loginUrl.
  4. "Explore it and propose tests." The agent calls heybug_plan (or heybug_explore then heybug_get_plan) and shows the cases for review.
  5. "Run them." The agent calls heybug_generate_and_run and reports which cases passed and failed.
  6. "Read the report." The agent calls heybug_get_run for the run id, then heybug_read_report for the verdict, pass rate, root causes and the failing step with expected and actual.

You can check every step in the web app: the project at /p/{project}, its sign-in details at /p/{project}/settings, the plan at /p/{project}/plan, the run at /p/{project}/runs/{run}, and the report at /p/{project}/runs/{run}/report. The setup page at /connect shows the config for your agent and can test the connection. Create keys at /settings/tokens.

5. Troubleshooting

  • 401. The key is missing, wrong or revoked. Send Authorization: Bearer <key>; a browser session cookie is not enough. Create a new key at /settings/tokens. With stdio, "Not signed in" means HEYBUG_TOKEN is unset.
  • 403. The Origin header must match the server's public URL. Native MCP clients send none.
  • Timeouts and the 50 s cap. Long tools return after 50 s with what is known and the run id. Call heybug_get_run with that id (wait up to 45) until it finishes. Over stdio, heybug_run waits up to 15 minutes.
  • Which URL on staging. Use https://opentest.nagara.cloud/api/mcp, not /mcp and not the site root. The remote server cannot reach your localhost; test a public URL or use stdio.
  • Tool missing. Restart the client. Compare with GET https://opentest.nagara.cloud/api/mcp/tools.

On this page