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/mcpwith an API key. - Local stdio.
heybug mcpruns on your machine. Use it when the tools must read your project folder or reachlocalhost.
1. Remote server
- Create a key. In HeyBug open API keys (
/settings/tokens), create one and copy it. It is shown once. The setup page at/connectdoes this and fills in the snippets for you. Or runheybug login, thenheybug connect claude|cursor|vscode(add--printto see the config). - Add the server. The URL is
https://opentest.nagara.cloud/api/mcpand the header isAuthorization: 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.
| Tool | Inputs | Returns | Example prompt |
|---|---|---|---|
heybug_check_account | none | User, workspace, role, plan. | "Check that HeyBug is connected." |
heybug_get_server_info | none | Server version, tool count and signed-in workspace, read from GET /api/mcp/info. | "Which HeyBug workspace am I connected to?" |
heybug_run | url*, instructions, projectId, wait (default true) | Counts, each failing case with step, Expected, Actual, web link. | "Test https://staging.crate.so with HeyBug." |
heybug_list_projects | none | Projects with id, name, url, last run. | "List my HeyBug projects." |
heybug_create_project | url*, name | The new project id and dashboard link. | "Create a HeyBug project for https://kitchen.protheolabs.space." |
heybug_set_login | projectId, username, password, loginUrl, notes | Saved 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_explore | projectId*, instructions | Exploration id and page URL. | "Explore project p_1, focus on checkout." |
heybug_plan | projectId, type (frontend/backend), needLogin, instructions, pathname | Use cases, case keys, titles, pending card id. | "Propose a test plan for p_1." |
heybug_get_plan | projectId* | Current plan as numbered cases with steps. | "Show the current plan for p_1." |
heybug_apply_plan | projectId*, caseKeys, run | Applied cases; starts a run when run is true. | "Apply the plan for p_1 and run it." |
heybug_generate_and_run | projectId*, testIds, additionalInstruction | Per-case results with failing step, Expected, Actual. | "Run the pending plan for p_1." |
heybug_list_tests | projectId*, status | Plan cases with last status. | "Which tests fail in p_1?" |
heybug_get_test | projectId, caseKey | Steps and last 10 results. | "Show test checkout-1 in p_1." |
heybug_search | q* | Matching projects, tests and runs. | "Search HeyBug for 'coupon'." |
heybug_list_runs | projectId*, limit | Recent runs with verdict. | "List the last 5 runs of p_1." |
heybug_get_run | runId*, wait (seconds, up to 45) | Verdict, counts, failed cases with web URLs. | "Get run r_9 and wait for it." |
heybug_read_report | runId*, 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_result | caseResultId*, screenshot (default true) | Steps, failing step, Expected vs Actual, screenshot links (/api/artifacts/{id}). | "Show why case result cr_3 failed." |
heybug_rerun | runId*, onlyFailed, additionalInstruction | New per-case results. | "Re-run only the failed cases of r_9." |
heybug_rerun_failed | runId* | A new run of the failed cases. | "Rerun the failures from r_9." |
heybug_cancel_run | runId* | The cancelled run. | "Cancel run r_9." |
heybug_fix | caseResultId*, wait (default true) | status, prUrl, proofRunId, reason. Opens a pull request only. | "Fix the failure in cr_3." |
heybug_fix_loop | caseResultId*, 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_tests | projectId*, window | Flaky tests ranked by score. | "Is this failure a known flake in p_1?" |
heybug_past_failures | projectId*, caseKey, limit | Known failure signatures. | "Have we seen this error before in p_1?" |
heybug_case_history | projectId, caseKey | Pass/fail timeline, flaky score. | "Show history of checkout-1 in p_1." |
heybug_open_run | runId or projectId | Dashboard URL. | "Open the latest run of p_1." |
heybug_bootstrap | localPort, pathname, type, projectName, instructions | Checks localhost, finds or creates the project. | "Connect my app on port 5173 to HeyBug." |
heybug_standardize_prd | projectId, projectPath | Normalised PRD; writes heybug/standard_prd.json. | "Standardize the PRD in this folder." |
heybug_summarize_code | projectPath* | 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.
- "Check that HeyBug is connected." The agent calls
heybug_check_accountandheybug_get_server_infoand reports the workspace. - "List my HeyBug projects." The agent calls
heybug_list_projects. If the site is missing, it callsheybug_create_projectwith the address, for examplehttps://kitchen.protheolabs.space. - "Sign into that app as
ada@example.comwith password...." The agent callsheybug_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 passloginUrl. - "Explore it and propose tests." The agent calls
heybug_plan(orheybug_explorethenheybug_get_plan) and shows the cases for review. - "Run them." The agent calls
heybug_generate_and_runand reports which cases passed and failed. - "Read the report." The agent calls
heybug_get_runfor the run id, thenheybug_read_reportfor 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" meansHEYBUG_TOKENis unset. - 403. The
Originheader 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_runwith that id (waitup to 45) until it finishes. Over stdio,heybug_runwaits up to 15 minutes. - Which URL on staging. Use
https://opentest.nagara.cloud/api/mcp, not/mcpand not the site root. The remote server cannot reach yourlocalhost; test a public URL or use stdio. - Tool missing. Restart the client. Compare with
GET https://opentest.nagara.cloud/api/mcp/tools.