@jingjingbox/mcp-cli-bridge
Click on "Install 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., "@@jingjingbox/mcp-cli-bridgeCreate entities for React and TypeScript in the knowledge graph"
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.
@jingjingbox/mcp-cli-bridge
MCP-CLI 桥接服务器 - 通过 MCP 协议调用 CLI 工具,为 AI 助手提供强大的知识图谱和文件读取能力。
简介
@jingjingbox/mcp-cli-bridge 是一个基于 Model Context Protocol (MCP) 的桥接服务器,它将 CLI 工具的能力通过 MCP 协议暴露给 AI 助手(如 TraeCN)。
核心特性
知识图谱管理: 创建实体、建立关系、搜索节点,构建完整的知识网络
文件读取: 高效读取文件头部或尾部内容,支持大文件处理
进程隔离: CLI 插件运行在独立进程中,崩溃不影响主服务
NativeAOT 编译: 极致性能,超小体积,快速启动
渐进式加载: 工具按需加载,不占用上下文空间
系统要求
操作系统: Windows x64
Node.js: >= 14.0.0
运行时: .NET 10.0 Runtime (已包含在包内)
安装
全局安装
npm install -g @jingjingbox/mcp-cli-bridge使用 npx(推荐)
无需安装,直接运行:
npx @jingjingbox/mcp-cli-bridge配置
环境变量
变量 | 描述 | 必填 |
| MemoryCli 知识图谱数据存储目录 | 是 |
数据文件会自动创建:
memory.jsonl- 实体数据memory_relations.jsonl- 关系数据
TraeCN 配置示例
在 TraeCN 的 MCP 配置中添加:
{
"mcpServers": {
"cli-bridge": {
"type": "stdio",
"command": "npx",
"args": ["@jingjingbox/mcp-cli-bridge"],
"enabled": true,
"env": {
"MCP_MEMORY_PATH": "D:\\MCP\\Memory"
}
}
}
}全局安装配置
{
"mcpServers": {
"cli-bridge": {
"type": "stdio",
"command": "mcp-cli-bridge",
"enabled": true,
"env": {
"MCP_MEMORY_PATH": "D:\\MCP\\Memory"
}
}
}
}工具列表
Host 层工具(直接暴露)
工具名 | 描述 |
| 搜索可用的 CLI 工具 |
| 执行指定的 CLI 工具命令 |
| 获取工具描述信息 |
| 列出所有可用工具 |
| 检查包安装状态 |
| 安装指定包 |
MemoryCli 工具(知识图谱)
通过 tool_execute 调用,命令前缀为 memory_:
工具名 | 描述 |
| 创建多个实体到知识图谱 |
| 在实体之间创建关系 |
| 读取整个知识图谱 |
| 搜索知识图谱中的节点 |
| 向实体添加观察记录 |
| 删除实体及其关系 |
| 按名称获取特定节点 |
FileReaderCli 工具(文件读取)
通过 tool_execute 调用,命令前缀为 file_reader_:
工具名 | 描述 |
| 读取文件前 N 行 |
| 读取文件后 N 行 |
使用示例
创建知识实体
{
"command": "memory_create_entities",
"entities": [
{
"name": "React",
"entityType": "Framework",
"observations": ["用于构建用户界面的 JavaScript 库", "由 Meta 维护"]
},
{
"name": "TypeScript",
"entityType": "Language",
"observations": ["JavaScript 的超集", "添加了静态类型检查"]
}
]
}建立实体关系
{
"command": "memory_create_relations",
"relations": [
{
"from": "React",
"to": "TypeScript",
"relationType": "supports"
}
]
}搜索知识节点
{
"command": "memory_search_nodes",
"query": "React"
}读取文件头部
{
"command": "file_reader_read_head",
"filePath": "C:\\project\\logs\\app.log",
"lineCount": 20
}读取文件尾部
{
"command": "file_reader_read_tail",
"filePath": "C:\\project\\logs\\error.log",
"lineCount": 50
}架构设计
McpHost/
├── McpHost.exe # MCP 主机服务
├── MemoryCli.exe # 知识图谱 CLI 插件
├── FileReaderCli.exe # 文件读取 CLI 插件
└── index.js # npm 入口文件McpHost: MCP 协议服务器,负责工具暴露和 CLI 进程管理
MemoryCli: 知识图谱管理,支持实体、关系、观察记录的 CRUD
FileReaderCli: 高效文件读取,支持大文件的头部/尾部读取
技术栈
.NET 10.0 - 运行时平台
NativeAOT - 原生编译,极致性能
C# 13 - 编程语言
JSON-RPC 2.0 - CLI 通信协议
MCP Protocol - AI 助手通信协议
开发
源码仓库
git clone https://gitee.com/JJbox/memory.git构建
# 使用 PowerShell
.\build.ps1测试
# 单元测试
dotnet test McpHost.slnx
# E2E 测试
dotnet run --project tests\E2E\MyMemoryServer.E2E.csproj -c Release详细文档
MemoryCli 使用说明 - 知识图谱完整 API 文档
FileReaderCli 使用说明 - 文件读取完整 API 文档
许可证
作者
JJbox
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/liuqihonggit/mcp-cli-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server