Skip to content

About

Local-first repository analyzer that generates portable AI agent manifests, tools, permissions, and MCP definitions from any codebase: read-only inspection, zero execution risks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repo2Agent Architecture

Repo2Agent

Italiano • Architecture • Contributing • Security

CI License Zero Runtime Dependencies Core LOC

Turn any codebase into a portable AI agent manifest, permission boundary, and Model Context Protocol (MCP) tool suite.

Autonomous coding agents (Cursor, Claude Code, Antigravity, Devin) often lack explicit boundaries on how to use a repository: they guess test commands, risk modifying .env secrets, or trigger unintended deployments.

Repo2Agent solves this by analyzing your repository read-only, without executing scripts, and compiling a structured manifest (agent-manifest.json), an AGENT.md human guide, and MCP tool schemas.


🚀 Quick start​‌​​‌‌​‌​‌​‌​​‌​​‌​​‌​‌​​​‌‌‌​​‌​​‌‌​​​‌​​‌​‌‌​‌​‌‌‌​​‌​​​‌‌​​‌​​‌‌​​​​‌​​‌​‌‌​‌​​‌‌‌​​​​‌‌​​​‌‌​​‌‌​​‌‌​‌‌​​​‌​​​‌‌​​‌​​​‌‌​​​‌

Run without installing via npx:

# 1. Inspect repository and print a concise safety summary
npx repo2agent analyze .

# 2. Run an Agent Readiness Audit (score 0-100 & actionable recommendations)
npx repo2agent audit .

# 3. Export canonical agent manifest or MCP tools
npx repo2agent analyze . --format json --out agent-manifest.json
npx repo2agent analyze . --format mcp --out mcp-tools.json

# 4. Generate Claude Desktop / Cursor MCP configuration
npx repo2agent analyze . --format mcp-server --out .cursor/mcp.json

# 5. Automatically initialize agent-manifest.json and AGENT.md in your repo
npx repo2agent init .

✨ Features

  • 🛡️ Strict Read-Only Sandbox: Analyzes codebases through static traversal and file parsing (AST/regex). Never executes untrusted repository code.
  • 🛠️ Multi-Ecosystem Discovery: Autodetects Node.js/TypeScript (package.json), Python (pyproject.toml, pytest), Rust (Cargo.toml), Go (go.mod), Makefile, and Dockerfile.
  • ⚖️ Risk & Command Classification: Categorizes commands into safe read-only tasks (test, lint, typecheck) versus mutating tasks (build, clean) and dangerous actions (publish, deploy).
  • 🛑 Protected Deny Boundaries: Explicitly prohibits agents from accessing or modifying .git/**, .env, keys (*.pem, *.key), and credentials.
  • 🔒 Safe Tool Invoker (repo2agent run): Supervised execution sandbox enforcing timeouts, human confirmation gates, and blocking argument-based protected path access.
  • 🔄 Smart Manifest Sync (repo2agent sync): Updates discovered tools while preserving manual human customizations and custom risk rules.
  • ⚡ Model Context Protocol (MCP): Generates ready-to-use MCP tool definitions with typed JSON Schemas for integration with Claude, Cursor, and custom agent servers.
  • 🔍 Validation & Diff Engine: Validate manifest compliance or diff an existing manifest against live repository state to detect permission drift.
  • ⚡ Zero External Runtime Dependencies: Pure Node.js built-ins. Core engine strictly under 1,500 lines of code.

📊 Discovered Tool Categories

Category Typical Commands Default Risk Requires Confirmation
test npm test, pytest, cargo test Safe No
typecheck tsc --noEmit, mypy, cargo check Safe No
lint eslint, ruff check, cargo clippy Safe No
build npm run build, make build Low No
clean npm run clean, rm -rf dist Medium Yes
deploy / publish npm publish, serverless deploy High Yes (Prompt)

💻 CLI Reference

USAGE:
  repo2agent analyze [path] [options]
  repo2agent audit [path] [options]
  repo2agent init [path]
  repo2agent validate <file>
  repo2agent diff <old-manifest> <new-manifest-or-repo>

COMMANDS:
  analyze, scan   Inspect a repository and generate agent manifest or MCP tools
  audit, check    Evaluate repository agent-readiness and security posture
  init            Inspect repository and write agent-manifest.json and AGENT.md
  validate        Verify schema compliance and security boundaries of a manifest
  diff            Compare two manifests to detect tool or permission changes

OPTIONS:
  -f, --format    Output format: summary, json, markdown, mcp, mcp-server, audit
  -o, --out       Write output directly to specified file
  --strict        Fail on warnings or low readiness score
  --min-score     Minimum score for audit pass in CI (default: 70)
  -v, --version   Display version
  -h, --help      Display help

💖 Support the project / Donazioni

If Repo2Agent saves you debugging time or helps secure your AI coding workflows, consider supporting development:


📄 License & Attribution

Distributed under the Apache License, Version 2.0.
See LICENSE and NOTICE for full terms.
Copyright (c) 2026 Manoj Rollo (MRJonam91).

About

Local-first repository analyzer that generates portable AI agent manifests, tools, permissions, and MCP definitions from any codebase: read-only inspection, zero execution risks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages