MCP integration

Use Testinspector.AI tools from Claude Code, Cursor and Claude Desktop through the Model Context Protocol.

What MCP gives you

The Model Context Protocol lets an MCP client, such as Claude Code, Cursor or Claude Desktop, call Testinspector.AI tools directly instead of copying API responses or clicking through the app.

The client connects as you, using a dedicated MCP token. The backend enforces the same user, organization and permission rules as the web app, so a client can only reach data you can reach. The tools cover:

  • Discovery: list projects, suites and tests
  • Suites: create, update and delete suites
  • Tests: create, update and delete tests
  • Steps: create, update, delete and reorder steps
  • Execution: run a test or a suite, check run status and cancel a run
  • Variables: set and delete variables
  • Integrations: Azure DevOps connection, work item and test case helpers

Create an MCP token

MCP clients authenticate with a dedicated token that starts with ti_mcp_. Ordinary login sessions are not accepted. Open Settings, then MCP Keys, and select Generate Token.

The raw token is shown once at creation. Copy it then, because it is not stored and cannot be shown again. If you lose it, revoke it and create a new one.

A token has read or write scope and can expire after 30 days, 90 days, 1 year, or never. A read token can list and read. A write token can also create, update, delete and run. Prefer the narrowest scope the client needs.

Connection details

The hosted MCP server uses streamable HTTP. Every request carries your token in an Authorization header:

  • Endpoint: https://mcp.testinspector.com/mcp
  • Header: Authorization: Bearer followed by a space and your ti_mcp token
  • The older /sse endpoint is retired and no longer served.

Claude Code

Claude Code connects over HTTP. Run the command below, replacing the token with your own. The flag names follow Claude Code's own MCP documentation, so check there if a flag has changed.

claude mcp add --transport http testinspector \
  https://mcp.testinspector.com/mcp \
  --header "Authorization: Bearer ti_mcp_your_token"

Cursor

Cursor reads an mcp.json config file: .cursor/mcp.json in a project, or ~/.cursor/mcp.json for all projects. Create it if it does not exist and add the server below. The config shape follows Cursor's own MCP documentation.

{
  "mcpServers": {
    "testinspector": {
      "url": "https://mcp.testinspector.com/mcp",
      "headers": { "Authorization": "Bearer ti_mcp_your_token" }
    }
  }
}

Claude Desktop

Claude Desktop uses a local JSON config file. On macOS it is at ~/Library/Application Support/Claude/claude_desktop_config.json, and on Windows at %APPDATA%\Claude\claude_desktop_config.json.

Claude Desktop reaches the hosted server through a local bridge. Add the server below under mcpServers, then restart Claude Desktop. The bridge command follows the mcp-remote tool's documentation.

{
  "mcpServers": {
    "testinspector": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://mcp.testinspector.com/mcp",
        "--header", "Authorization: Bearer ti_mcp_your_token"
      ]
    }
  }
}

Local or self-hosted setup

If you run the Testinspector.AI backend yourself, connect over stdio instead of the hosted URL. Point the client at the backend's Python environment and the mcp_server module, and pass the token and API URLs as environment variables.

Use your own absolute paths for the Python executable and the backend directory. The API URLs below match the default Docker ports.

{
  "mcpServers": {
    "testinspector": {
      "command": "<path-to>/backend/env/bin/python",
      "args": ["-m", "mcp_server", "--transport", "stdio"],
      "cwd": "<path-to>/backend",
      "env": {
        "DJANGO_API_URL": "http://localhost:4000/api/v1",
        "DJANGO_API_ORIGIN": "http://localhost:5001",
        "TESTINSPECTOR_TOKEN": "ti_mcp_your_token"
      }
    }
  }
}

Verify the connection

In Claude Code, run /mcp to see the server state and the number of tools. In Cursor and Claude Desktop, open the MCP or tools panel and confirm the testinspector server is connected and lists tools.

For an end to end check, ask the client to list your projects or suites. A read token is enough for that. If the tools appear and return your data, the connection works.

Troubleshooting

Most problems come from the token or the Authorization header. Common cases:

  • Token rejected: the token was revoked or expired, or it was pasted with a missing or extra character. Create a new token in MCP Keys.
  • 401 Unauthorized: the Authorization header is missing or malformed. It must read Bearer, a space, then the token.
  • 403 on a write action: the token has read scope only, targets a different organization, or the action needs an admin or owner role. Use a write token in the right organization.
  • No tools listed: the client could not start or connect. Recheck the endpoint URL and the Authorization header, then reconnect.

Revoke a token

Revoke a token under Settings, MCP Keys whenever a client no longer needs it, or whenever a token may be exposed. Revoking takes effect immediately for every client using it. A revoked token can then be deleted from the list.