MCPSharp vs filesystem
并排对比,帮你在这两个 MCP server 之间做选择。
MCPSharp by afrise | filesystem by modelcontextprotocol | |
|---|---|---|
| Stars | ★ 369 | ★ 85,748 |
| 30天用量 | — | — |
| 综合分 | 47 | 77 |
| 官方 | — | ✓ |
| 分类 | 开发者工具AI / LLM 工具 | 本地文件系统开发者工具效率工具 |
| 实现语言 | C# | TypeScript |
| 最近提交 | 7 个月前 | 本月 |
MCPSharp · 概述
MCPSharp 是一个用于构建 MCP 服务器和客户端的 .NET 库。
filesystem · 概述
功能丰富的文件系统操作 MCP 服务器,具有动态目录访问控制功能。
MCPSharp · 使用场景
- 为 Claude Desktop 等 AI 助手构建兼容 MCP 的 API
- 将现有 .NET 代码作为 MCP 端点暴露,只需最少的配置
- 与 Microsoft.Extensions.AI 和 Semantic Kernel 生态系统集成
filesystem · 使用场景
- 使 AI 模型能够读取和写入项目文件进行开发
- 允许 Claude 或其他 MCP 客户端浏览和分析代码库
- 为内容生成提供对特定目录的安全沙盒访问
MCPSharp · 安装
安装
dotnet add package MCPSharp快速开始
using MCPSharp;
public class Calculator
{
[McpTool("add", "Adds two numbers")]
public static int Add([McpParameter(true)] int a, [McpParameter(true)] int b)
{
return a + b;
}
}
await MCPServer.StartAsync("CalculatorServer", "1.0.0");Claude Desktop 配置
添加到 claude_desktop_config.json:
{
"mcpServers": {
"mcpsharp-example": {
"command": "dotnet",
"args": ["run", "--project", "/path/to/your/project.csproj"],
"env": {}
}
}
}filesystem · 安装
安装
使用 NPX
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/allowed/directory"
]
}
}
}使用 Docker
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/path/to/allowed/dir,dst=/projects/allowed/dir",
"mcp/filesystem",
"/projects"
]
}
}
}VS Code 扩展
点击 README 中的安装按钮直接在 VS Code 中安装。