Skip to main content

MCP server for Python API architecture controls

Project description

arch-mcp

CI PyPI Python 3.11+ License: MIT

MCP server for Python API architecture controls. Validates code against architecture rules and best practices.

Quick Start

Option 1: Hosted (Recommended)

No install needed. Just add to your config:

Claude Code:

claude mcp add arch-controls --url https://arch-mcp.sid.sh/sse

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "arch-controls": {
      "url": "https://arch-mcp.sid.sh/sse"
    }
  }
}

Option 2: Local via uvx

Run locally without installing:

Claude Code:

claude mcp add arch-controls -- uvx arch-mcp

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "arch-controls": {
      "command": "uvx",
      "args": ["arch-mcp"]
    }
  }
}

Option 3: Local Install

pip install arch-mcp

Claude Code:

claude mcp add arch-controls -- arch-mcp

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "arch-controls": {
      "command": "arch-mcp"
    }
  }
}

Tools

Tool Description
tool_list_rules List architecture rules (filter by category/severity)
tool_get_rule Get rule details with code examples
tool_validate_code Validate code against architecture rules
tool_get_project_structure Get recommended folder structure
tool_get_best_practices Get best practices by category
tool_check_architecture Check codebase for layer violations
tool_get_architecture_guide Complete architecture guide

Rule Categories

  • security - Secrets management, SQL injection prevention, input validation
  • data-access - Repository pattern, async database operations
  • error-handling - Custom exceptions, specific exception catches
  • api-design - Pydantic schemas, dependency injection
  • logging - Structured logging, no print statements
  • configuration - Pydantic settings, environment variables
  • testing - Pytest patterns, fixtures

Architecture Patterns

  • clean-architecture - Domain-driven with clear layer separation
  • feature-based - Organized by feature/module
  • simple - Minimal structure for small projects

Example Usage

Once connected, ask your AI assistant:

  • "List all security rules"
  • "Validate this code against architecture rules"
  • "Show me the recommended project structure"
  • "Check if my imports follow clean architecture"

Development

git clone https://github.com/slahiri/arch.mcp.git
cd arch.mcp
pip install -e ".[dev]"

# Run tests
PYTHONPATH=src pytest tests/ -v

# Lint
ruff check src/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arch_mcp-0.1.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arch_mcp-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file arch_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: arch_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arch_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c0d6b1c72fba417af63df64a1df73d40fd674fb91c642968c283116156aded6c
MD5 4ca36665aec7621390c82a5f71e209e4
BLAKE2b-256 c5382bdb3867052beb61357493a9981c084df58571e82a238cccaf1415d7df66

See more details on using hashes here.

Provenance

The following attestation bundles were made for arch_mcp-0.1.0.tar.gz:

Publisher: publish.yml on slahiri/arch.mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arch_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: arch_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arch_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc5469973e52bbb59963a04d0792aace80147b1852739950a6ff614ae763600
MD5 766c9e792783814d0174e06f8b54c3ca
BLAKE2b-256 b7fcfe93527c79d1fe40af7a64c9ce3f3b3e1169654aeff330077d6136889385

See more details on using hashes here.

Provenance

The following attestation bundles were made for arch_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on slahiri/arch.mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page