Allure TestOps MCP Server
Project description
Lucius MCP Server
A Model Context Protocol (MCP) server for Allure TestOps, built with FastMCP and Starlette.
🚀 Features
- FastMCP Integration: Leverages the FastMCP framework for efficient tool and resource management.
- Starlette Mounting: Mounted as a Starlette application for robust HTTP handling and easy extension.
- Structured Logging: JSON-formatted logging with automatic secret masking (powered by
src/utils/logger.py). - Global Error Handling: User-friendly "Agent Hint" error responses optimized for LLM consumption (powered by
src/utils/error.py). - Type Safety: Fully typed codebase checked with
mypy --strict. - Quality Assurance: Linting and formatting with
ruff.
⚙️ Configuration
The server can be configured using environment variables or a .env file.
| Variable | Description | Default |
|---|---|---|
ALLURE_ENDPOINT |
Allure TestOps Base URL | https://demo.testops.cloud |
ALLURE_PROJECT_ID |
Default Project ID | None |
ALLURE_API_TOKEN |
Allure API Token | None |
LOG_LEVEL |
Logging level | INFO |
HOST |
Host to bind the server to | 127.0.0.1 |
PORT |
Port to bind the server to | 8000 |
MCP_MODE |
Running mode: http or stdio |
stdio |
🛠️ Installation
This project uses uv for dependency management.
-
Install
uv(if not already installed):curl -LsSf https://astral.sh/uv/install.sh | sh
-
Clone the repository:
git clone https://github.com/lucius-mcp/lucius-mcp.git cd lucius-mcp
-
Install dependencies:
uv sync
🏃 Usage
Add to Claude Code (MCP)
- Add the MCP:
claude mcp add testops-mcp --transport stdio \ --env ALLURE_ENDPOINT=https://your-testops.example \ --env ALLURE_PROJECT_ID=123 \ --env ALLURE_API_TOKEN=your_token \ --env MCP_MODE=stdio \ -- uvx --from lucius-mcp start
Running via Claude Desktop (One-Click Install)
The easiest way to use Lucius in Claude Desktop is via the .mcpb bundle:
- Download the latest
lucius-mcp-x.y.z.mcpbfrom the GitHub Releases. - Open the file with Claude Desktop (macOS or Windows).
- Approve the installation in the dialog.
- Configure your Allure TestOps credentials in the provided fields.
Running via Stdio
For integration with MCP clients (like Claude Code) using standard input/output.
uv run start
Or
MCP_MODE=stdio uv run start
Running via HTTP
Starts the server with hot-reloading enabled (default port: 8000).
MCP_MODE=http uv run start
Or customizing host and port:
HOST=0.0.0.0 PORT=9000 uv run start
Local Workflow Testing (act)
To run GitHub Actions locally using nektos/act:
-
Install
act:brew install act
-
Run a workflow:
# Run a specific workflow (e.g., CI) act -W .github/workflows/pr-quality-gate.yml
Note: The
--artifact-server-pathflag is required to handle artifact uploads/downloads locally. Artifacts will be stored in.artifacts/.
📦 Packaging (MCPB)
Lucius supports the MCP Bundle (MCPB) format for easy distribution.
Building for Claude Desktop
To build a .mcpb bundle locally:
- Install Node.js (v20+ recommended).
- Install the mcpb CLI:
npm install -g @anthropic-ai/mcpb
- Run the build script:
./deployment/scripts/build-mcpb.sh
The versioned bundles will be available in thedist/directory:lucius-mcp-<version>-uv.mcpblucius-mcp-<version>-python.mcpb
Manifests
Bundle manifests live in deployment/mcpb/:
manifest.uv.jsonmanifest.python.json
Validation
Validate each manifest against the code:
python deployment/scripts/validate_mcpb.py uv
python deployment/scripts/validate_mcpb.py python
UV Runtime
The uv bundle uses the uv runtime type, which means:
- Dependencies are defined in
pyproject.tomlanduv.lock. - Claude Desktop will automatically manage the Python environment and dependencies for the user.
- No local Python installation is required for the end-user.
🧪 Testing
Run the test suite using pytest:
uv run pytest
End-to-End (E2E) Tests
E2E tests verify the integration with a real Allure TestOps instance. They are isolated in tests/e2e/ and strictly separated from unit/integration tests.
Prerequisites:
- Sandbox Environment: Access to a non-production Allure TestOps instance.
- Configuration: Create
.env.testfrom.env.test.example:cp .env.test.example .env.test
Running E2E Tests:
# Load environment variables from .env.test
uv run --env-file .env.test pytest tests/e2e/
Troubleshooting E2E Failures:
- 401 Unauthorized: Check
ALLURE_API_TOKEN. It might be expired. - 403 Forbidden: Ensure
ALLURE_PROJECT_IDexists and the user has Write access. - Connection Errors: Verify
ALLURE_ENDPOINTis reachable and uses HTTPS. - Flaky Tests: Tests use unique IDs to avoid collisions, but network issues can occur. Rerunning usually fixes transient issues.
🛠️ Development
Regenerating API Client
To maintain spec-fidelity while keeping the client lightweight, we use a 2-step process:
- Filter Spec:
scripts/filter_openapi.pyreduces the massive OpenAPI spec to only the essential controllers (Test Cases, Shared Steps, Projects). - Generate Client:
openapi-generator-clibuilds the client from the filtered spec.
- Generated Client (
src/client/generated/): Auto-generatedApiClient, API controllers, and Pydantic v2 models. - Client Facade (
src/client/client.py):AllureClientwrapper that handles authentication, error mapping, and helper methods. - Model Facade (
src/client/models/): Re-exports generated models for simplified import paths and logical grouping.
To regenerate the client after updating the spec:
./scripts/generate_testops_api_client.sh
Note: Do not manually edit files in
src/client/generated/.
🧹 Quality Checks
Formatting:
uv run ruff format .
Linting:
uv run ruff check src/
Type Checking:
uv run mypy --strict src/
Release process
- Bump version in
pyproject.toml. - Run
uv sync --all-extrasto update dependencies. - Write release notes in
CHANGELOG.md. - Commit changes.
- Create a tag with the new version.
- Push commits and tags.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lucius_mcp-0.2.2.tar.gz.
File metadata
- Download URL: lucius_mcp-0.2.2.tar.gz
- Upload date:
- Size: 694.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19556de6e0aa95b4ecbfa82e6c129de6f532419e52d3e69dd8a949a1bc1c271e
|
|
| MD5 |
491ace1b2ca77d66b4b90a2359436a8b
|
|
| BLAKE2b-256 |
d446384d8eac7294c6768b574b8f968c05f4b2c5157c447a9f41c7dc2197333a
|
Provenance
The following attestation bundles were made for lucius_mcp-0.2.2.tar.gz:
Publisher:
release.yml on ivanostanin/lucius-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lucius_mcp-0.2.2.tar.gz -
Subject digest:
19556de6e0aa95b4ecbfa82e6c129de6f532419e52d3e69dd8a949a1bc1c271e - Sigstore transparency entry: 872094339
- Sigstore integration time:
-
Permalink:
ivanostanin/lucius-mcp@0d68528eb2243c260487bec1fb647731a5fc0b8c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/ivanostanin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0d68528eb2243c260487bec1fb647731a5fc0b8c -
Trigger Event:
push
-
Statement type:
File details
Details for the file lucius_mcp-0.2.2-py3-none-any.whl.
File metadata
- Download URL: lucius_mcp-0.2.2-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45aa3a7a1f16e914ea368c6c446bbbddf8f7ee538feb75f991b3f4a364b93da2
|
|
| MD5 |
77dc0376db82710781c76960360d3bf3
|
|
| BLAKE2b-256 |
16cf54ec5a382c17c6e90384bb0154abad584dc6e6bd28d7eb99797f4f32b431
|
Provenance
The following attestation bundles were made for lucius_mcp-0.2.2-py3-none-any.whl:
Publisher:
release.yml on ivanostanin/lucius-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lucius_mcp-0.2.2-py3-none-any.whl -
Subject digest:
45aa3a7a1f16e914ea368c6c446bbbddf8f7ee538feb75f991b3f4a364b93da2 - Sigstore transparency entry: 872094340
- Sigstore integration time:
-
Permalink:
ivanostanin/lucius-mcp@0d68528eb2243c260487bec1fb647731a5fc0b8c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/ivanostanin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0d68528eb2243c260487bec1fb647731a5fc0b8c -
Trigger Event:
push
-
Statement type: