ArchonMCP: A governance framework server for AI-assisted development
Project description
ArchonMCP: Governance Framework for AI-Assisted Development
ArchonMCP is a Python-based MCP (Model Context Protocol) server that deploys comprehensive governance frameworks for development projects. It provides tools to initialize and manage governance structures including rules, runbooks, and custom prompts designed to work seamlessly with AI-assisted development tools like Cursor, VS Code, and Claude.
๐ฏ Features
- Automatic Stack Detection: Scans your project to identify whether you're using a React-FastAPI-Postgres architecture or a generic tech stack
- One-Command Governance Setup: Deploys complete governance structure with a single tool invocation
- Customizable Templates: Stack-specific governance templates that scale from generic projects to complex full-stack applications
- MCP-Compatible: Runs over stdio for compatibility with all MCP-enabled IDEs
- Cross-Platform: Uses
pathlibfor reliable cross-OS file operations
๐ What Gets Deployed
When you run the init_governance tool, ArchonMCP creates:
.github/
โโโ copilot-instructions.md # High-level governance rules
โโโ skills/
โ โโโ security.md # Security hardening runbook
โ โโโ migration.md # Data migration best practices
โ โโโ done.md # Definition of Done checklist
โโโ prompts/
โโโ gap-analysis.md # /gap-analysis slash command guide
โโโ harden.md # /harden security command guide
โโโ done.md # /done validation command guide
docs/
โโโ stories/
โ โโโ README.md # Feature story documentation
โโโ adr/
โโโ README.md # Architecture Decision Records
๐ Quick Start
Installation
# Clone or download the ArchonMCP repository
cd ArchonMCP
# Install as development package
pip install -e .
# Or install in production with specific version
pip install archon-mcp==0.1.0
CLI Usage (Local Execution)
The fastest way to initialize governance is using the CLI locally:
# Initialize governance (auto-detect stack)
archon-mcp init
# Initialize governance in a specific directory
archon-mcp init --root /path/to/project
# Initialize with a specific stack
archon-mcp init --stack React-FastAPI-Postgres
# or
archon-mcp init --stack Generic
# Verbose output with all files listed
archon-mcp init --verbose
# Detect stack without initializing
archon-mcp detect
archon-mcp detect --root /path/to/project
CLI Examples
# Full-stack project in current directory with verbose output
archon-mcp init -v
# Generic project in custom location
archon-mcp init --root ~/projects/my-app --stack Generic --verbose
# Just detect the tech stack
archon-mcp detect
MCP Server Usage (IDE Integration)
Run as an MCP server for integration with AI IDEs:
# Start the MCP server
archon-mcp server
# In VS Code with Cline:
# - Copy the archon-mcp command path
# - Configure in settings as an MCP server
# - Use with AI assistant chat interface
๐๏ธ Architecture
Dual-Mode Operation
ArchonMCP operates in two modes:
1. CLI Mode (Local Execution)
- Direct command-line interface for immediate governance setup
- Fast local execution without server overhead
- Perfect for CI/CD pipelines and scripting
- Commands:
init,detect,server
archon-mcp init --stack React-FastAPI-Postgres
2. MCP Server Mode (IDE Integration)
- Runs as stdio-based MCP server
- Integrates with Cursor, VS Code (Cline), Claude
- Enables AI-assisted governance workflow
- Tools available through AI chat interface
archon-mcp server
Core Components
1. CLI Interface (Click-based)
Command structure:
archon-mcp init: Initialize governance frameworkarchon-mcp detect: Analyze project tech stackarchon-mcp server: Start MCP serverarchon-mcp --version: Show versionarchon-mcp --help: Show help
2. Stack Detection
The detect_tech_stack() function analyzes your project directory for:
- React: package.json, tsconfig.json, .tsx/.jsx files
- FastAPI: requirements.txt, pyproject.toml, main.py/app.py
- PostgreSQL: docker-compose.yml, migrations, Dockerfile
Classification:
- React-FastAPI-Postgres: All three stacks detected (recommended profile)
- Generic: Fallback for other or mixed stacks
2. Template Engine
Dictionary-based template system with stack-aware content:
GOVERNANCE_TEMPLATES = {
"copilot_instructions": {
"React-FastAPI-Postgres": "...",
"Generic": "..."
},
# ... more templates
}
3. MCP Tool: init_governance
Single async tool that:
- Accepts optional
root_directoryandstackparameters - Auto-detects stack if not specified
- Creates directory structure
- Deploys stack-specific templates
- Returns structured results with file listings and errors
๐ Governance Templates
.github/copilot-instructions.md
High-level governance rules for AI assistants:
- Project context and tech stack specifics
- Code quality standards per language/framework
- Governance artifact locations
- Pull request review checklist
React-FastAPI-Postgres Profile: Specific guidance for TypeScript, Python, and SQL Generic Profile: Language-agnostic governance rules
Skills (.github/skills/)
security.md - Security Runbook
Structured approach to implementing security:
- Frontend security (CORS, input sanitization, session management)
- Backend security (authentication, rate limiting, input validation)
- Database security (RBAC, encryption, row-level security)
- Verification checklist
migration.md - Migration Runbook
Data migration and schema change procedures:
- Pre-migration planning and backups
- Schema preparation with reversible patterns
- Data migration with transaction management
- Post-migration validation
done.md - Definition of Done
Completion criteria for features and tasks:
- Code quality requirements (tests, linting, coverage)
- Documentation standards
- Testing requirements
- Security and accessibility
- Deployment readiness
Prompts (.github/prompts/)
Custom slash commands for AI assistants to use in chat:
/gap-analysis
Analyzes gaps between current implementation and best practices:
- Code quality assessment
- Security opportunities
- Performance optimization suggestions
- Refactoring recommendations
/harden
Security hardening guidance:
- Vulnerability assessment
- Prioritized remediation steps
- Security control code examples
- Testing strategies
/done
Work completion validation:
- Checks Definition of Done criteria
- Generates verification checklist
- Identifies blockers
- Provides improvement recommendations
Documentation Templates (.docs/)
/docs/stories/
Feature documentation directory for:
- User stories with acceptance criteria
- Feature specifications
- Requirements documentation
/docs/adr/
Architecture Decision Records for:
- Significant technical decisions
- Decision context and rationale
- Consequences (positive and negative)
- Alternative approaches considered
๐ง Configuration & Usage
CLI Commands
archon-mcp init
Initialize governance framework locally.
Options:
-r, --root PATH Project root directory (default: current directory)
-s, --stack STACK Technology stack (React-FastAPI-Postgres or Generic)
-v, --verbose Show detailed file listings
--help Show help message
Example:
archon-mcp init --root /path/to/project --stack React-FastAPI-Postgres --verbose
archon-mcp detect
Analyze and report project tech stack.
Options:
-r, --root PATH Project root directory (default: current directory)
--help Show help message
Example:
archon-mcp detect --root ~/my-project
archon-mcp server
Start MCP server for IDE integration.
Example:
archon-mcp server
MCP Server Configuration
MCP Server Configuration
When running as archon-mcp server, the MCP tool init_governance is available.
Cursor Integration
Add to .cursor/rules.md:
# ArchonMCP Governance
Use the init_governance tool to set up project governance frameworks.
Or configure via Cursor settings:
{
"mcpServers": {
"archon-mcp": {
"command": "archon-mcp",
"args": ["server"]
}
}
}
VS Code with Cline
Configure in VS Code settings:
{
"cline.mcpServers": {
"archon-mcp": {
"command": "archon-mcp",
"args": ["server"]
}
}
}
Or in workspace settings (.vscode/settings.json):
{
"cline.mcpServers": {
"archon-mcp": {
"command": "python",
"args": ["-m", "archon_mcp", "server"]
}
}
}
Claude.com (MCP Client)
Use any MCP-compatible client that runs stdio servers:
archon-mcp server
Tool Parameters
init_governance(root_directory, stack)
| Parameter | Type | Required | Default | Values |
|---|---|---|---|---|
root_directory |
string | No | Current directory | Any valid absolute path |
stack |
string | No | Auto-detect | React-FastAPI-Postgres, Generic |
Response Structure
{
"stack": "React-FastAPI-Postgres",
"created_files": [list of file paths],
"created_dirs": [list of directory paths],
"errors": [any error messages]
}
๐ Examples
Example 1: Quick Local Setup (CLI)
# Navigate to your project
cd ~/my-react-fastapi-project
# Run governance initialization
archon-mcp init
# Output:
# ==================================================
# ArchonMCP Governance Initialization
# ==================================================
#
# โน Scanning project for tech stack indicators...
# โ Detected stack: React-FastAPI-Postgres
# โน Creating governance structure...
# โ Governance framework initialized successfully!
Example 2: Verbose Setup with Custom Directory
archon-mcp init --root ~/projects/my-app --verbose
# Shows:
# - All created directories
# - All created files with paths
# - Detailed next steps
Example 3: Detect Stack Before Setup
# First, analyze what stack the project is
archon-mcp detect --root ~/my-project
# Output:
# Project Root: /Users/dev/my-project
# Detected Stack: React-FastAPI-Postgres
# Indicators found:
# โ React/TypeScript frontend
# โ FastAPI backend
# โ PostgreSQL database
Example 4: Generic Stack Initialization
# For non-standard stacks
archon-mcp init --root ~/my-python-project --stack Generic
# Creates governance framework with generic templates
Example 5: MCP Server Integration
# Terminal 1: Start the MCP server
archon-mcp server
# Terminal 2: Use with AI IDE (Cline/VS Code)
# Chat: "Use init_governance to set up governance for /path/to/project"
# Result: Server processes command via MCP interface
Example 6: CI/CD Pipeline
#!/bin/bash
# .github/workflows/setup-governance.yml
- name: Initialize Governance
run: |
pip install archon-mcp
archon-mcp init --stack React-FastAPI-Postgres
git add .github/ docs/
git commit -m "chore: initialize governance framework"
๏ฟฝ Publishing Releases
GitHub Actions Workflow (Automated)
The repository includes an automated GitHub Actions workflow for building and publishing packages to TestPyPI and PyPI.
Setup
-
Add Repository Secrets:
- Go to repo Settings โ Secrets and variables โ Actions
- Add
TEST_PYPI_API_TOKEN: Your TestPyPI API token - (Optional) Add
PYPI_API_TOKEN: Your PyPI API token for production releases
-
Trigger Publish Workflows:
Option A: Tag-based Release (recommended)
git tag v0.1.1 git push origin v0.1.1 # Workflow triggers automatically, publishes to TestPyPI + (optionally) PyPI
Option B: Manual Dispatch
- Go to Actions โ "Publish Python Package" โ "Run workflow"
- Select target:
testpypi,pypi, orboth - Click "Run workflow"
Workflow Details
- Builds: Creates wheel + sdist once, reused for all deployments
- TestPyPI: Always publishes on tag push or manual run with
testpypi/both - PyPI: Publishes only if
PYPI_API_TOKENsecret exists - Environments: Uses GitHub Environments for security approval prompts
Local Publishing (Manual)
For local testing or publishing without GitHub Actions, use the provided deploy scripts:
# Windows
.\deploy.bat
# Select option: 3 (TestPyPI), 4 (PyPI), or 5 (Full cycle)
# Unix/macOS
./deploy.sh
# Select option: 3 (TestPyPI), 4 (PyPI), or 5 (Full cycle)
Requirements:
python -m buildinstalledtwineinstalled (auto-installed by deploy script)- Valid
.pypircor environment credentials for TestPyPI/PyPI
๏ฟฝ๐ ๏ธ Development Setup
Prerequisites
- Python 3.10+
- pip or uv package manager
Install Development Environment
# Clone repository
git clone <repository-url>
cd ArchonMCP
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install with development dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
# Format code
black archon_mcp.py
# Lint
ruff check archon_mcp.py
# Type check
mypy archon_mcp.py
Project Structure
ArchonMCP/
โโโ archon_mcp.py # Main server implementation
โโโ pyproject.toml # Project configuration
โโโ README.md # This file
โโโ tests/ # Unit tests (future)
โโโ docs/ # Additional documentation (future)
๐งช Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=archon_mcp
# Run specific test
pytest tests/test_stack_detection.py -v
๐ Security Considerations
- Template Content: All governance templates are example-based; customize them for your project
- File Permissions: Ensure proper file permissions on governance files post-deployment
- Credentials: Never store credentials in governance files; use secrets management
- Review Process: Have security team review governance templates before deployment
๐ฆ Dependencies
Core
- fastmcp โฅ0.1.0: MCP server implementation
Development
- pytest โฅ7.0: Testing framework
- pytest-asyncio โฅ0.21.0: Async test support
- black โฅ23.0: Code formatter
- ruff โฅ0.1.0: Linter
- mypy โฅ1.0: Type checker
๐ค Contributing
Contributions welcome! Areas for expansion:
- Additional tech stack profiles (Django-React, Next.js, etc.)
- Enhanced template customization
- Governance validation tools
- CI/CD integration examples
- IDE-specific plugins
Please ensure:
- Code follows
blackandruffstandards - All changes include type hints
- New features have test coverage
- Governance templates are validated for each stack
๐ License
MIT License - See LICENSE file for details
๐ Troubleshooting
CLI Issues
Issue: "archon-mcp: command not found"
Solution:
- Ensure package is installed:
pip install -e .orpip install archon-mcp - Check it's in PATH:
which archon-mcp(Unix) orwhere archon-mcp(Windows) - Try running as module:
python -m archon_mcp init
Issue: "Permission denied" when initializing
Solution:
- Ensure target directory is writable:
ls -ld /path/to/project - Run with appropriate permissions or use a writable directory
- Try with
--rootpointing to a temp directory first
Issue: "Stack detection returns Generic"
Solution: Ensure key indicator files are present:
- React:
package.jsonor.tsxfiles - FastAPI:
requirements.txtorpyproject.toml - PostgreSQL:
docker-compose.ymlormigrations/directory
Force stack detection with:
archon-mcp init --stack React-FastAPI-Postgres
MCP Server Issues
Issue: "MCP server not connecting"
Solution:
- Verify
archon-mcpcommand is in PATH:which archon-mcp - Test server startup:
archon-mcp server(should show "Ready to accept MCP connections") - Check IDE MCP configuration points to correct command
- Ensure firewall isn't blocking stdio
Issue: "Tool not appearing in AI chat"
Solution:
- Restart the MCP server:
archon-mcp server - Reload IDE window (VS Code: Cmd+Shift+P โ Developer: Reload Window)
- Check MCP server configuration in IDE settings
General Issues
Issue: "Governance templates don't match my project"
Solution: Post-deployment, edit files in .github/, docs/stories/, and docs/adr/ to match your project's needs
๐บ๏ธ Roadmap
- v0.2.0: Add governance validation and audit tools
- v0.3.0: Support additional stacks (Django, Next.js, Spring Boot)
- v0.4.0: Custom template loading from configuration files
- v0.5.0: GitHub Actions integration for governance checks
- v1.0.0: Stable release with comprehensive documentation
๐ Related Resources
๐ฌ Support
For issues, questions, or suggestions:
- Check existing documentation and examples
- Review troubleshooting section
- Open an issue with detailed reproduction steps
- For security issues, please report privately
Made with โค๏ธ for AI-assisted development teams
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 archon_mcp-0.1.5.tar.gz.
File metadata
- Download URL: archon_mcp-0.1.5.tar.gz
- Upload date:
- Size: 36.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84b531964a0c36a46eab41ba3e3e80f125f1eafc5fb6eadb48cde7d9d82eb4af
|
|
| MD5 |
29447fa7c6fd7850a9f8ea72057ec1e1
|
|
| BLAKE2b-256 |
6b4a4bb81c11fe21734e4862f274111239a31cc32c719d24c8283210cd1774d6
|
Provenance
The following attestation bundles were made for archon_mcp-0.1.5.tar.gz:
Publisher:
publish-python-package.yml on ShanKonduru/ArchonMCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archon_mcp-0.1.5.tar.gz -
Subject digest:
84b531964a0c36a46eab41ba3e3e80f125f1eafc5fb6eadb48cde7d9d82eb4af - Sigstore transparency entry: 1388072067
- Sigstore integration time:
-
Permalink:
ShanKonduru/ArchonMCP@0bd6a5a3778ce4102e62107869e6840aabea2473 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ShanKonduru
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@0bd6a5a3778ce4102e62107869e6840aabea2473 -
Trigger Event:
push
-
Statement type:
File details
Details for the file archon_mcp-0.1.5-py3-none-any.whl.
File metadata
- Download URL: archon_mcp-0.1.5-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a037ce518410408e9ec5b73a4ea32c5e924d08d3d6818afb275e4a9f4f915ded
|
|
| MD5 |
9f8fbcbba9498362d7c550c3311cd6bf
|
|
| BLAKE2b-256 |
01dcd0c77dd12329880ea3292c77813a33267faaeca6178813062d6ce40aa490
|
Provenance
The following attestation bundles were made for archon_mcp-0.1.5-py3-none-any.whl:
Publisher:
publish-python-package.yml on ShanKonduru/ArchonMCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
archon_mcp-0.1.5-py3-none-any.whl -
Subject digest:
a037ce518410408e9ec5b73a4ea32c5e924d08d3d6818afb275e4a9f4f915ded - Sigstore transparency entry: 1388072162
- Sigstore integration time:
-
Permalink:
ShanKonduru/ArchonMCP@0bd6a5a3778ce4102e62107869e6840aabea2473 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ShanKonduru
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@0bd6a5a3778ce4102e62107869e6840aabea2473 -
Trigger Event:
push
-
Statement type: