Skip to main content

Cognitive Middleware for Architecture-Aware AI Coding Agents

Project description

archai-mcp

PyPI Version Python Versions License

Cognitive Middleware for Architecture-Aware AI Coding Agents.

Overview

ArchAI is a middleware layer that governs how AI coding agents perceive and reason about software systems. It provides architecture-aware context to agents, reducing context pollution and architectural drift.

Installation

# Install from PyPI
pip install archai-mcp

# Or install with uv
uv tool install archai-mcp

After installation, the archai CLI is available globally.

For MCP integration, add uvx archai-mcp mcp to your .opencode/mcp.json (see MCP Integration).

Quick Start

# Install
uv sync

# Process a repository
uv run archai start .

# Ask about the architecture
uv run archai ask "how does the login work"

CLI Commands

Command Description
archai start [repo_path] Process a repository (bootstrap + inference pipeline)
archai ask "query" Ask a question about the architecture
archai mcp Start MCP server (stdio, for agent integration)

Examples

# Process current directory
archai start

# Process another repo
archai start /path/to/repo

# Ask questions
archai ask "how does the orchestrator work"
archai ask "what constraints does the auth module have"

# JSON output for scripting
archai ask "orchestrator" --json | jq '.focus'

Auto-Cache

archai ask automatically runs archai start if no cache exists. You never need to run archai start manually — but can if you want to pre-process.

MCP Integration (Agents)

ArchAI exposes 3 MCP tools for AI agents:

Tool Description
get_architecture_context Get context packet for a query
validate_code_change Validate changes against constraints
get_blast_radius Analyze impact of changing a file

Agent Configuration

// .opencode/mcp.json
{
  "mcpServers": {
    "archai": {
      "command": "uvx",
      "args": ["archai-mcp", "mcp"],
      "description": "Architecture-aware context for AI coding agents"
    }
  }
}

Development

# Run tests
uv run pytest

# Run with coverage
uv run pytest --cov=src --cov-report=html

# Format code
uv run black src/
uv run ruff check src/

Architecture

See docs/002-sdd-cli-mcp-architecture.md for the current architecture spec.

See docs/001-sdd-mvp-architecture.md for the original MVP spec (superseded by 002 for CLI/MCP sections).

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

archai_mcp-0.1.0.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

archai_mcp-0.1.0-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: archai_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for archai_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54cd58f5831396a529dd5d1c37f169d94bcd23851111967aec52a8bc918c4e0d
MD5 28b49442a7079a0d0bc3177c326cbf18
BLAKE2b-256 9b548cf1b08a68e93737d8f1f914ee5446768739158c358fdb585aad721c12f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: archai_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for archai_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1544f7ee276f7e20971bf8bf748d98d5f47774f887667bddc46da757acac853f
MD5 07316e20f60668eb26a8da3b36a804b8
BLAKE2b-256 ea9b760af74d90f12e42d91a11d6527ce8adeb13838f121b3164ed28d8a4a47e

See more details on using hashes here.

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