Mcp server to create agents-md efficiently
- ✓Open-source license (MIT)
- ✓Recently active
- ✓Clear description
claude mcp add agents-md-generator -- uvx agents-md-generator{
"mcpServers": {
"agents-md-generator": {
"command": "uvx",
"args": ["agents-md-generator"]
}
}
}MCP Servers overview
<!-- mcp-name: io.github.nushey/agents-md-generator -->
# agents-md-generator
MCP server that analyzes codebases with [tree-sitter](https://tree-sitter.github.io/) and generates [`AGENTS.md`](https://agents.md/) files.
Compatible with any MCP-capable client: Claude Code, Gemini CLI, Cursor, Windsurf, and others.
**How it works:** The server exposes three tools with a clear separation of concerns. `generate_agents_md` is the main entry point — it runs the analysis pipeline internally, embeds writing rules into the payload, and returns chunked read instructions to your client. `scan_codebase` is a standalone context tool for when you want deep codebase understanding without generating any file. `read_payload_chunk` streams the payload back in chunks regardless of which tool produced it. No large data travels over the MCP wire.
## Supported Languages
Python · C# · TypeScript · JavaScript · Go
---
## Installation
See [INSTALLATION.md](https://github.com/nushey/agents-md-generator/blob/main/INSTALLATION.md) for the full guide including prerequisites and troubleshooting.
**Requirements:** Python 3.11+, Git, and any MCP-compatible client.
### Option A — pip install + setup wizard (recommended)
```bash
pip install agents-md-generator
agents-md-generator setup
```
The setup wizard detects your installed clients, asks whether to configure globally or per-project, and patches the config files automatically. Supports Claude Code, Gemini CLI, Cursor, Windsurf, and Codex CLI.
### Option B — uvx (no install needed)
If you have [uv](https://github.com/astral-sh/uv) installed, `uvx` runs the package without a prior install step. Add the entry manually to your client's MCP config:
```json
{
"mcpServers": {
"agents-md": {
"command": "uvx",
"args": ["agents-md-generator"]
}
}
}
```
For Claude Code specifically:
```bash
claude mcp add agents-md uvx agents-md-generator
```
---
## Usage
Once registered, ask your AI client:
> "Generate the AGENTS.md for this project"
The client will call `generate_agents_md` automatically. To scan a different directory:
> "Generate the AGENTS.md for the project at /path/to/project"
### Tools
| Tool | Purpose |
|------|---------|
| `generate_agents_md` | Main entry point. Runs the pipeline internally, embeds writing rules into the payload, and returns chunked read instructions. Use this to create or update `AGENTS.md`. |
| `scan_codebase` | Standalone context tool. Analyzes the codebase and returns a pure data payload with no `AGENTS.md` mandate. Use this when you need architectural context for any other task. |
| `read_payload_chunk` | Streams the payload written by either tool in chunks until `has_more` is false. |
### Tool Parameters
**`generate_agents_md`**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `project_path` | string | `"."` | Path to the project root |
**`scan_codebase`**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `project_path` | string | `"."` | Path to the project root |
| `force_full_scan` | boolean | `true` | Ignore cache and rescan everything. Defaults to `true` — direct calls always perform a full scan. |
**`read_payload_chunk`**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `project_path` | string | `"."` | Must match the path used in the preceding tool call |
| `chunk_index` | integer | — | Zero-based chunk index. Increment until `has_more` is false |
---
## What Gets Generated
The generated `AGENTS.md` follows the [agents.md](https://agents.md/) open standard. It is written as a **README for AI agents**, not as documentation for humans. Sections include:
- **Project Overview** — tech stack and top-level architecture shape
- **Architecture & Data Flow** — detected layers or domains with data flow direction
- **Conventions & Patterns** — naming rules, export contracts, import rules, and how to add new entities end-to-end
- **Environment Variables** — variables detected in source files and `.env.example`
- **Setup Commands** — exact install and run commands from `package.json`, `Makefile`, etc.
- **Development Workflow** — build, watch, and dev server commands
- **Testing Instructions** — test commands and framework info (if detected)
- **Code Style** — lint/format commands (if config files detected)
- **Build and Deployment** — CI pipeline info (if detected)
Sections with no detected data are omitted entirely.
---
## How Incremental Scanning Works
1. **First run (cold start):** All git-tracked source files are parsed with tree-sitter and cached
2. **Subsequent runs:** Only files whose SHA-256 hash changed since the last scan are re-parsed
3. **Semantic diff:** For modified files, only changed public symbols are included in the payload
4. **No source changes?** The tool stops and asks whether you want to improve the existing `AGENTS.md` content anyway
5. **Private symbols and test file internals** are excluded from both cache and payload — only the public API surface matters for `AGENTS.md`
### How Large Payloads Are Streamed
For large codebases the analysis payload can be too big to return inline over the MCP wire. The server handles this transparently through `read_payload_chunk`.
**`generate_agents_md` flow:**
1. `generate_agents_md` runs the pipeline internally, writes the payload to disk (including `AGENTS.md` writing rules), and returns `total_chunks` with read instructions
2. The client calls `read_payload_chunk(project_path, chunk_index=0)`, then increments `chunk_index` until `has_more` is false
3. The client concatenates all `data` fields — the payload contains the rules and analysis data needed to write `AGENTS.md`
4. The payload file is automatically deleted after the last chunk is read
**`scan_codebase` flow** (pure context, no `AGENTS.md` mandate):
1. `scan_codebase` runs the analysis and writes a pure data payload to disk
2. Same chunked read via `read_payload_chunk`
3. The client uses the payload for any purpose — code review, planning, Q&A
This flow is pure MCP — no filesystem access required from the client side. Any MCP-compatible client can follow it.
### Cache and Payload Location
All runtime artifacts are stored **outside your project**, in the user cache directory:
```
~/.cache/agents-md-generator/<project-hash>/cache.json ← incremental scan cache
```
The `<project-hash>` is a SHA-256 of the project's absolute path — unique per project. Nothing is written to your repository.
> **Note:** The server also writes a temporary `payload.json` to this directory during analysis, but it is managed entirely by the `read_payload_chunk` tool and deleted automatically after the last chunk is read. You never need to access it directly.
---
## Project Configuration
Create `.agents-config.json` at your project root to customize behavior. This file is optional — all fields have defaults.
```json
{
"project_size": "medium",
"exclude": [
"**/node_modules/**",
"**/bin/**",
"**/obj/**",
"**/.git/**",
"**/dist/**",
"**/build/**",
"**/__pycache__/**",
"**/*.min.js",
"**/*.min.css",
"**/*.bundle.js",
"**/vendor/**",
"**/packages/**",
"**/.venv/**",
"**/venv/**",
"**/bower_components/**",
"**/app/lib/**",
"**/wwwroot/lib/**",
"**/wwwroot/libs/**",
"**/static/vendor/**",
"**/public/vendor/**",
"**/assets/vendor/**",
"**/site-packages/**"
],
"include": [],
"languages": "auto",
"agents_md_path": "./AGENTS.md",
"max_file_size_bytes": 1048576
}
```
### Options
| Key | Default | Description |
|-----|---------|-------------|
| `project_size` | `"medium"` | Project scale — tunes all internal caps and thresholds (see [Project Size Profiles](#project-size-profiles)) |
| `exclude` | (see above) | Glob patterns to exclude from analysis |
| `include` | `[]` | If non-empty, only analyze files matching these patterns |
| `languages` | `"auto"` | `"auto"` detects all supported languages, or pass a list like `["typescript", "python"]` |
| `agents_md_path` | `"./AGENTS.md"` | Output path for the generated file |
| `max_file_size_bytes` | `1048576` | Files larger than this are skipped (default: 1 MB) |
You can commit `.agents-config.json` to share settings with your team.
### Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `AGENTS_MD_LOG_LEVEL` | `INFO` | Server log verbosity. Set to `DEBUG` to see per-file analysis details. Valid values: `DEBUG`, `INFO`, `WARNING`, `ERROR` |
### Project Size Profiles
The `project_size` setting controls how aggressively the payload is compressed. A single knob tunes all internal caps — methods per class, symbols per file, directory aggregation, route caps, tree depth, and impact filtering.
| Profile | Lines (guidance) | Impact filter | Description |
|---------|-----------------|---------------|-------------|
| `"small"` | 0–15k | medium | Generous caps — nearly everything is included. Best for small projects where full visibility matters. |
| `"medium"` _(default)_ | 15k–50k | medium | Balanced caps suitable for most projects. |
| `"large"` | 50k+ | high | Aggressive compression — only structural/breaking changes in diffs, more directory collapsing, tighter symbol caps. |
**Detailed profile values:**
| Constant | Small | Medium | Large |
|----------|-------|--------|-------|
| Methods per class | 30 | 12 | 8 |
| Symbols per file | 40 | 20 | 10 |
| Dir aggregation threshold | 20 | 10 | 5 |
| Files per layer (before overflow) | 15 | 8 | 5 |
| Aggregation sample size | 5 | 4 | 3 |
| Route controllers cap | 30 | 15 | 10 |
| Routes per controller | 15 | 8 | 5 |
| Go handlers cap | 15 | 8 | 5 |
| Directory tree depth | 4 | 3 | 2 |
| Impact filter | medium | medium | high |
---
## What the Analysis Detects
### Environment Variables
The server scans all source files for environment variable refeWhat people ask about agents-md-generator
What is nushey/agents-md-generator?
+
nushey/agents-md-generator is mcp servers for the Claude AI ecosystem. Mcp server to create agents-md efficiently It has 6 GitHub stars and was last updated today.
How do I install agents-md-generator?
+
You can install agents-md-generator by cloning the repository (https://github.com/nushey/agents-md-generator) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is nushey/agents-md-generator safe to use?
+
Our security agent has analyzed nushey/agents-md-generator and assigned a Trust Score of 74/100 (tier: OK). See the full breakdown of passed checks and flags on this page.
Who maintains nushey/agents-md-generator?
+
nushey/agents-md-generator is maintained by nushey. The last recorded GitHub activity is from today, with 2 open issues.
Are there alternatives to agents-md-generator?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy agents-md-generator to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/nushey-agents-md-generator)<a href="https://claudewave.com/repo/nushey-agents-md-generator"><img src="https://claudewave.com/api/badge/nushey-agents-md-generator" alt="Featured on ClaudeWave: nushey/agents-md-generator" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!