Italiano • Architecture • Contributing • Security
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 .- 🛡️ 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, andDockerfile. - ⚖️ 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.
| 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) |
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
If Repo2Agent saves you debugging time or helps secure your AI coding workflows, consider supporting development:
- GitHub Sponsors: sponsor MRJonam91
- Ko-fi: ko-fi.com/mrjonam
- Buy Me a Coffee: buymeacoffee.com/mrjonam
- PayPal: paypal.me/manorollo
Distributed under the Apache License, Version 2.0.
See LICENSE and NOTICE for full terms.
Copyright (c) 2026 Manoj Rollo (MRJonam91).