mcp-server
v1.0.0MCP server for Shift-Left Studio — generate, explain and run API tests from Claude, Cursor and other AI agents.
@totalshiftleft/mcp-server Connect Shift-Left Studio to Claude, Cursor, and other AI agents over the Model Context Protocol. Ask an agent to import an API specification and build a test suite, to explain what is untested and close the gaps, or to run a test set against staging and report the failures — without leaving your editor or chat.
Summary extracted from the README.
@totalshiftleft/mcp-server
Connect Shift-Left Studio to Claude, Cursor, and other AI agents over the Model Context Protocol.
Ask an agent to import an API specification and build a test suite, to explain what is untested and close the gaps, or to run a test set against staging and report the failures — without leaving your editor or chat.
Requirements
- Node.js 20 or newer
- Shift-Left Studio on an edition that includes MCP Server (Professional, Trial or Enterprise)
- A platform API key — create one in Studio under Settings → Integrations → AI Agents (MCP), which mints it with the right scopes and prints the configuration below with the key already in it
Key scopes
Grant only what the agent needs. A full-capability agent key:
view_test_case, view_coverage_metrics, view_execution_reports, view_environment_variables, view_security_findings, create_test_case, ai_generate_tests, run_tests_manually
For a read-only agent, drop the last three and set SLS_READ_ONLY=true.
To let an agent run security checks, add run_security_checks. They send crafted requests to a real system, and on an environment allowed for them some can change data, so it is never granted by default.
A key can never do more than the person who created it — its permissions are its scopes intersected with its creator's. Tools the key cannot use are hidden from the agent, and the client's log names the scope each one needs.
Setup
The AI Agents (MCP) screen in Studio prints this configuration with your URL and key already in it. By hand:
Claude Desktop — claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"shift-left-studio": {
"command": "npx",
"args": ["-y", "@totalshiftleft/mcp-server"],
"env": {
"SLS_BASE_URL": "https://yourtenant.totalshiftleft.ai",
"SLS_API_KEY": "sk_live_…"
}
}
}
}
Claude Code:
claude mcp add shift-left-studio --env SLS_BASE_URL=https://yourtenant.totalshiftleft.ai --env SLS_API_KEY=sk_live_… -- npx -y @totalshiftleft/mcp-server
Cursor — the same mcpServers block in .cursor/mcp.json in your project, or in ~/.cursor/mcp.json for every project.
Restart the client after editing its configuration.
On Windows
npx is a script there, not a program, so a client that starts its server directly cannot launch it and reports only Connection closed. Start it through cmd instead:
{
"mcpServers": {
"shift-left-studio": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@totalshiftleft/mcp-server"],
"env": {
"SLS_BASE_URL": "https://yourtenant.totalshiftleft.ai",
"SLS_API_KEY": "sk_live_…"
}
}
}
}
For Claude Code, run this in PowerShell or Command Prompt (Git Bash rewrites /c into a path):
claude mcp add shift-left-studio --env SLS_BASE_URL=https://yourtenant.totalshiftleft.ai --env SLS_API_KEY=sk_live_… -- cmd /c npx -y @totalshiftleft/mcp-server
Configuration
| Variable | Required | Default | Purpose |
|---|---|---|---|
SLS_BASE_URL |
✅ | — | Your Shift-Left Studio URL. /api is added automatically. |
SLS_API_KEY |
✅ | — | Platform API key (sk_live_…). |
SLS_READ_ONLY |
false |
Hide every tool that changes data or runs tests. | |
SLS_ALLOW_PRODUCTION_RUNS |
false |
Permit runs against production. The server must also allow it. | |
SLS_DEFAULT_PROJECT |
— | Project used when the agent does not name one. | |
SLS_TIMEOUT_MS |
120000 |
Per-request timeout. | |
SLS_JOB_WAIT_MS |
110000 |
How long a tool waits for a long job before handing back a jobId to poll. |
|
SLS_POLL_INTERVAL_MS |
2000 |
Job polling interval. | |
SLS_ALLOW_INSECURE |
false |
Permit http:// to a remote host. Sends your key in clear text — internal networks only. |
|
SLS_LOOKUP_TOOLS |
— | all, or a comma list of lookup names, to expose those assistant lookups as tools of their own as well (see below). A curated tool keeps its name. |
Tools
| Tool | Changes data | Purpose |
|---|---|---|
list_projects |
Projects this key can see. | |
list_endpoints |
Endpoints in a project, with test counts. | |
list_environments |
Environments, with production flagged. | |
import_spec |
✅ | Import OpenAPI/Swagger, WSDL or GraphQL into endpoints. |
generate_tests |
✅ | Generate a suite for endpoints. |
explain_coverage |
What is untested, in plain language. | |
close_coverage_gaps |
✅ | Generate the missing cases. |
validate_tests |
Structural problems in existing tests. | |
run_tests |
⚠️ | Run against a live environment. |
get_run_results |
Results of an earlier run. | |
list_load_runs / get_load_run |
Performance test runs, verdict first. | |
get_security_posture / list_security_findings / get_security_report |
Security posture, findings worst-first, a scan's report (JSON or SARIF). | |
run_security_checks |
⚠️ | Run the security checks against an environment. Needs its own scope. |
get_job |
Progress of a long operation. | |
find_lookups |
Search the in-app assistant's read-only lookups. | |
lookup |
Run one of them, scoped to a project. |
Generation, gap fill and runs are long operations: the tool waits, reports progress, and hands back a jobId to poll if it outlasts SLS_JOB_WAIT_MS. The work continues on the server either way — never resubmit.
The assistant's lookups — everything else the product can answer
find_lookups and lookup reach the ~107 read-only lookups the in-app assistant uses — requirements and their
verdicts, test history, run analyses and failure causes, workflows and their bindings, mocks, test data, documents,
performance and security. They are the same functions, so an agent and the chat panel answer one question the same way: asked "which
requirements are unverified in project P", both read list_requirement_verdicts.
- Reads only. The assistant's offers (
build_*) are accepted by a person in the app and are never listed. - Each lookup needs the permission the screen needs for that data: security lookups
view_security_findings, runs and load testsview_execution_reports, environments and authenticationview_environment_variables, workflowsview_workflow, everything elseview_test_case. A key is only shown the lookups it can run. - Most read one project — pass
projectId(or setSLS_DEFAULT_PROJECT). An argument the lookup does not declare is refused by name rather than ignored. - Two tools by default, not a hundred: every tool definition costs the agent context on every turn. Set
SLS_LOOKUP_TOOLS=allfor a client that handles a large tool list.
Prompts
Available as slash-commands in clients that support MCP prompts:
/tsl-suite-from-spec— import a specification and generate a suite/tsl-whats-untested— coverage review, then offer to close the gaps/tsl-smoke— run a tagged set against a non-production environment/tsl-triage-failures— group recent failures by root cause
Running against production
Refused by default. An agent has no instinct for blast radius, and production is often the most invitingly named environment.
Enabling it takes both: MCP_ALLOW_PRODUCTION_RUNS=true on the Studio server, and SLS_ALLOW_PRODUCTION_RUNS=true here. The agent must then also pass allowProduction on the individual call. One switch is the operator's decision; the others prove this specific run was intended.
Keeping data inside your network
This client makes requests to exactly one destination: SLS_BASE_URL. No telemetry, no update check, no third-party host.
What leaves your network depends on the rest of the setup:
| Setup | What leaves |
|---|---|
Self-hosted client (self-hosted model) + generate_tests in deterministic mode |
Nothing. |
Claude Desktop or Cursor + deterministic mode |
Your conversation goes to that vendor, as it always does. Studio adds nothing. |
Any client + ai-assisted mode |
Also whatever the AI provider configured in Studio receives. |
deterministic is the default and uses no language model on the server at all — the coverage engine and strategy fan-out are ordinary code.
Operators can enforce this: with MCP_REQUIRE_LOCAL_AI=true on the server, ai-assisted generation is refused unless the configured model is self-hosted.
Troubleshooting
Diagnostics go to stderr and appear in your client's MCP server logs.
| Symptom | Cause |
|---|---|
Connection closed at once, on Windows |
The client cannot launch npx directly — use the cmd form in On Windows. |
Connection closed at once, anywhere else |
Node.js 20 or newer is not on the path your client sees. Run node --version to check. |
| "is not configured" on startup | SLS_BASE_URL or SLS_API_KEY missing from the env block. |
| "rejected the API key (401)" | Key is wrong, revoked, or rotated past its grace window. |
| "not available on your edition" | MCP Server is not included in the current edition. |
| "has no MCP endpoint … (404)" | Wrong SLS_BASE_URL, or the server predates the MCP surface. |
| "contract mismatch" | Client and server major versions differ — update whichever is older. |
| A tool is missing | SLS_READ_ONLY=true hides every tool that changes data. Otherwise the key lacks a scope: the client's log names each hidden tool and the scope it needs. |
More
Product documentation: totalshiftleft.ai
Versioning
Versioned independently of the Shift-Left Studio platform. The major version tracks the server's MCP contract version: a client and server that disagree on major refuse to start rather than failing one tool at a time.