Skip to main content

Repo-aware directive generator with optional MCP server

Project description

OpenAgentMCP

Repo-aware directive generator with optional MCP server.

Reads your repository's actual state — file tree, current phase, test floor — and generates structured directives for AI coding agents. Built on a two-stage pipeline: cheap model assesses the repo, capable model writes the directive.

Install

pip install openagent-directive          # CLI only
pip install openagent-directive[mcp]     # CLI + MCP server

Usage

# Generate a directive
openagent analyze /path/to/repo --intent "add pagination to the API"

# Start MCP server for Claude Desktop
openagent serve

# Start persistent SSE service (for NSSM)
openagent serve --transport sse --port 8008

How it works

  1. Scanner reads the file tree and supporting docs (pure stdlib, no side effects)
  2. Assessor calls a cheap model to assess repo state → AssessmentResult
  3. Writer calls a capable model to generate the directive
  4. StateWriter writes docs/state/current.md atomically

Model routing

By default routes to OpenRouter. Point at your own router via env var:

OPENAGENT_BASE_URL=http://localhost:8005/v1  # RFD_Model_Router or compatible
OPENROUTER_API_KEY=your_key                  # not needed for local routing

MCP tools

When running as MCP server, two tools are available:

  • analyze_repo(repo_path, intent) — full pipeline, writes state
  • assess_repo(repo_path) — scan + assess only, read-only

Claude Desktop config

{
  "mcpServers": {
    "openagent": {
      "command": "uv",
      "args": ["run", "--with", "openagent-directive[mcp]", "openagent", "serve"],
      "cwd": "/path/to/OpenAgentMCP"
    }
  }
}

Architecture

Scanner (stdlib) → Assessor (cheap model) → Writer (capable model)
                                          → ScopeGuard (pure logic)
                                          → StateWriter (stdlib)

Two-stage routing: cheap model for repo assessment, capable model for directive generation. Both configurable via OPENAGENT_CHEAP_MODEL and OPENAGENT_CAPABLE_MODEL.

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

openagent_directive-0.3.0.tar.gz (106.1 kB view details)

Uploaded Source

Built Distribution

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

openagent_directive-0.3.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file openagent_directive-0.3.0.tar.gz.

File metadata

  • Download URL: openagent_directive-0.3.0.tar.gz
  • Upload date:
  • Size: 106.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for openagent_directive-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5d3b32359ef7bc3fe6bb5b0d09a7601f016b6aac1c718a84204906e3ec6ac64c
MD5 24fb3f03e4b0718b37cfad61ab116400
BLAKE2b-256 fb790e1299dfbe4e78ac49d59dad3948eb49fed3e586d2940ce1650e54855486

See more details on using hashes here.

File details

Details for the file openagent_directive-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openagent_directive-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfa6e3841618edb8a71d9056f778b7c693e2318bada9f7cd275b53451d3d690e
MD5 866958258d28e80a62b17e8493416d22
BLAKE2b-256 c3a20e607212a7ef3306476120845a2690b93c5ac5fd0e7c64c778c380f969b2

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