-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Component Spec: aces-governance-mcp
Purpose
An MCP server that acts as an active governance agent for the ACES
project. Every Claude Code instance working on any ACES repo can query
project standards, validate compliance, and route ADR proposals back to
the governance repo — without manually navigating to or reading from the
governance repo.
Who it serves: Any coding agent (or human with Claude Code) working
in any ACES repository.
Problem it solves: Governance knowledge (ADRs, STANDARDS.md,
ARCHITECTURE.md, templates) lives in the governance repo. Agents working
in other repos have no reliable way to access it. This causes convention
violations, duplicated effort, and standards drift. The MCP server makes
governance a live participant in every development session.
Interface
Reference Tools (read-only)
| Tool | Parameters | Returns |
|---|---|---|
list_adrs() |
— | All ADRs with numbers, titles, status |
get_adr(identifier) |
ADR number or keyword | Full ADR content, or search results |
get_standard(section) |
Section number or keyword | Matching STANDARDS.md section |
get_architecture(section) |
Section name or keyword | Matching ARCHITECTURE.md section |
search_governance(query) |
Search term | Matching excerpts with file locations |
get_template(name) |
Template filename or "list" |
Template content or listing |
Validation Tools (checks)
| Tool | Parameters | Returns |
|---|---|---|
check_repo_compliance(repo_path, repo_type) |
Absolute path, rust/python/governance |
Compliance report: passes and violations |
check_dependency_direction(repo_name, dependencies) |
ACES repo name, list of dep names | Validation result against architecture DAG |
check_repo_compliance checks:
- Required files exist per repo type (LICENSE, CHANGELOG.md, CLAUDE.md,
.markdownlint.yaml, .pre-commit-config.yaml, CI workflow, plus
type-specific files) - Repo naming convention (starts with
aces-) - Rust: Apache-2.0 in Cargo.toml,
deny(missing_docs)in lib.rs - Python: mypy strict in pyproject.toml, Apache-2.0 license
- Template drift: compare governed files against governance templates
check_dependency_direction checks:
- Dependencies respect the tier system from ARCHITECTURE.md
- No tier-N repo depends on a tier >N repo
Governance Action Tools
| Tool | Parameters | Returns |
|---|---|---|
propose_adr(title, context, decision) |
Title string, context paragraphs, decision sketch | URL of created GitHub issue |
Creates a GitHub issue on aces-framework/aces with the governance
label, formatted as an ADR proposal for discussion. Uses the gh CLI
(must be authenticated).
MCP Resources
| URI | Content |
|---|---|
aces://standards |
Full STANDARDS.md |
aces://architecture |
Full ARCHITECTURE.md |
aces://adrs |
ADR index (all titles and status) |
Scope
In scope:
- Read-only reference to all governance documents
- Structural compliance validation (file existence, naming, config)
- Template drift detection
- Dependency direction validation against architecture DAG
- ADR proposal creation via GitHub issues
- Stdio transport (Claude Code spawns it, no daemon)
Explicitly out of scope:
- Code generation or automated fixes (the server reports, it doesn't
patch) - Runtime policy enforcement (e.g., OPA-style request authorization)
- Modifying governance documents (read-only except for issue creation)
- Network-based transport (stdio only for now)
- Non-ACES repos (assumes ACES conventions)
Location and Structure
Lives in the governance repo at tools/governance-mcp/.
tools/governance-mcp/
pyproject.toml # scaffolded by uv init, deps via uv add
src/
aces_governance_mcp/
__init__.py
server.py # FastMCP server, tool definitions
tests/
test_reference.py # tests for reference tools
test_validation.py # tests for validation tools
test_governance.py # tests for governance action tools
Dependencies
mcp(Python MCP SDK — providesFastMCP)ghCLI (forpropose_adr, not a Python dependency)- Local clone of the governance repo (path via
ACES_GOVERNANCE_REPO
env var, defaults to repo root relative to package location)
Configuration
User adds to ~/.claude/settings.json (global, all ACES repos):
{
"mcpServers": {
"aces-governance": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/aces/tools/governance-mcp",
"aces-governance-mcp"
]
}
}
}The server resolves the governance repo root from its own install
location. The ACES_GOVERNANCE_REPO env var overrides this if the
server is installed elsewhere.
Verification
Unit tests (TDD — written before implementation):
-
test_reference.py:list_adrsreturns all ADRs with correct formatget_adrby number returns correct ADRget_adrby keyword returns matching ADRsget_adrwith no match returns informative messageget_standardby section number returns correct sectionget_standardby keyword searches title and bodyget_architecturereturns matching sectionssearch_governancefinds matches across multiple filessearch_governancewith no results returns informative messageget_templateby exact name returns contentget_template("list")returns all template names
-
test_validation.py:check_repo_complianceon a fully compliant repo returns all passescheck_repo_complianceon a repo missing LICENSE reports failurecheck_repo_compliancedetects missing type-specific filescheck_repo_compliancedetects template driftcheck_repo_compliancechecks Rust-specific rules (license,
missing_docs)check_repo_compliancechecks Python-specific rules (mypy strict)check_dependency_directionaccepts valid dependenciescheck_dependency_directionrejects upward tier dependenciescheck_dependency_directionignores non-ACES dependencies
-
test_governance.py:propose_adrcallsgh issue createwith correct argumentspropose_adrreturns issue URL on successpropose_adrreturns error message whenghis not installedpropose_adrreturns error message onghfailure
Integration test:
- Start the MCP server, send tool calls via MCP protocol, verify
responses (can be a smoke test in CI).
Conventions
- Python, following ACES standards (ruff, mypy --strict, Google-style
docstrings, uv for deps) - Scaffolded with
uv init, dependencies added withuv add - Virtual environment in
.venv/ - TDD: tests written before implementation
Open Questions
- Should validation tools also check CI workflow content (not just
existence)? Or is that overreach for v0.1? - Should
propose_adrauto-detect the next ADR number, or leave
numbering to the human reviewing the issue? - Should there be a
check_standards_update_needed(lesson)tool that
helps agents identify when a lesson learned should be promoted to a
formal standard?