Add Model Context Protocol (MCP) server for Allure Docker Service - #292
Open
matanbaruch wants to merge 2 commits into
Open
Add Model Context Protocol (MCP) server for Allure Docker Service#292matanbaruch wants to merge 2 commits into
matanbaruch wants to merge 2 commits into
Conversation
Adds a self-contained `allure-docker-mcp/` package that exposes a running allure-docker-service instance as MCP tools, so LLM agents (Claude Desktop, Claude Code, any MCP host) can manage projects, send results, and generate/export Allure reports through natural-language tool calls. The server is a client of the existing REST API — it does not modify the service. Highlights: - 16 tools, one per REST endpoint (version, config, projects CRUD + search, send-results, generate-report, latest-report, clean-results/history, export report/emailable, render emailable). - Transparent support for the optional security mode: JWT cookie login + X-CSRF-TOKEN on mutating requests, with a single 401 re-auth retry. - stdio, streamable-http, and sse transports; Dockerfile; pyproject; tests. Hardening (from review + live testing against a real instance): - Export tools confine writes to ALLURE_OUTPUT_DIR and reject path escapes. - send_results_from_directory skips symlinks. - Tool bodies run off the event loop (anyio.to_thread) so HTTP transports stay responsive; client auth is guarded by a lock for concurrent callers. - main() applies FASTMCP_HOST/FASTMCP_PORT to the live settings (FastMCP otherwise ignores them, so streamable-http never bound the requested port). - request_json fails loudly when ALLURE_ENDPOINT points at the web UI. Closes fescobar#291 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds .github/workflows/allure-mcp.yml so the MCP server image is published alongside the service: - pull requests touching allure-docker-mcp/ -> build only (validation); - push to master/main (e.g. when this is merged) -> publish :edge; - release tags v* -> publish <version> + :latest. Publishing reuses the repo's existing DOCKER_HUB_USER / DOCKER_HUB_PASS and is guarded to the upstream repository, so it never runs from a fork. Documents the prebuilt frankescobar/allure-docker-mcp image in the package README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Model Context Protocol (MCP) server (
allure-docker-mcp/) that exposes a runningallure-docker-serviceinstance as tools an LLM agent can call — from Claude Desktop, Claude Code, or any MCP host. It lets an assistant manage projects, send results, and generate/export Allure reports through natural language, e.g.:The server is a client of the existing REST API — it does not modify the service.
Closes #291
What's included
get_version,get_config,list_projects,get_project,search_projects,create_project,delete_project,send_results,send_results_from_directory,generate_report,get_latest_report,clean_results,clean_history,export_report,export_emailable_report,render_emailable_report.X-CSRF-TOKENon mutating requests, with a single 401 re-auth retry.Dockerfile;pyproject.toml;.env.example.Design / hardening notes
A few items came out of review + testing against a real instance:
export_*tools write only insideALLURE_OUTPUT_DIRand reject path escapes (no arbitrary-file overwrite from an agent-chosen path).send_results_from_directoryso it can't be pointed at a symlink resolving outside the directory.anyio.to_thread) so the HTTP transports stay responsive; client auth is lock-guarded for concurrent callers.main()appliesFASTMCP_HOST/FASTMCP_PORTto the live settings (FastMCP otherwise ignores them, sostreamable-httpnever bound the requested port). Verified the server now binds the requested host/port.ALLURE_ENDPOINTpoints at the web UI instead of the API base, tools return an actionable error instead of opaque HTML.Testing
pytest— 24 tests pass (client auth/CSRF/401-retry, endpoint mapping, path confinement, symlink skip, transport config).frankescobar/allure-docker-service(v2.38.1), driven through the real MCP tool dispatch:SECURITY_ENABLED=1): same lifecycle, exercising login + CSRF.streamable-httpreal bind test on a non-default port.Notes for maintainers
allure-docker-mcp/directory; no changes toallure-docker-apior the image.stdiohas no network surface.🤖 Generated with Claude Code