本项目是一个提供用户数据管理工具的Model Context Protocol (MCP)服务器实现,能有效助力用户进行数据管理。
git clone https://github.com/fujahgabriel/simple-mcp-server.git
cd simple-mcp-server
npm install
要编译TypeScript文件,可执行以下命令:
npm run build
此命令将完成以下操作:
build目录。若要监视更改并自动重新构建,可运行:
npm run watch
若要检查和测试您的MCP服务器工具,可按以下步骤操作:
npm run build
npm run inspector
http://localhost:5173可用。若要与Cursor一起使用此MCP服务器,您需要在MCP设置中进行配置。将以下配置添加到您的~/.cursor/mcp.json:
{
"my-mcp-server": {
"math": {
"command": "node",
"args": ["build/index.js"]
}
}
}
请确保:
npm run build构建项目。检索所有用户列表。
按名称检索特定用户。 参数:
user: string - 要检索的用户名mcp-server/
├── build/ # 编译后的JavaScript文件
├── index.ts # 主服务器实现
├── package.json # 项目依赖和脚本
└── tsconfig.json # TypeScript配置
@modelcontextprotocol/sdk: MCP SDK用于服务器实现。dotenv: 环境变量管理。typescript: TypeScript编译器。zod: 运行时类型验证。本项目采用MIT许可证。