How iampopovich/allure-testops-mcp works
1. This repo is a TypeScript/Node.js MCP server that sits between an MCP client and an Allure TestOps instance. The architectural boundary is clear: the server exposes MCP tools/resources over stdio, and all business operations are translated into Allure TestOps REST API calls.
2. The main runtime entrypoint is src/index.ts, which boots the server via src/server-bootstrap.ts. That bootstrap layer is where the MCP server is assembled: tools are registered, resources are exposed, and environment-driven configuration is applied.
3. Configuration and authentication are handled centrally in src/auth.ts, src/cache.ts, and src/client.ts. The server reads ALLURE_TESTOPS_URL, ALLURE_TOKEN, and optional ALLURE_PROJECT_ID, then exchanges the user token for a bearer JWT at the Allure auth endpoint and caches it in memory until near expiry.
4. The external system dependency is Allure TestOps itself. The repo does not persist its own business data; instead, it proxies operations to Allure TestOps APIs such as launches, test cases, test results, test plans, dashboards, defects, mutes, members, shared steps, and environments. That means state lives primarily in the upstream TestOps backend.
5. The src/api/ directory is the HTTP/domain adapter layer. Each file groups REST calls by domain (test-cases, launches, test-results, test-plans, defects, dashboards, environments, shared-steps, analytic). This is the boundary where request shaping, response normalization, and project-scoped URL logic live.
6. The src/tools/ directory is the MCP-facing application layer. Each domain file mirrors the API layer but exposes user actions as MCP tools. These handlers are the main orchestration point: they validate input, resolve project scope, call the API layer, and format results for the MCP client.
7. Project scoping is a recurring architectural concern. Some operations can use a default project from ALLURE_PROJECT_ID, while others require an explicit projectId or a projectName lookup. That project-resolution behavior is part of the server’s request flow, not a separate service.
8. src/resources/ defines MCP resources separate from tools. This is the read-only/catalog side of the server, complementing the action-oriented tool layer. The presence of a resource index suggests some shared metadata or discoverability surface for clients.
9. The repo also includes a generation path for a public tool catalog. scripts/generate-tool-catalog.ts produces docs/tools.json, and the GitHub Pages workflow publishes the static catalog under docs/. This is documentation infrastructure, but it is directly tied to the source-defined tool surface.
10. Operationally, the server is designed for multiple deployment modes: local npx, compiled node execution, Docker, and CI/CD publishing. The README and docker-compose.yml indicate that stdio transport is the intended client integration model rather than an HTTP API server.
11. Testing is split between unit and integration layers. Unit tests focus on tool behavior and shared helpers under tests/unit/, while tests/integration/ exercises live Allure TestOps interactions. That split reflects the core risk in this repo: correctness of API translation and auth/token reuse.
12. Overall dependency direction is one-way: MCP client → server bootstrap → tool handlers → API adapters → Allure TestOps. Cross-cutting concerns like auth caching, project resolution, and shared tool utilities are centralized so the domain tool files stay thin and consistent.
Main entry points: server-bootstrap.ts Server bootstrap · client.ts API client · utils.ts Tool utils · tools Unit tools
Components 31
Runtime
MCP server startup, config, auth, and transport boundary.
- Entry · Process entrypoint that starts the server.
src/index.ts - Server bootstrap · Assembles MCP server, registers tools/resources, and applies env config.
src/server-bootstrap.ts - Auth · Exchanges Allure token for bearer JWT and manages auth flow.
src/auth.ts - Token cache · Caches authentication tokens until near expiry.
src/cache.ts - API client · Shared client used to talk to Allure TestOps APIs.
src/client.ts
API Adapter
Domain adapters that translate MCP requests into Allure TestOps REST calls.
- Test cases · REST adapter for test case operations.
src/api/test-cases.ts - Launches · REST adapter for launch operations.
src/api/launches.ts - Test results · REST adapter for test result operations.
src/api/test-results.ts - Test plans · REST adapter for test plan operations.
src/api/test-plans.ts - Defects · REST adapter for defect operations.
src/api/defects.ts - Dashboards · REST adapter for dashboard operations.
src/api/dashboards.ts - Environments · REST adapter for environment operations.
src/api/environments.ts - Shared steps · REST adapter for shared step operations.
src/api/shared-steps.ts - Analytics · REST adapter for analytic endpoints.
src/api/analytic.ts
MCP Tools
Client-facing tool handlers and shared tool utilities.
- Tool utils · Common validation, formatting, and project resolution helpers.
src/tools/utils.ts - Tool types · Shared type definitions for tool handlers.
src/tools/types.ts - Test case tools · Tool handlers for test case workflows.
src/tools/test-cases.ts - Launch tools · Tool handlers for launch workflows.
src/tools/launches.ts - Result tools · Tool handlers for test result workflows.
src/tools/test-results.ts - Plan tools · Tool handlers for test plan workflows.
src/tools/test-plans.ts - Defect tools · Tool handlers for defect workflows.
src/tools/defects.ts - Dashboard tools · Tool handlers for dashboard workflows.
src/tools/dashboards.ts - Env tools · Tool handlers for environment workflows.
src/tools/environments.ts - Step tools · Tool handlers for shared step workflows.
src/tools/shared-steps.ts - Analytics tools · Tool handlers for analytic workflows.
src/tools/analytic.ts
Resources
Read-only MCP resource surface.
- Resources · Read-only resource registry for MCP clients.
src/resources/index.ts
Ops & Docs
Packaging, publishing, and generated catalog artifacts.
- Catalog gen · Generates the published tool catalog JSON.
scripts/generate-tool-catalog.ts - Tool catalog · Static catalog of exposed tools for discovery.
docs/tools.json
Tests
Unit and integration coverage.
- Unit tools · Unit coverage for tool behavior and utilities.
tests/unit/tools - Cache unit · Unit coverage for token cache behavior.
tests/unit/cache.unit.test.ts - Integration · Live Allure TestOps interaction tests.
tests/integration
Connections 48
- Entry → Server bootstrap: boots · Entrypoint starts the assembled server.
- Server bootstrap → Auth: auth · Bootstrap wires auth configuration and token flow.
- Server bootstrap → API client: client · Bootstrap constructs the shared API client.
- Auth → Token cache: caches · Auth stores bearer tokens in memory.
- API client → Token cache: reads token · Client uses cached authentication state.
- Server bootstrap → Test case tools: registers · Server exposes test case tools.
- Server bootstrap → Launch tools: registers · Server exposes launch tools.
- Server bootstrap → Result tools: registers · Server exposes test result tools.
- Server bootstrap → Plan tools: registers · Server exposes test plan tools.
- Server bootstrap → Defect tools: registers · Server exposes defect tools.
- Server bootstrap → Dashboard tools: registers · Server exposes dashboard tools.
- Server bootstrap → Env tools: registers · Server exposes environment tools.
- Server bootstrap → Step tools: registers · Server exposes shared step tools.
- Server bootstrap → Analytics tools: registers · Server exposes analytics tools.
- Server bootstrap → Resources: registers · Server exposes MCP resources.
- Test case tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Launch tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Result tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Plan tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Defect tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Dashboard tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Env tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Step tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Analytics tools → Tool utils: uses · Tool handlers share validation and project resolution.
- Test case tools → Test cases: calls · MCP tool requests are translated to API operations.
- Launch tools → Launches: calls · MCP tool requests are translated to API operations.
- Result tools → Test results: calls · MCP tool requests are translated to API operations.
- Plan tools → Test plans: calls · MCP tool requests are translated to API operations.
- Defect tools → Defects: calls · MCP tool requests are translated to API operations.
- Dashboard tools → Dashboards: calls · MCP tool requests are translated to API operations.
- Env tools → Environments: calls · MCP tool requests are translated to API operations.
- Step tools → Shared steps: calls · MCP tool requests are translated to API operations.
- Analytics tools → Analytics: calls · MCP tool requests are translated to API operations.
- Test cases → API client: uses · API adapters use the shared HTTP client.
- Launches → API client: uses · API adapters use the shared HTTP client.
- Test results → API client: uses · API adapters use the shared HTTP client.
- Test plans → API client: uses · API adapters use the shared HTTP client.
- Defects → API client: uses · API adapters use the shared HTTP client.
- Dashboards → API client: uses · API adapters use the shared HTTP client.
- Environments → API client: uses · API adapters use the shared HTTP client.
- Shared steps → API client: uses · API adapters use the shared HTTP client.
- Analytics → API client: uses · API adapters use the shared HTTP client.
- Catalog gen → Tool catalog: generates · Script emits the published tool catalog.
- Unit tools → Test case tools: covers · Unit tests exercise tool handlers.
- Unit tools → Launch tools: covers · Unit tests exercise tool handlers.
- Unit tools → Plan tools: covers · Unit tests exercise tool handlers.
- Unit tools → Result tools: covers · Unit tests exercise tool handlers.
- Cache unit → Token cache: covers · Unit tests exercise token cache behavior.