daoch4n/zen-ai-mcp-devtools
If you are the rightful owner of zen-ai-mcp-devtools and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
mcp-devtools is a multi-functional development tool suite that operates as an MCP server over SSE, providing a range of capabilities for developers.
âī¸ mcp-devtools: multi-functional development tools MCP server over SSE đ¸ ãĒãŧãããŧ đŽ č¯ģæ
https://github.com/user-attachments/assets/d0b7b41b-c420-4b84-8807-d8a00300bd3e
- đ§
mcp-devtools
offers a comprehensive suite of software development tools: âšī¸ Available Tools- đ¤ AI-assisted file operations (
ai_edit
(uses Aider) - đ Git-assisted file operations (
git_read_file
,git_apply_diff
) - đ Direct file operations (
search_and_replace
(usessed
with fallback to direct mode),write_to_file
) âšī¸ Direct vs AI-assisted - đ Git management operations (
git_diff_all
(compares to HEAD,git_diff
(compares to specific commits/branches),git_show
,git_stage_and_commit
,git_status
,git_log
,git_create_branch
,git_checkout
,git_reset
) - đĨī¸ Terminal commands execution (
execute_command
) â ī¸ Automation-Related Security
- đ¤ AI-assisted file operations (
đ§ Audio Overview
https://github.com/user-attachments/assets/05670a7a-72c5-4276-925c-dbd1ed617d99
âŦī¸ Skip to Downloads
â Use Cases
- đ Use it to extend online chat-based assistants such as ChatGPT, Google Gemini or AI Studio, Perplexity, Grok, OpenRouter Chat, DeepSeek, Kagi, T3 Chat with direct access to local files, git, terminal commands execution and AI-assisted file editing capabilities via MCP-SuperAssistant or similar projects.
- đŠđģâđģ Use it to boost code editors like Cursor, Windsurf or VSCode extensions like Roo Code, Cline, Copilot or Augment with intuitive Git management and AI-assisted file editing capabilities and say goodbye to those pesky diff application failures wasting your time or
Roo having trouble...
breaking your carefully engineered automation workflows. Aider seems to get diffs right! (if it still doesn't work quite well, try to find perfect way for your AI model by explicitly passing differentedit_format
parameters toai_edit
tool):unidiff
seems to work better with GPTdiff-fenced
performs best with Geminidiff
provides balanced quick results on all models (default)whole
is the slowest but most reliable option as it simply overwrites file
đĻ Agentic-Driven Workflows with Roo
https://github.com/user-attachments/assets/4d218e5e-906c-4d24-abc3-09ab0acdc1d0
-
For Roo Code, place the .roomodes file and .roo/ folder into your repo root to experience automated two-levels deep nested agents execution flow:
âšī¸ To enforce strict adherence to following rules, enable
experimental power steering
mode in Roo Code settings.đŧ Advanced Flow (åĻåĻ đ§ optimized for autonomous operation) âšī¸
đ§ Rooroo Navigator
agent is your Advanced Flow manager, so talk to it if you prefer to keep your agent management in orderly manner. Responsible for overall project coordination and task orchestration, task lifecycles, delegation to Planner, Developer, Analyzer, Idea Sparker, processes your commands, and oversees your workflows. Providescontext.md
files to tasks, either the ones generated byđī¸ Rooroo Planner
, or generates new one if Planner wasn't deemed neccessary for the task.
Optimized deep reasoning models like Gemini 2.5 Pro with resoning effort (thinking budget) set tolow
(8192
) ormedium
(16384
) (100 req/day free via Gemini API) or DeepSeek R1/V3 hybrid (free via Chutes API) recommended.đŠđģâđģ Rooroo Developer
agent:
Delegates all code changes to Aider subagent via ai_edit tool then reviews Aider work results
âšī¸ Or applies diffs directly if you modify.roomodes
and remove directive to useai_edit
tool,rules.md
provided in.roo/
folder are optimized for both ways
Outputs task result in strict JSON schema. Choose model based on task complexity: optimized deep reasoning models for more difficult tasks, faster models like Gemini Flash 2.5 with resoning effort (thinking budget) set tohigh
(32768
) (500 req/day free via Gemini API) for daily routine tasks.đ Rooroo Analyzer
agent acts as a researcher and analyzes the code. Full Deep Reasoning models like Gemini 2.5 Pro with resoning effort (thinking budget) set tohigh
(32768
) or DeepSeek R1 0528 (also free via Chutes API) recommended. Adjust temperature based on creativity needed.đī¸ Rooroo Planner
agent decomposes complex goals requiring multi-expert coordination into clear, actionable sub-tasks for other agents to do. It is also the main supplier ofcontext.md
files for them. Optimized deep reasoning model recommended.đĄ Rooroo Idea Sparker
agent is your brainstorming copilot and innovation catalyst, talk to it if you'd like some creative thinking and assumption challenging done, or just explore something new with it. Deep reasoning models with higher temperature set or internet-connected reasoning models like Perplexity Sonar recommended.
âšī¸ Advanced Flow Tutorial
- Initiate: Select
đ§ Rooroo Navigator
agent and state your goal. - Navigator Triage: The Navigator assesses your request:
-
- For complex/uncertain tasks, it engages the
đī¸ Rooroo Planner
agent to break it down into sub-tasks withcontext.md
briefings. These go into the.rooroo/queue.jsonl
.
- For complex/uncertain tasks, it engages the
-
- For simple, clear single-expert tasks, it prepares
context.md
and may execute directly or queue the task.
- For simple, clear single-expert tasks, it prepares
- If ambiguous, it asks
đī¸ Rooroo Planner
for clarification.
- Execution: The Navigator dispatches tasks from the queue to the assigned Rooroo expert. The expert uses its
context.md
and stores outputs in.rooroo/tasks/TASK_ID/
. - Reporting: The expert returns a JSON Output Envelope (status, message, artifacts) to the Navigator.
- Processing & Iteration: The Navigator parses the envelope:
-
NeedsClarification
: Relays question to relevant expert.
-
Done
/Failed
: Updates queue, informs you. Auto-proceeds with plans if queue is not empty.
1ī¸âŖ Prerequisites
- Python 3.12, uv
đ§ Linux/macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
đĒ Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2ī¸âŖ Usage
đ Running from PyPi
uvx mcp-devtools@1.2.6 -p 1337
đââŦ Running from GitHub
đ§ Linux/macOS
git clone "https://github.com/daoch4n/zen-ai-mcp-devtools/"
cd zen-ai-mcp-devtools
./server.sh -p 1337
đĒ Windows
git clone "https://github.com/daoch4n/zen-ai-mcp-devtools/"
cd zen-ai-mcp-devtools
.\server.ps1 -p 1337
3ī¸âŖ MCP Server Configuration
To integrate mcp-devtools
with your AI assistant, add the following configuration to your MCP settings file:
{
"mcpServers": {
"devtools": {
"url": "http://127.0.0.1:1337/sse",
"disabled": false,
"alwaysAllow": [],
"timeout": 900
}
}
}
4ī¸âŖ AI System Prompt Example
âšī¸ Show Prompt
**Persona: Lead Developer AI**
You are an expert, hands-on software developer. Your primary function is to understand user requests, formulate a clear plan, and execute that plan using the provided development tools. You are methodical, precise, and communicative. Your goal is to write, modify, and manage code and repository state to solve user problems effectively.
**Core Objective: Plan, Execute, Verify**
For any given task, you will operate in a clear cycle:
1. **Plan:** Analyze the request and create a public, step-by-step plan.
2. **Execute:** Perform one step of the plan at a time using the appropriate tool.
3. **Verify & Report:** Confirm the result of each action and inform the user of the outcome before proceeding to the next step.
**Guiding Principles**
* **User-Centric Initialization:** At the very beginning of the conversation, your first action must be to ask the user for the absolute path to the project's working directory. Store this as the `{repo_path}` for all subsequent operations.
* **Path Integrity:** The `{repo_path}` is critical for all tool calls.
* **Instruction:** For any `devtools` tool, you must provide the `{repo_path}` in the `repo_path` parameter.
* **Instruction:** When using `execute_command` for file operations (e.g., `touch`, `mkdir`, `rm`), construct the command using the absolute path by prefixing the filename with `{repo_path}`.
* **Tool Safety and Clarity:** Your tool inputs must be predictable and safe.
* **Instruction:** When using the `ai_edit` tool, you must describe any symbols that could break a JSON structure (like square or curly brackets) in plain language within the `instructions` field. This ensures the integrity of the tool call.
**Example Workflow**
This example demonstrates the correct application of your principles for a task: "Add error handling to the `database_connect` function in `utils.py`."
***
**Step 1: Ask for the Repository Path (Your First Action)**
**You:** "To begin, please provide the absolute path to your repository's working directory."
**User:** "/home/user/projects/my-flask-app"
---
**Step 2: Formulate and Share the Plan**
**You:** "Understood. My plan is as follows:
1. Read the content of `src/utils.py` to understand the current structure of the `database_connect` function.
2. Use the `ai_edit` tool to add a `try...except` block to the function.
3. List the files in the `src` directory to confirm the modification timestamp has changed."
---
**Step 3: Execute Step 1 of the Plan (Read File)**
**You:** "First, I will read the file to get the necessary context."
<tool_code>
print(devtools.read_file(
repo_path="/home/user/projects/my-flask-app",
file_path="src/utils.py"
))
</tool_code>
---
**Step 4: Execute Step 2 of the Plan (Edit File with Verbal Descriptions)**
**You:** "Now I will add the error handling."
<tool_code>
print(devtools.ai_edit(
repo_path="/home/user/projects/my-flask-app",
file_path="src/utils.py",
instructions="""Wrap the existing logic inside the `database_connect` function with error handling.
1. Before the line `connection = ...`, insert a new line with the word 'try' followed by a colon.
2. Indent all the existing code within the function one level deeper.
3. After the existing code, add a new line with the word 'except', followed by 'Exception', the word 'as', the variable 'e', and a colon.
4. Inside the except block, add a line to print the phrase 'An error occurred:', followed by the error variable 'e'.
"""
))
</tool_code>
---
**Step 5: Execute Step 3 of the Plan (Verify with `execute_command`)**
**You:** "Finally, I will verify the file was modified."
<tool_code>
print(devtools.execute_command(
repo_path="/home/user/projects/my-flask-app",
command="ls -l src/"
))
</tool_code>
âī¸ Known Issues and Workarounds
đž Direct Code Editing vs đ¤ AI-assisted Editing
Issue:
- đ When using the
write_to_file
tool for direct code editing, especially with languages like JavaScript that utilize template literals (strings enclosed by backticks), you may encounter unexpected syntax errors. This issue stems from how the AI assistant generates thecontent
string, where backticks and dollar signs within template literals might be incorrectly escaped with extra backslashes (\
).
Mitigation:
- đ¨ The
write_to_file
,search_and_replace
andgit_apply_diff
tools are dynamically integrated withtsc
(TypeScript compiler) for conditional type checking of.js
,.mjs
, and.ts
files on edit. The output oftsc --noEmit --allowJs
is provided as part of the tool's response. AI assistants should parse this output to detect any compiler errors and should not proceed with further actions if errors are reported, indicating a problem with the written code.
Workarounds:
- đ¤ (most reliable) Instruct your AI assistant to delegate editing files to MCP-compatible coding agent by using
ai_edit
tool instead, as it is more suitable for direct code manipulation, automatically commits changes and produces resulting diff as tool output, and let AI assistant act as task orchestrator that will write down plans and docs withwrite_to_file
tool then delegate actual coding to specialized agent, get its report (diff) as tool call result, usegit_read_file
tool to double check agent's work, and manage commits and branches (ai_edit
tool basically integratesAider
via some logic ported from its MCP bridge). - đĨī¸ (if you're feeling lucky) Instruct your AI assistant to craft a terminal command to edit problematic file via
execute_command
tool.
â Aider limitations due to its commit-first nature
Issue:
- đ When using
ai_edit
tool in a dirty repo state, e.g. during merge or rebase active, it will probably get stuck trying to apply commit.
Workarounds:
- âī¸ Temporarily disable auto commiting functions in your
.aider.conf.yml
configuration file.
đ Automation-Related Security Considerations
- đĄī¸ For automated workflows, always run MCP Servers in isolated environments (đ§Firejail or đĒSandboxie)
- đī¸ Filesystem access boundaries are maintained via passing
repo_path
to every tool call, so AI assistant only has read/write access to files in the current workspace (relative to any path AI decides to pass asrepo_path
, make sure system prompt is solid on cwd use). - â ī¸
execute_command
doesn't have strict access boundaries defined, while it does execute all commands with cwd set torepo_path
(relative to it), nothing is there to stop AI from passing full paths to other places it seems fit; reading, altering or deleting unintended data on your whole computer, so execise extreme caution with auto-allowingexecute_command
tool or at least don't leave AI assistant unattended while doing so. MCP server is not responsible for your AI assistant executing rm -rf * in your home folder.
âšī¸ Available Tools
git_status
- Description: Shows the current status of the Git working tree, including untracked, modified, and staged files.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." } }, "required": [ "repo_path" ] }
git_diff_all
- Description: Shows all changes in the working directory, including both staged and unstaged modifications, compared to the HEAD commit. This provides a comprehensive view of all local changes.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." } }, "required": [ "repo_path" ] }
git_diff
- Description: Shows differences between the current working directory and a specified Git target (e.g., another branch, a specific commit hash, or a tag).
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "target": { "type": "string", "description": "The target (e.g., branch name, commit hash, tag) to diff against. For example, 'main', 'HEAD~1', or a full commit SHA." } }, "required": [ "repo_path", "target" ] }
git_stage_and_commit
- Description: Stages specified files (or all changes if no files are specified) and then commits them to the repository with a given message. This creates a new commit in the Git history.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "message": { "type": "string", "description": "The commit message for the changes." }, "files": { "type": "array", "items": { "type": "string" }, "description": "An optional list of specific file paths (relative to the repository root) to stage before committing. If not provided, all changes will be staged." } }, "required": [ "repo_path", "message" ] }
git_reset
- Description: Unstages all currently staged changes in the repository, moving them back to the working directory without discarding modifications. This is equivalent to
git reset
without arguments. - Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." } }, "required": [ "repo_path" ] }
git_log
- Description: Shows the commit history for the repository, listing recent commits with their hash, author, date, and message. The number of commits can be limited.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "max_count": { "type": "integer", "default": 10, "description": "The maximum number of commit entries to retrieve. Defaults to 10." } }, "required": [ "repo_path" ] }
git_create_branch
- Description: Creates a new Git branch with the specified name. Optionally, you can base the new branch on an existing branch or commit, otherwise it defaults to the current active branch.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "branch_name": { "type": "string", "description": "The name of the new branch to create." }, "base_branch": { "type": "string", "nullable": true, "description": "Optional. The name of the branch or commit hash to base the new branch on. If not provided, the new branch will be based on the current active branch." } }, "required": [ "repo_path", "branch_name" ] }
git_checkout
- Description: Switches the current active branch to the specified branch name. This updates the working directory to reflect the state of the target branch.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "branch_name": { "type": "string", "description": "The name of the branch to checkout." } }, "required": [ "repo_path", "branch_name" ] }
git_show
- Description: Shows the metadata (author, date, message) and the diff of a specific commit. This allows inspection of changes introduced by a particular commit.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "revision": { "type": "string", "description": "The commit hash or reference (e.g., 'HEAD', 'main', 'abc1234') to show details for." } }, "required": [ "repo_path", "revision" ] }
git_apply_diff
- Description: Applies a given diff content (in unified diff format) to the working directory of the repository. This can be used to programmatically apply patches or changes.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "diff_content": { "type": "string", "description": "The diff content string to apply to the repository. This should be in a unified diff format." } }, "required": [ "repo_path", "diff_content" ] }
git_read_file
- Description: Reads and returns the entire content of a specified file within the Git repository's working directory. The file path must be relative to the repository root.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "file_path": { "type": "string", "description": "The path to the file to read, relative to the repository's working directory." } }, "required": [ "repo_path", "file_path" ] }
search_and_replace
- Description: Searches for a specified string or regex pattern within a file and replaces all occurrences with a new string. Supports case-insensitive search and line-range restrictions. It attempts to use
sed
for efficiency, falling back to Python logic ifsed
fails or makes no changes. - Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "file_path": { "type": "string", "description": "The path to the file to modify, relative to the repository's working directory." }, "search_string": { "type": "string", "description": "The string or regex pattern to search for within the file." }, "replace_string": { "type": "string", "description": "The string to replace all matches of the search string with." }, "ignore_case": { "type": "boolean", "default": false, "description": "If true, the search will be case-insensitive. Defaults to false." }, "start_line": { "type": "integer", "nullable": true, "description": "Optional. The 1-based starting line number for the search and replace operation (inclusive). If not provided, search starts from the beginning of the file." }, "end_line": { "type": "integer", "nullable": true, "description": "Optional. The 1-based ending line number for the search and replace operation (inclusive). If not provided, search continues to the end of the file." } }, "required": [ "repo_path", "file_path", "search_string", "replace_string" ] }
write_to_file
- Description: Writes the provided content to a specified file within the repository. If the file does not exist, it will be created. If it exists, its content will be completely overwritten. Includes a check to ensure content was written correctly and generates a diff.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory." }, "file_path": { "type": "string", "description": "The path to the file to write to, relative to the repository's working directory. The file will be created if it doesn't exist, or overwritten if it does." }, "content": { "type": "string", "description": "The string content to write to the specified file." } }, "required": [ "repo_path", "file_path", "content" ] }
execute_command
- Description: Executes an arbitrary shell command within the context of the specified repository's working directory. This tool can be used for tasks not covered by other specific Git tools, such as running build scripts, linters, or other system commands.
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the directory where the command should be executed." }, "command": { "type": "string", "description": "The shell command string to execute (e.g., 'ls -l', 'npm install')." } }, "required": [ "repo_path", "command" ] }
ai_edit
-
Description: AI pair programming tool for making targeted code changes using Aider. Use this tool to:
- Implement new features or functionality in existing code
- Add tests to an existing codebase
- Fix bugs in code
- Refactor or improve existing code
- Make structural changes across multiple files
The tool requires:
- A repository path where the code exists
- A detailed message describing what changes to make. Please only describe one change per message. If you need to make multiple changes, please submit multiple requests.
Edit Format Selection: If the
edit_format
option is not explicitly provided, the default is selected based on the model name:- If the model includes
gemini
, defaults todiff-fenced
- If the model includes
gpt
, defaults toudiff
- Otherwise, defaults to
diff
Best practices for messages:
- Be specific about what files or components to modify
- Describe the desired behavior or functionality clearly
- Provide context about the existing codebase structure
- Include any constraints or requirements to follow
Examples of good messages:
- "Add unit tests for the Customer class in src/models/customer.rb testing the validation logic"
- "Implement pagination for the user listing API in the controllers/users_controller.js file"
- "Fix the bug in utils/date_formatter.py where dates before 1970 aren't handled correctly"
- "Refactor the authentication middleware in middleware/auth.js to use async/await instead of callbacks"
-
Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository's working directory where the AI edit should be performed." }, "message": { "type": "string", "description": "A detailed natural language message describing the code changes to make. Be specific about files, desired behavior, and any constraints." }, "files": { "type": "array", "items": { "type": "string" }, "description": "A list of file paths (relative to the repository root) that Aider should operate on. This argument is mandatory." }, "options": { "type": "array", "items": { "type": "string" }, "description": "Optional. A list of additional command-line options to pass directly to Aider (e.g., ['--model=gpt-4o', '--dirty-diff']). Each option should be a string." }, "edit_format": { "type": "string", "enum": [ "diff", "diff-fenced", "udiff", "whole" ], "default": "diff", "description": "Optional. The format Aider should use for edits. Defaults to 'diff'. Options: 'diff', 'diff-fenced', 'udiff', 'whole'." } }, "required": [ "repo_path", "message", "files" ] }
aider_status
- Description: Check the status of Aider and its environment. Use this to:
- Verify Aider is correctly installed
- Check API keys
- View the current configuration
- Diagnose connection or setup issues
- Input Schema:
{ "type": "object", "properties": { "repo_path": { "type": "string", "description": "The absolute path to the Git repository or working directory to check Aider's status within." }, "check_environment": { "type": "boolean", "default": true, "description": "If true, the tool will also check Aider's configuration, environment variables, and Git repository details. Defaults to true." } }, "required": [ "repo_path" ] }