Dev-Kit MCP Server
A Model Context Protocol (MCP) server targeted for agent development tools, providing scoped authorized operations in the root project directory. This package enables secure execution of operations such as running makefile commands, moving and deleting files, with future plans to include more tools for code editing. It serves as an excellent MCP server for VS-Code copilot and other AI-assisted development tools.
Features
- 🔒 Secure Operations: Execute operations within a scoped, authorized root directory
- 🛠️ Makefile Command Execution: Run makefile commands securely within the project
- 📁 File Operations: Move, Create, Rename and Delete files within the authorized directory
- 🔄 Git Operations: Perform Git operations like status, add, commit, push, pull, and checkout
- 🔌 MCP Integration: Turn any codebase into an MCP-compliant system
- 🤖 AI-Assisted Development: Excellent integration with VS-Code copilot and other AI tools
- 🔄 Extensible Framework: Easily add new tools for code editing and other operations
- 🚀 Fast Performance: Built with FastMCP for high performance
Installation
Usage
Running the Server
The --root-dir
parameter specifies the directory where file operations will be performed. This is important for security reasons, as it restricts file operations to this directory only.
The --commands-toml
parameter allows you to specify a custom TOML file for predefined commands instead of using the default pyproject.toml
file. This is useful when you want to define a separate set of commands for different purposes.
Available Tools
The server provides the following tools:
File Operations
- create_dir: Create directories within the authorized root directory
- edit_file: Edit files by replacing lines between specified start and end lines with new text
- move_dir: Move files and directories within the authorized root directory
- remove_file: Delete files within the authorized root directory
- rename_file: Rename files and directories within the authorized root directory
Git Operations
- git_status: Get the status of the Git repository (changed files, untracked files, etc.)
- git_add: Add files to the Git index (staging area)
- git_commit: Commit changes to the Git repository
- git_push: Push changes to a remote Git repository
- git_pull: Pull changes from a remote Git repository
- git_checkout: Checkout or create a branch in the Git repository
- git_diff: Show diffs between commits, commit and working tree, etc.
Makefile Operations
- exec_make_target: Run makefile commands securely within the project
Exploration Operations
- search_files: Search for files by regex pattern in the project directory. Supports optional root directory and output length limits.
- search_text: Search for lines in files matching a given pattern. Supports file filtering, context lines, and output length limits.
- read_lines: Read specific lines or a range from a file. Supports line range selection and output length limits.
Predefined Commands
- predefined_commands: Execute predefined commands from a TOML file (default: pyproject.toml under [tool.dkmcp.commands] section)
The TOML file format for predefined commands is as follows:
Each command is defined as a key-value pair where the key is the command name and the value is the command to execute. For example, when you call the predefined command "test", it will execute "uv run pytest" in the root directory.
Here's a simple example of how to define commands in a custom TOML file:
Example Usage with MCP Client
Development
Setup
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
local-only server
The server can only run on the client's local machine because it depends on local resources.
开发套件-mcp-服务器
Related MCP Servers
- MIT License
- MIT License
- MIT License