A FastMCP server providing powerful code editing tools
Project description
MCP Code Editor
A FastMCP server providing powerful code editing tools including precise file modifications with diff-based operations, file creation and reading with line numbers, and more tools for code editing workflows.
Features
- Precise file modifications with diff-based operations
- File creation and reading with line numbers
- Project analysis and structure inspection
- AST (Abstract Syntax Tree) analysis for Python code
- Console tools for interactive processes
- Library indexing for external dependencies
- Code definition search and navigation
- No automatic backup files (v0.1.10+) - cleaner file operations without .bak files
Installation
pip install mcp-code-editor
Usage
As a standalone server
mcp-code-editor
As a library
from core import DiffBlock, DiffBuilder, FileModifier
from tools import ProjectAnalyzer, ASTAnalyzer
# Create and apply file modifications
modifier = FileModifier("path/to/file.py")
diff_block = DiffBlock(
old_content="old code",
new_content="new code",
start_line=10,
end_line=15
)
modifier.apply_diff(diff_block)
Architecture
The project is structured as follows:
core/: Core models and utilitiesmodels.py: Data models for diff operations
tools/: Tool implementationsfile_operations.py: File reading, writing, and modification toolsdiff_tools.py: Diff-based modification toolsproject_tools.py: Project analysis and structure toolsast_analyzer.py: AST analysis for Python codeconsole_tools.py: Interactive console process toolslibrary_indexer.py: External library indexing tools
Requirements
- Python 3.8+
- fastmcp>=0.1.0
Development
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Run the server:
python main.py
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_code_editor-0.1.13.tar.gz.
File metadata
- Download URL: mcp_code_editor-0.1.13.tar.gz
- Upload date:
- Size: 51.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f217e3ff991f2293d49ad137182522591be1095f79ffde7aab39ace587092a37
|
|
| MD5 |
31341ee90e71cd4321a3df111d00c82c
|
|
| BLAKE2b-256 |
11346b87f7ede6e72d5f4cb5b913e4329e4ee5aa399edab3400464adf8c7be83
|
File details
Details for the file mcp_code_editor-0.1.13-py3-none-any.whl.
File metadata
- Download URL: mcp_code_editor-0.1.13-py3-none-any.whl
- Upload date:
- Size: 56.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e93770b84306693cb4d25199bcedff728627bfed97eb79a5b224e7649a5e42b
|
|
| MD5 |
6b6cbf6489b55a1bda3e48244adffb66
|
|
| BLAKE2b-256 |
2cdde52d71258cfb7a6c49dc8fa1e483f2d2361632ffc5ca17fc7f3f388c2229
|