@test-lab-ai/mcp
v0.1.6
Published
Model Context Protocol (MCP) server for test-lab.ai: the same operations as the testlab CLI (plans, projects, credentials, labels, data fixtures, scripts, import, and test runs) as MCP tools, with the same auth.
Downloads
572
Maintainers
Readme
@test-lab-ai/mcp
A Model Context Protocol server for
test-lab.ai. It exposes everything the testlab CLI does
- on top of the same public API - as MCP tools, so an AI agent (Claude Desktop / Code, Cursor, ...) can manage test plans, credentials, data fixtures, labels, scripts, bulk imports, and trigger test runs directly.
It reuses the CLI's own modules under the hood, so auth, request retries, and error shapes behave identically to the CLI.
Tools
| Tool | What it does | API |
| --- | --- | --- |
| login | Authenticate + save a key (browser flow or paste) | POST /api/v1/cli/token |
| whoami | Show the authenticated account | GET /api/v1/me |
| list_test_plans | List test plans | GET /api/v1/test-plans |
| create_test_plan | Create one natural-language plan | POST /api/v1/test-plans |
| list_projects | List projects | GET /api/v1/projects |
| set_credential | Upsert a {{credentials.<key>}} secret | POST /api/v1/credentials |
| list_credentials | List credential keys (values never shown) | GET /api/v1/credentials |
| list_labels / create_label | List / create labels | GET / POST /api/v1/labels |
| list_data_fixtures / create_data_fixture | List / create {{data.*}} fixtures | GET / POST /api/v1/data-fixtures |
| get_script / upload_script | Download / upload a plan's Playwright script | GET / POST /api/v1/scripts[/upload] |
| import_bundle | Bulk-create credentials + labels + fixtures + plans (pre-steps topo-sorted) | multiple |
| run_tests | Trigger runs by plan ids / project / label | POST /api/v1/run |
| examples | Full JSON reference for every resource | - |
Auth
Identical resolution to the testlab CLI:
- API key:
TESTLAB_API_KEYenv ->~/.test-lab/config.json
So if you've already run testlab login, this server is authenticated with no
extra steps. Otherwise either set TESTLAB_API_KEY in the server's env (below),
or call the login tool - it runs the same browser device-code handshake the
CLI uses and writes the same ~/.test-lab/config.json.
Get a key at https://test-lab.ai/admin/settings/api-keys.
Setup
The server runs the same way in every client: npx -y @test-lab-ai/mcp. Omit
TESTLAB_API_KEY if you've already run testlab login (the server reads the
same ~/.test-lab/config.json).
Claude Desktop / Claude Code (claude_desktop_config.json or .mcp.json):
{
"mcpServers": {
"test-lab": {
"command": "npx",
"args": ["-y", "@test-lab-ai/mcp"],
"env": { "TESTLAB_API_KEY": "tl_your_key_here" }
}
}
}Cursor (~/.cursor/mcp.json for all projects, or .cursor/mcp.json in one):
{
"mcpServers": {
"test-lab": {
"command": "npx",
"args": ["-y", "@test-lab-ai/mcp"],
"env": { "TESTLAB_API_KEY": "tl_your_key_here" }
}
}
}Codex CLI (~/.codex/config.toml):
[mcp_servers.test-lab]
command = "npx"
args = ["-y", "@test-lab-ai/mcp"]
env = { TESTLAB_API_KEY = "tl_your_key_here" }Claude Code, one-liner:
claude mcp add test-lab --env TESTLAB_API_KEY=tl_your_key_here -- npx -y @test-lab-ai/mcpNotes
- stdio transport. The server speaks JSON-RPC over stdout; all diagnostic logging is routed to stderr so it never corrupts the stream.
- Reference syntax usable in prompts, cookies, and headers:
{{credentials.<key>}},{{data.<fixture>.<field>}},{{run.shortId}}. Call theexamplestool for the full resource reference. - Runs cost credits on pay-as-you-go accounts (
run_tests).
MIT
