Skip to main content
Glama

MCP Code Editor

by alejoair

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.

-
security - not tested
A
license - permissive license
-
quality - not tested

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.

  1. Features
    1. Installation
      1. Usage
        1. As a standalone server
        2. As a library
      2. Architecture
        1. Requirements
          1. Development
            1. Contributing
              1. License

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  TypeScript-based MCP server designed to enhance code editing experiences by providing features such as hover information, code completion, and diagnostics.
                  Last updated -
                  3
                  13
                  MIT License
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  FastMCP is a comprehensive MCP server allowing secure and standardized data and functionality exposure to LLM applications, offering resources, tools, and prompt management for efficient LLM interactions.
                  Last updated -
                  3
                  Python
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A TypeScript-based MCP server that provides tools for making precise line-based edits to text files within allowed directories.
                  Last updated -
                  18
                  TypeScript
                  MIT License
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server that provides tools for reading, writing, and editing files on the local filesystem.
                  Last updated -
                  1
                  1,387
                  Python
                  Apache 2.0
                  • Apple

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/alejoair/mcp-code-editor'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server