# AGENTS.md Generator [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/nushey/agents-md-generator  
**GitHub Stars:** 6  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agents-md-generator

## Description
Analyzes codebases with tree-sitter and generates AGENTS.md files for AI coding agents.

## Tools
Capabilities this server exposes over MCP:

- **scan_codebase** — Scan and analyze a codebase with tree-sitter, producing a structured context payload.

    Performs AST analysis, change detection, and caching. Writes the analysis payload
    to disk and returns instructions to retrieve it via read_payload_chunk. The payload
    contains pure architectural data — no AGENTS.md writing instructions.

    Use this tool when you need deep codebase understanding for any task (code review,
    refactoring, planning, Q&A). To generate or update AGENTS.md specifically, use
    generate_agents_md instead — it orchestrates the full workflow automatically.

    Supported languages: Python, C#, TypeScript, JavaScript, Go.

    Args:
        params (ScanCodebaseInput): Input parameters containing:
            - project_path (str): Path to the project root (default: ".")
            - force_full_scan (bool): Ignore cache and rescan everything (default: False).

    Returns:
        str: JSON with total_chunks and instructions to call read_payload_chunk.
    
- **read_payload_chunk** — Read a chunk of the analysis payload produced by scan_codebase.

    Call this tool repeatedly starting at chunk_index=0, incrementing by 1 each time,
    until the response contains has_more=false. Concatenate all 'data' fields in order
    to reconstruct the full payload JSON.

    The payload file is automatically deleted after the last chunk is read.

    Args:
        params (ReadPayloadChunkInput): Input parameters containing:
            - project_path (str): Path to the project root (must match scan_codebase call).
            - chunk_index (int): Zero-based index of the chunk to retrieve.

    Returns:
        str: JSON with fields: chunk_index, total_chunks, has_more (bool), data (str).
             On the last chunk (has_more=false), the payload file is deleted from disk.
    
- **generate_agents_md** — Orchestrate the full AGENTS.md creation or update workflow.

    Determines whether to create or update AGENTS.md by checking if the file already
    exists. Returns writing rules, the existing content (if any), and step-by-step
    instructions to scan the codebase and produce the final file.

    Use this tool whenever the user asks to generate, create, update, or refresh
    AGENTS.md. For general codebase context without AGENTS.md generation, use
    scan_codebase + read_payload_chunk directly.

    Args:
        params (GenerateAgentsMdInput): Input parameters containing:
            - project_path (str): Path to the project root (default: ".")

    Returns:
        str: JSON with agents_md_path, agents_md_rules, existing_agents_md (if any),
             and step-by-step instructions for the agent to follow.
    

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "agents-md-generator": {
    "command": "uvx",
    "args": ["agents-md-generator"]
  }
}
```

## Documentation

## What AGENTS.md Generator MCP server does

The AGENTS.md Generator MCP server examines a project and prepares information for an AI agent to create or update an `AGENTS.md` file. Analysis uses tree-sitter and currently covers Python, C#, TypeScript, JavaScript, and Go. The generated content follows the agents.md open standard and is intended as operational guidance for coding agents rather than human-facing project documentation.

Detected output can include the project’s technology stack, architectural layers, data flow, naming and import conventions, environment variables, setup commands, development workflows, tests, formatting or linting commands, and CI or deployment details. Empty sections are left out. The client, rather than the server, is responsible for writing the resulting `AGENTS.md` file.

## How it works

`generate_agents_md` is the main workflow. It analyzes the selected project, includes instructions for producing the file in its payload, and returns directions for reading that payload in chunks. The project root defaults to the current directory, or can be supplied with `project_path`.

`scan_codebase` runs the analysis without instructions to generate an `AGENTS.md`. This makes it suitable for obtaining repository context for planning, review, questions, or another coding task. Set `force_full_scan` to `true` when the cached results should be ignored.

Both operations store serialized results for retrieval through `read_payload_chunk`. The client starts at chunk index zero and continues until `has_more` is false. Large payloads therefore do not need to be returned in a single MCP response.

## Setup and configuration

The AGENTS.md Generator MCP server requires Python 3.11 or newer, Git, and an MCP-capable client. Install the package with pip and run its setup wizard, or use `uvx` without a prior package installation. The wizard can detect and configure Claude Code, Gemini CLI, Cursor, Windsurf, and Codex CLI, either globally or for an individual project.

A manual `uvx` registration uses the `agents-md-generator` command. Claude Code can register the same command with `claude mcp add`; its default scope is the current project, while a user scope can be selected explicitly.

Project-specific behavior can be narrowed through `.agents-config.json`, which is relevant for repositories that exceed scan time limits.

## Tools and capabilities

- `generate_agents_md`: analyzes a project and prepares the payload and writing instructions for `AGENTS.md`.
- `scan_codebase`: returns analysis data without an `AGENTS.md` generation mandate.
- `read_payload_chunk`: retrieves either tool’s stored payload incrementally.
- Incremental scanning reuses cached results for unchanged git-tracked files and reparses files whose SHA-256 hash changed.
- Modified files are reduced to changed public symbols; private symbols and test-file internals are excluded.
- Scans run in a separate process with progress notifications and a five-minute timeout.

## Limitations and notes

Only one scan per project can run at a time within a server instance. A serialized payload is limited to 300,000 characters; when analysis is reduced, the payload records the affected sections in metadata. Existing `AGENTS.md` content and writing instructions are preserved, but an error is returned if those alone exceed the limit.

If no source changes are found, the workflow asks whether the existing `AGENTS.md` should be improved. Generation can be retried after an interruption. Payload files are removed after their final chunk is read. The AGENTS.md Generator MCP server does not directly write the file; the connected client must use the returned content and instructions.

_Full upstream README: https://allmcps.com/mcp/agents-md-generator/readme_

