The Cedardiff MCP Server allows you to manipulate code using CEDARScript, a SQL-like language for code transformations.
- Execute commands to modify source code files within a specified working directory
- Perform pattern-based transformations using regex, prefix/suffix, and indentation rules
- Target specific code elements including files, functions, classes, or methods
- File operations: Create, delete, move, and update files
- Complex manipulation: Execute block-level code transformations with SQL-like syntax
Uses TypeScript for implementing the MCP server that provides CEDARScript capabilities for code manipulation
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:
Build the server:
For development with auto-rebuild:
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
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
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"
topackage.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 ofrequire()
for module imports - Use
.js
extension when importing local files
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Implements CEDARScript, a SQL-like language for code manipulation.
Related MCP Servers
- -securityAlicense-qualityFacilitates integration with the Cursor code editor by enabling real-time code indexing, analysis, and bi-directional communication with Claude, supporting concurrent sessions and automatic reconnection.Last updated -2238TypeScriptMIT License
- -securityFlicense-qualityA server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.Last updated -Python
- -securityFlicense-qualityA natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.Last updated -2Python
- -securityFlicense-qualityA tool that provides simple API to execute SQL queries and manage MySQL databases, designed to integrate with Cursor IDE for AI assistants to directly perform database operations.Last updated -Python