Sponsored by Deepsite.site

Headless Code Editor MCP Server

Created By
oakenaia year ago
Headless Editor MCP Server for intelligent code editing
Content

Headless Code Editor MCP Server

A robust, language-agnostic headless code editor that leverages the Language Server Protocol (LSP) for code intelligence and the Model Context Protocol (MCP) for AI-assisted code manipulation.

Features

  • LSP integration for language intelligence
  • Secure file system operations with strict access controls
  • Session-based editing with state management
  • TypeScript/JavaScript language support with in-depth analysis
  • React component detection and manipulation
  • Format-preserving edit operations
  • Comprehensive logging and error tracking

Installation

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Usage

Starting the Server

# Start with allowed directory
node build/index.js /path/to/workspace

# Start with multiple allowed directories
node build/index.js /path/to/workspace1 /path/to/workspace2

MCP Tools

  1. start_session: Create a new editing session
  2. edit_code: Apply edits to code
  3. validate_code: Validate current code state
  4. close_session: Clean up and close a session

Example Integration

const client = new Client(
  { name: "example-client", version: "1.0.0" },
  { capabilities: {} }
);

// Connect to server
const transport = new StdioClientTransport({
  command: "node",
  args: ["./build/index.js", "/workspace"]
});

await client.connect(transport);

// Start session
const result = await client.request({
  method: "tools/call",
  params: {
    name: "start_session",
    arguments: {
      filePath: "/workspace/example.ts",
      languageId: "typescript"
    }
  }
});

Architecture

  • LSP Manager: Coordinates language server lifecycle and communication
  • Document Manager: Handles document state and synchronization
  • Session Manager: Manages editing sessions and state
  • Edit Operation Manager: Processes and validates code edits
  • File System Manager: Provides secure file system access

Security Features

  • Path validation and normalization
  • Access control through allowed directories
  • Input sanitization
  • File system operation boundaries
  • Symlink security checks

Incomplete Tasks

Language Support

  • Python language server integration
  • Java language server integration
  • Support for additional language servers

Framework Support

  • Component state analysis
  • Hook dependencies tracking
  • Automatic import management
  • Type-aware refactoring

Edit Operations

  • Multi-file edit operations
  • Complex refactoring operations
  • Workspace-wide changes
  • Conflict resolution system

Performance

  • Operation batching
  • Incremental update optimization
  • Memory usage optimization
  • Large file handling improvements

Testing

  • End-to-end test suite
  • Performance benchmarks
  • Load testing
  • Cross-platform testing

Documentation

  • API documentation
  • Integration guides
  • Deployment guide
  • Troubleshooting guide

Infrastructure

  • Remote server support
  • Configuration system
  • Plugin architecture
  • Workspace indexing

Monitoring

  • Performance metrics
  • Operation analytics
  • Health monitoring
  • Resource usage tracking

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

Documentation

Architecture and Design

Our documentation covers:

  • System architecture and design principles
  • Component interactions and dependencies
  • Framework integration patterns
  • Language server specifications
  • Implementation guidelines and best practices
  • Security considerations
  • Performance optimization strategies

For additional documentation needs, see our Incomplete Tasks section.

License

MIT

Development Status

Currently in alpha stage (v0.0.10) with basic TypeScript/JavaScript support and React component analysis. See the Incomplete Tasks section for planned features.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
DeepChatYour AI Partner on Desktop
Playwright McpPlaywright MCP server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.