Skip to main content

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 utilities
    • models.py: Data models for diff operations
  • tools/: Tool implementations
    • file_operations.py: File reading, writing, and modification tools
    • diff_tools.py: Diff-based modification tools
    • project_tools.py: Project analysis and structure tools
    • ast_analyzer.py: AST analysis for Python code
    • console_tools.py: Interactive console process tools
    • library_indexer.py: External library indexing tools

Requirements

  • Python 3.8+
  • fastmcp>=0.1.0

Development

  1. Clone the repository
  2. Install dependencies: pip install -r requirements.txt
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_code_editor-0.1.15.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_code_editor-0.1.15-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_code_editor-0.1.15.tar.gz.

File metadata

  • Download URL: mcp_code_editor-0.1.15.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_code_editor-0.1.15.tar.gz
Algorithm Hash digest
SHA256 4b86ae7dd80b05033762f9a7d488d8f2eecf3eb548d079976171cd059d07c15e
MD5 0cb72887bd40a8df9d6459bba59f70b6
BLAKE2b-256 9fb0710a08b8d1590a7d76d0aed5af9bb5637b5c40bdc6df701f3c3f9924e3f7

See more details on using hashes here.

File details

Details for the file mcp_code_editor-0.1.15-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_code_editor-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 a0d6ad1e41869232982989d7b0e3c601f4bca81c34c6a30cdac9b5a4de19ca86
MD5 f842f6aa01ac9f70219d22b492e703ef
BLAKE2b-256 9c76342a9b229b5a48d557288422fec40efc490d0c492ccfaecdf046397a179b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page