EditorConfig MCP Server

EditorConfig MCP Server

An MCP-compliant server that formats files using .editorconfig rules.

2
Stars
2
Forks
2
Watchers
1
Issues
EditorConfig MCP Server provides a Model Context Protocol (MCP) compliant server that automatically formats project files according to .editorconfig rules. Designed to work with AI coding agents, it proactively enforces consistent code formatting and prevents common style errors before files are processed further. The server features robust API endpoints, semantic versioned routes, rate limiting, OpenAPI documentation, and JSON schema-based validation, supporting seamless integration into automated development workflows.

Key Features

Full Model Context Protocol compliance
Automated file formatting using .editorconfig rules
RESTful HTTP API with semantic versioning
OpenAPI 3.0 self-documenting specification
Input validation via JSON Schema
Stateless server design
Rate limiting (100 requests per minute)
Consistent error response format
Protection against directory traversal attacks
Health check and server manifest endpoints

Use Cases

Proactively formatting code in AI-assisted development workflows
Automated code style enforcement before linting or code review
Batch formatting of project files based on glob patterns
Integrating with MCP-compatible AI coding assistants
Standardizing formatting across collaborative coding projects
Reducing time AI agents spend fixing trivial formatting issues
Providing formatting as a network service in CI/CD pipelines
Validating formatting input through schema enforcement
Documenting formatting APIs through OpenAPI specs
Automated health monitoring of formatting services

README

EditorConfig MCP Server

A Model Context Protocol (MCP) compliant server that formats files using .editorconfig rules.

This project started from a specific workflow issue I kept running into. I found that while working with AI coding agents, they would often generate code with minor formatting errors, like trailing whitespace or inconsistent newlines. Our linters would then flag these issues, and the agent would spend valuable cycles fixing its own simple mistakes.

This EditorConfig MCP Server is the tool I built to solve that problem for myself. It acts as a proactive formatting gatekeeper, using your project's .editorconfig rules to ensure files are correct from the start. My hope is that it might be useful to others who've encountered a similar frustration in their AI-assisted development process.

Installation

Global Installation (Recommended)

bash
npm install -g editorconfig-mcp-server

Then start the server:

bash
editorconfig-mcp-server

Using npx (No Installation)

bash
npx editorconfig-mcp-server

Local Installation

bash
npm install editorconfig-mcp-server

Then add to your project's scripts in package.json:

json
{
  "scripts": {
    "format-server": "editorconfig-mcp-server"
  }
}

From Source

bash
git clone https://github.com/yourusername/editorconfig-mcp-server.git
cd editorconfig-mcp-server
npm install
npm start

Features

  • MCP Compliant: Follows all MCP design patterns and best practices
  • JSON Schema Validation: All inputs are validated using JSON Schema
  • Rate Limiting: Built-in rate limiting (100 requests/minute)
  • OpenAPI Spec: Self-documenting API with OpenAPI 3.0 specification
  • Versioned API: Uses semantic versioning with /v1/ prefix
  • Stateless: No state retained between requests
  • Security: Path validation prevents directory traversal attacks
  • Error Handling: Consistent error format with helpful hints

Installation

bash
npm install

Usage

Starting the Server

bash
# If installed globally
editorconfig-mcp-server

# Using npx
npx editorconfig-mcp-server

# With custom port
PORT=8080 editorconfig-mcp-server

# From source
npm start

The server will start on port 8432 by default.

Configuration

  • PORT - Server port (default: 8432)
    • Default port chosen to avoid conflicts with common development servers
    • Example: PORT=8080 editorconfig-mcp-server

Integration with AI Tools

Claude Code

To add this server to Claude Code, run:

bash
claude mcp add editorconfig npx editorconfig-mcp-server

Other MCP-Compatible Tools

This server is designed to be used with AI coding assistants that support MCP. Configure your AI tool to connect to:

  • Base URL: http://localhost:8432
  • Protocol: MCP over HTTP

API Endpoints

Tools (Actions)

POST /v1/tools/format_file

Format a single file using .editorconfig rules.

Request:

json
{
  "file_path": "src/index.js"
}

Response:

json
{
  "success": true,
  "file_path": "src/index.js",
  "bytes": 1234
}

POST /v1/tools/format_files

Format multiple files matching a glob pattern.

Request:

json
{
  "pattern": "**/*.js"
}

Response:

json
{
  "success": true,
  "pattern": "**/*.js",
  "count": 5,
  "files": ["src/index.js", "src/utils.js", ...]
}

Metadata

  • GET /openapi.json - OpenAPI 3.0 specification
  • GET /.well-known/mcp/servers.json - MCP server manifest
  • GET /health - Health check endpoint

Error Handling

All errors follow a consistent format:

json
{
  "error": "Error type",
  "message": "Human-readable message",
  "hint": "Helpful suggestion",
  "expected_format": {} // Optional, for validation errors
}

Rate Limiting

The server implements rate limiting:

  • Window: 1 minute
  • Max requests: 100 per window
  • Returns 429 status when exceeded

Security

  • Input validation using JSON Schema
  • Path traversal protection
  • Payload size limit (1MB)
  • Ignores sensitive directories (node_modules, .git)

Versioning

This project follows Semantic Versioning:

  • MAJOR version for incompatible API changes
  • MINOR version for backwards-compatible functionality additions
  • PATCH version for backwards-compatible bug fixes

To release a new version:

bash
# For a patch release (1.0.0 -> 1.0.1)
npm version patch

# For a minor release (1.0.0 -> 1.1.0)
npm version minor

# For a major release (1.0.0 -> 2.0.0)
npm version major

This will:

  1. Run the linter
  2. Update the version in package.json
  3. Create a git commit and tag
  4. Push the commit and tag to GitHub

Publishing

NPM Package

To publish this package to npm:

  1. Create an npm account at https://www.npmjs.com
  2. Login to npm: npm login
  3. Update version using npm version (see above)
  4. Run: npm publish

For automated publishing via GitHub:

  1. Add your npm token as a GitHub secret named NPM_TOKEN
  2. Create a GitHub release - the publish workflow will automatically publish to npm

MCP Server Registry

To register this server in the MCP registry:

  1. Ensure your server implements the MCP specification
  2. Host your server publicly (e.g., npm, GitHub releases)
  3. Submit a PR to the MCP registry repository

Development

bash
# Install dependencies
npm install

# Run linter
npm run lint

# Fix linting issues
npm run lint:fix

# Start server
npm start

License

MIT

Star History

Star History Chart

Repository Owner

Repository Details

Language JavaScript
Default Branch main
Size 91 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

JavaScript
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • MCP Text Editor Server

    MCP Text Editor Server

    A line-oriented text editor server implementing the Model Context Protocol for efficient and safe file editing.

    MCP Text Editor Server provides line-based text file editing capabilities through a Model Context Protocol-compliant API. It enables efficient partial file access, robust conflict detection, and multi-file atomic operations, optimized for integration with large language model tools. With flexible character encoding support and concurrent editing safeguards, it is suited for collaborative and automated environments requiring reliable and token-efficient file manipulation.

    • 175
    • MCP
    • tumf/mcp-text-editor
  • @reapi/mcp-openapi

    @reapi/mcp-openapi

    Serve multiple OpenAPI specs for LLM-powered IDE integrations via the Model Context Protocol.

    @reapi/mcp-openapi is a Model Context Protocol (MCP) server that loads and serves multiple OpenAPI specifications, making APIs available to LLM-powered IDEs and development tools. It enables Large Language Models to access, interpret, and work directly with OpenAPI docs within code editors such as Cursor. The server supports dereferenced schemas, maintains an API catalog, and offers project-specific or global configuration. Sponsored by ReAPI, it bridges the gap between API specifications and AI-powered developer environments.

    • 71
    • MCP
    • ReAPI-com/mcp-openapi
  • Rootly MCP Server

    Rootly MCP Server

    Seamlessly integrate Rootly incident management into MCP-compatible editors.

    Rootly MCP Server provides an MCP-compliant server to access and manage Rootly's incident management API from within editors like Cursor, Windsurf, and Claude. It enables context-rich workflows and tool generation based on Rootly’s OpenAPI specification, allowing users to resolve incidents directly within their development environment. The server supports flexible authentication and dynamic resource generation while ensuring smart pagination to optimize editor context windows.

    • 36
    • MCP
    • Rootly-AI-Labs/Rootly-MCP-server
  • Mem0 MCP Server

    Mem0 MCP Server

    Structured management of coding preferences using Mem0 and Model Context Protocol.

    Mem0 MCP Server implements a Model Context Protocol-compliant server for storing, retrieving, and searching coding preferences. It integrates with Mem0 and offers tools for persistent management of code snippets, best practices, and technical documentation. The server exposes an SSE endpoint for clients like Cursor, enabling seamless access and interaction with coding context data.

    • 506
    • MCP
    • mem0ai/mem0-mcp
  • Pica MCP Server

    Pica MCP Server

    A Model Context Protocol (MCP) server for seamless integration with 100+ platforms via Pica.

    Pica MCP Server provides a standardized Model Context Protocol (MCP) interface for interaction with a wide range of third-party services through Pica. It enables direct platform integrations, action execution, and intelligent intent detection while prioritizing secure environment variable management. The server also offers features such as code generation, form and data handling, and robust documentation for platform actions. It supports multiple deployment methods, including standalone, Docker, Vercel, and integration with tools like Claude Desktop and Cursor.

    • 8
    • MCP
    • picahq/mcp
  • mcp-server-apache-airflow

    mcp-server-apache-airflow

    A Model Context Protocol server for integrating Apache Airflow with MCP clients.

    mcp-server-apache-airflow provides a Model Context Protocol (MCP) server implementation that allows standardized interaction with Apache Airflow environments. By wrapping Airflow's REST API, it enables MCP clients to manage and orchestrate workflows, DAGs, and runs in a consistent and interoperable manner. This implementation leverages the official Apache Airflow client library to ensure robust compatibility and maintainability. It streamlines the management of Airflow resources by exposing comprehensive endpoint coverage for key workflow operations.

    • 109
    • MCP
    • yangkyeongmo/mcp-server-apache-airflow
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results