Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

cedarscript-mcp

MCP.Pizza Chef: th3w1zard1

The cedarscript-mcp is a TypeScript-based MCP server that integrates CEDARScript, a SQL-like language designed for sophisticated code manipulation. It offers a comprehensive grammar supporting DDL and DML operations on files, functions, classes, and methods. The server enables complex pattern matching using regex, prefix/suffix, and indentation rules, facilitating block-level code transformations. Its primary tool, 'edit_file', executes CEDARScript commands to create, delete, move, and update files with pattern-based code changes. While command parsing and grammar are robust, file writing mechanisms are still being refined. This MCP server is ideal for developers seeking automated, grammar-driven code editing within MCP-enabled environments.

Use This MCP server To

Automate code refactoring with SQL-like commands Perform pattern-based code transformations Create, delete, and move files programmatically Edit functions, classes, and methods via scripts Integrate grammar-driven code manipulation in workflows

README

cedardiff MCP Server

Edit files with CEDARScript grammar rules

This is a TypeScript-based MCP server that implements CEDARScript, a SQL-like language for code manipulation. It provides:

  • A comprehensive grammar for code manipulation commands
  • Tools for executing CEDARScript operations
  • Support for complex pattern matching and transformations

Features

Grammar

  • SQL-like syntax for code operations (DDL, DML)
  • Support for file, function, class, and method targeting
  • Pattern matching with regex, prefix/suffix, and indentation rules
  • Block-level code manipulation capabilities

Tools

  • edit_file - Execute CEDARScript commands
    • Takes script and working directory as parameters
    • Supports file creation, deletion, moving, and updating
    • Pattern-based code transformations

Implementation Status

Current testing has revealed:

  • Command parsing works correctly
  • Grammar supports complex operations
  • File writing mechanism needs improvement
  • Success messages returned but changes not persisted

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "cedardiff": {
      "command": "/path/to/cedardiff/build/index.js"
    }
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

ES Module Migration

The project has been migrated to use ES modules. Key changes include:

  • Added "type": "module" to package.json
  • Updated tsconfig.json to use "module": "ESNext"
  • Converted import/export statements to ES module syntax
  • Updated type definitions to be compatible with ES modules

Compatibility Notes

  • Ensure you are using Node.js version 12 or higher
  • Use import instead of require() for module imports
  • Use .js extension when importing local files

cedarscript-mcp FAQ

How do I execute a CEDARScript command with cedarscript-mcp?
Use the 'edit_file' tool, providing the script and working directory parameters to run CEDARScript operations.
What types of code elements can cedarscript-mcp target?
It supports targeting files, functions, classes, and methods for manipulation.
Does cedarscript-mcp support complex pattern matching?
Yes, it supports regex, prefix/suffix, and indentation-based pattern matching for precise code transformations.
Is the file writing mechanism fully stable?
Currently, file writing needs improvement; testing is ongoing to enhance reliability.
Can cedarscript-mcp handle block-level code manipulations?
Yes, it provides capabilities for block-level editing and transformations.
What programming language is cedarscript-mcp implemented in?
It is implemented in TypeScript for robust MCP server functionality.
How does cedarscript-mcp integrate with LLM providers?
It can be used alongside LLMs like OpenAI, Claude, and Gemini to enable grammar-based code editing workflows.
Are there any limitations on the types of files cedarscript-mcp can edit?
It primarily targets code files compatible with CEDARScript grammar but can be extended as needed.