关于 filesystem
filesystem 是基于 mcp-framework 构建的 MCP 服务项目,包含示例工具及添加更多工具的说明,面向构建和扩展 MCP 工具的开发者。
主要功能
- 01MCP 服务起始项目
- 02附带示例工具
- 03通过命令行创建工具
- 04TypeScript 工具结构
- 05Claude Desktop 配置说明
适用场景
- 01启动 MCP 服务项目
- 02添加自定义工具
- 03构建并测试工具修改
- 04将服务连接到 Claude Desktop
MCP 相关
这是基于 mcp-framework 构建的 MCP 服务。README 介绍了添加工具及配置 Claude Desktop 等客户端。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
filesystem
使用 mcp-framework 构建的 Model Context Protocol(MCP)服务。
快速开始
# Install dependencies
npm install
# Build the project
npm run build
项目结构
filesystem/
├── src/
│ ├── tools/ # MCP Tools
│ │ └── ExampleTool.ts
│ └── index.ts # Server entry point
├── package.json
└── tsconfig.json
添加组件
项目自带一个示例工具:src/tools/ExampleTool.ts。你可以使用 CLI 添加更多工具:
# Add a new tool
mcp add tool my-tool
# Example tools you might create:
mcp add tool data-processor
mcp add tool api-client
mcp add tool file-handler
工具开发
示例工具结构:
import { MCPTool } from "mcp-framework";
import { z } from "zod";
interface MyToolInput {
message: string;
}
class MyTool extends MCPTool<MyToolInput> {
name = "my_tool";
description = "Describes what your tool does";
schema = {
message: {
type: z.string(),
description: "Description of this input parameter",
},
};
async execute(input: MyToolInput) {
// Your tool logic here
return `Processed: ${input.message}`;
}
}
export default MyTool;
发布到 npm
-
更新你的 package.json:
- 确保
name唯一且符合 npm 命名规范 - 设置合适的
version - 添加
description、author、license等信息 - 检查
bin是否指向正确的入口文件
- 确保
-
在本地构建并测试:
npm run build npm link filesystem # Test your CLI locally -
登录 npm(如有需要,请创建账号):
npm login -
发布你的包:
npm publish
发布后,用户可以将其添加到 Claude 桌面客户端(见下文),也可以使用 npx 运行
## Using with Claude Desktop
### Local Development
Add this configuration to your Claude Desktop config file:
**MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
```json
{
"mcpServers": {
"filesystem": {
"command": "node",
"args":["/absolute/path/to/filesystem/dist/index.js"]
}
}
}
发布后
将以下配置添加到你的 Claude Desktop 配置文件中:
MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["filesystem"]
}
}
}
构建和测试
- 修改你的工具
- 运行
npm run build进行编译 - 服务启动时会自动加载你的工具
了解更多
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。