使用说明
自定义MCP服务器
一个定制的机器对话协议(MCP)服务器,集成了用于AI助手的各种工具:
- 勇敢的搜索 -Web和本地搜索功能
- 安全文件系统 -具有安全控制的文件操作
- GitHub集成 -存储库和代码管理
- 顺序思维 -逐步解决问题
- 下载实用程序 -从互联网下载文件
快速开始
# Clone the repository
git clone https://github.com/degenhero/custom-mcp-server.git
cd custom-mcp-server
# Install dependencies and set up environment
npm run install:all
# Start both servers
npm run start:both
服务器将在以下位置运行:
- MCP服务器:http://localhost:3000
- MCP协议服务器:http://localhost:3001
与Claude一起使用
要将此自定义MCP服务器与Claude一起使用,您需要将其安装为MCP服务器:
npx @anthropic-ai/install-mcp custom-mcp-server http://localhost:3001
安装后,Claude将可以访问此服务器提供的所有功能。
建筑
该项目由两个主要部分组成:
- 自定义MCP服务器 (index.js)-实现所有工具功能的核心服务器
- MCP协议服务器 (mcp-protocol.js)-使自定义服务器适应mcp协议标准
可用功能
勇敢的搜索
brave_web_search-执行网络搜索brave_local_search-搜索当地企业和地点
文件系统操作
read_file-读取文件内容write_file-创建或更新文件edit_file-进行基于行的编辑create_directory-创建目录list_directory-列出目录内容- 还有更多。..
GitHub集成
create_repository-创建新存储库search_repositories-搜索存储库get_file_contents-从存储库读取文件push_files-将文件推送到存储库- 还有更多。..
顺序思维
sequentialthinking-逐步解决问题
下载实用程序
download_file-从URL下载文件download_multiple_files-一次下载多个文件
配置
配置是通过环境变量进行管理的 .env 文件:
PORT=3000 # Port for the main server
MCP_PROTOCOL_PORT=3001 # Port for the MCP protocol server
BRAVE_API_KEY=your_key_here # API key for Brave Search
GITHUB_TOKEN=your_token_here # GitHub access token
发展
添加新功能
要添加新功能,请执行以下操作:
- 在相应的文件中创建处理程序
functions目录 - 将函数定义添加到
mcp-schema.json - 更新中的路由
index.js
测试
您可以直接在MCP服务器上测试功能:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"functionName": "brave_web_search", "parameters": {"query": "test query"}}'
文档
有关所有可用功能的详细文档,请参阅 documentation.md.
许可证
此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。
