Cedardiff MCP Server
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
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cedardiff MCP Serveredit_file script='SELECT * FROM functions WHERE name LIKE "test_%"'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 commandsTakes 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
Related MCP server: ast-editor
Development
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchInstallation
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 inspectorThe 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.jsonUpdated
tsconfig.jsonto 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
importinstead ofrequire()for module importsUse
.jsextension when importing local files
Available Tools
1 tooledit_fileC
Edit a file using CEDARScript syntax
Inputs: script (required), workingDir (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'edit_file' has a clearly distinct purpose that cannot be confused with any other tool in this set.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'edit_file' follows a clear verb_noun pattern, and there are no other tools to cause inconsistency.
A single tool is generally too few for most server purposes, as it limits functionality and suggests an incomplete or narrow scope. For a server named 'Cedardiff MCP Server' which implies CEDAR-related operations, one tool feels insufficient to cover typical needs like validation, querying, or other file operations.
The server is severely incomplete for its apparent domain of CEDAR operations. With only an 'edit_file' tool, there are obvious gaps such as creating, reading, validating, or deleting files, and no coverage of other CEDAR-related tasks like policy management or analysis.
Related MCP Connectors
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Ask who calls a route, what a change breaks or who reads a field, across a system's repos.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA runtime-free MCP server that converts source code into AST🌲, regardless of language.89MIT
- AlicenseAqualityBmaintenanceAST-targeted code editing MCP server with 28 surgical tools for structural edits across 11 languages. Built on tree-sitter, replaces brittle search/replace with byte-correct edits keyed by symbol names.228MIT
- AlicenseNot gradedqualityDmaintenanceTransforms TypeScript and JavaScript codebases into a persistent code knowledge graph in SQLite, enabling structural codebase navigation via deterministic graph queries without reading source files.26 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables parsing, indexing, and querying source code as structured knowledge, providing code exploration, spec generation, and migration tools via 20 MCP tools.MIT