mdpilot-mcp
v0.3.4Give your AI agent the perfect starting point — generates AGENTS.md and CLAUDE.md from your real repo, verifies every command exists, detects doc drift, and…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
analyze_project Analyze project
Scan a repo and detect its tech stack, scripts, package manager, structure, and MCP servers. Run this before generate_md_file so output is grounded in real project data instead of guesses.
| Parameter | Type | Description |
|---|---|---|
rootDir | string | Absolute path to the project root. Defaults to cwd. |
verbose | boolean | Return full JSON instead of compact summary. |
generate_md_file Generate markdown file
Generate a production-grade, repo-grounded markdown file (readme, agents, claude, contributing, security, skill, design, context). Reads real package.json scripts and file structure — never hallucinates commands. Optionally writes the file to disk.
| Parameter | Type | Description |
|---|---|---|
fileType * | string | Which file to generate |
rootDir | string | Absolute path to the project root. Defaults to cwd. |
tokenDiscipline | boolean | If true, append a "Response style" section to AGENTS.md/CLAUDE.md instructing the AI to be terse. Cuts agent chat tokens by ~20%. |
verbose | boolean | Return verbose output with full commentary instead of the compact single-line footer. |
verified | boolean | If true, run the self-verification loop — generate, verify commands/paths against the real repo, revise if needed (max 2 attempts). Recommended for AGENTS.md and CLAUDE.md. |
writeToDisk | boolean | If true, write the generated file to the project root. |
writingStyle | string | When "human", appends a natural writing style directive for human-facing file types (readme, contributing, design). No effect on agent-facing files (agents, claude, skill, context). |
generate_task_file Generate TASK.md from task description
Turn a pasted ticket, Slack thread, GitHub issue, or task description into an AI-agent-ready TASK.md with structured requirements, acceptance criteria, and a ready-to-paste agent prompt block.
| Parameter | Type | Description |
|---|---|---|
taskInput * | string | Raw task text — ticket, Slack thread, GitHub issue, etc. |
executionMode | string | Output mode: "guide" = full TASK.md for a human; "ai_exec" = prescriptive output an AI agent executes directly; "context" = compact context-only drop for a chat window. |
experienceLevel | string | Developer experience level. "new" adds "why" explanations; "experienced" keeps output terse. |
riskCheck | boolean | When true (ai_exec mode only): if the TASK.md has a Watch-outs section, appends "check your plan against the Watch-outs" to the agent prompt block before execution. |
rootDir | string | Absolute path to the project root — used to auto-detect stack if stack not provided. |
stack | string | Tech stack hint, e.g. "Next.js, TypeScript, Supabase". Auto-detected if omitted and rootDir given. |
verbose | boolean | Return verbose output with token stats. Default: compact (content only). |
explain_code Explain code as WALKTHROUGH.md
Explain a file or directory of code to any audience — AI agent, new team member, non-technical stakeholder, or learner. Reads a single file or uses repo context for a directory, then generates a structured WALKTHROUGH.md.
| Parameter | Type | Description |
|---|---|---|
audience | string | Who will read the explanation. "ai_agent" = terse, machine-parseable; "team" = new engineer; "non_technical" = founder/PM; "learner" = teaching mode. |
filePath | string | Absolute path to a single file to explain. Use this for a focused explanation of one module. |
rootDir | string | Absolute path to a directory — uses repomix to gather repo context. Prefer filePath for single files. |
verbose | boolean | Return verbose output with write confirmation. Default: compact (content + single-line footer). |
writeToDisk | boolean | If true, write WALKTHROUGH.md to the project root (rootDir or filePath directory). |
writingStyle | string | When "human", appends a natural writing style directive for a more conversational walkthrough. Auto-enabled for non_technical and learner audiences regardless of this setting. |
optimize_markdown Optimize markdown for tokens
Run the MDPilot 4-pass token optimizer on existing markdown content. Strips boilerplate, removes redundant phrasing, compresses structure, and tightens prose. Returns the leaner version with token savings.
| Parameter | Type | Description |
|---|---|---|
content * | string | Markdown content to optimize |
aggressive | boolean | Enable the aggressive 5th pass — collapses soft hedges and filler phrases. Never alters code blocks, commands, paths, or numbers. Default: off. |
verbose | boolean | Return verbose output with per-pass breakdown. Default: compact single-line footer. |
image_to_prompt Image to generation prompt
Analyze a local image file (PNG, JPG, WEBP) and generate a detailed recreation prompt for image generation models (FLUX, Stable Diffusion, Midjourney, DALL-E, Gemini). Covers subject, composition, lighting, colors, style, camera angle, and mood.
| Parameter | Type | Description |
|---|---|---|
imagePath * | string | Absolute path to a .png, .jpg, .jpeg, or .webp image file |
check_drift Check docs for drift
Scan the repo and detect where docs (README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md) have gone stale — broken commands, missing paths, undocumented scripts or directories, removed MCP servers. Uses two detection methods: claim verification and snapshot diff.
| Parameter | Type | Description |
|---|---|---|
docs | array | Specific doc filenames to check, e.g. ["AGENTS.md"]. Defaults to README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md. |
rootDir | string | Absolute path to the project root. Defaults to cwd. |
verbose | boolean | Return verbose output with full issue details. Default: compact one-line-per-issue format. |
update_docs Update stale docs
Fix drift in a specific doc — patches ONLY the stale sections (broken commands, missing paths) and preserves everything else exactly. Uses Claude to apply the minimal fix. Optionally writes the corrected file to disk and updates the manifest.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Which doc to fix |
rootDir | string | Absolute path to the project root. Defaults to cwd. |
verbose | boolean | Return verbose output with full issue list. Default: compact single-line footer. |
writeToDisk | boolean | If true, overwrite the file on disk and update the manifest snapshot. |
save_context Save session context to CONTEXT.md
Persist session state to CONTEXT.md at the project root — decisions made, current state, next steps, open questions. Appends a new dated entry and keeps the last 5 sessions. Secret-shaped strings (API keys) are automatically redacted before writing. Everything stays on your machine.
| Parameter | Type | Description |
|---|---|---|
summary * | string | What happened this session: decisions made, current state, next steps, open questions. Free text — the tool will structure and date-stamp it. |
rootDir | string | Absolute path to the project root. Defaults to cwd. |
writeToDisk | boolean | Write CONTEXT.md to disk. Set to false to preview the content without saving. |
load_context Load session context from CONTEXT.md
Read the project's CONTEXT.md and inject prior session state into your working context. Runs a drift check on every command and path inside the file — stale references are annotated inline. Everything stays on your machine.
| Parameter | Type | Description |
|---|---|---|
rootDir | string | Absolute path to the project root. Defaults to cwd. |