Cedardiff MCP Server
cedardiff MCP 服务器
使用 CEDARScript 语法规则编辑文件
这是一个基于 TypeScript 的 MCP 服务器,它实现了 CEDARScript(一种用于代码操作的类 SQL 语言)。它提供:
代码操作命令的综合语法
执行 CEDARScript 操作的工具
支持复杂的模式匹配和转换
特征
语法
代码操作(DDL、DML)的类似 SQL 的语法
支持文件、函数、类和方法定位
使用正则表达式、前缀/后缀和缩进规则进行模式匹配
块级代码操作能力
工具
edit_file- 执行 CEDARScript 命令将脚本和工作目录作为参数
支持文件创建、删除、移动、更新
基于模式的代码转换
实施情况
目前的测试表明:
命令解析正确
语法支持复杂的操作
文件写入机制需要改进
返回成功消息但更改未持久化
Related MCP server: ast-editor
发展
安装依赖项:
npm install构建服务器:
npm run build对于使用自动重建的开发:
npm run watch安装
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"cedardiff": {
"command": "/path/to/cedardiff/build/index.js"
}
}
}调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
npm run inspector检查器将提供一个 URL 来访问浏览器中的调试工具。
ES 模块迁移
该项目已迁移至使用 ES 模块。主要变更包括:
向
package.json添加了"type": "module"更新了
tsconfig.json以使用"module": "ESNext"将 import/export 语句转换为 ES 模块语法
更新类型定义以与 ES 模块兼容
兼容性说明
确保您使用的是 Node.js 版本 12 或更高版本
使用
import而不是require()来导入模块导入本地文件时使用
.js扩展名
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.
Loading tool schema changelog…
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