粒子MCP服务器
MCP(模型上下文协议)服务器,提供对选定粒子网络通用帐户文档的访问。
特性
- 资源访问:将9个关键的粒子通用账户文档作为MCP资源公开。
- 内容缓存:具有可配置TTL的智能缓存(默认为24小时)。
- 内容解析:文档的结构化解析,包括部分、代码块和链接。
- 搜索功能:搜索所有文档内容。
- 内置工具:包括用于搜索、刷新和列出页面的工具。
安装
- 克隆存储库:
git clone https://github.com/soos3d/particle-mcp-server.git
cd particle-mcp-server- 创建并激活虚拟环境:
python3 -m venv .venv
source .venv/bin/activate- 安装依赖项:
pip install -r requirements.txt运行服务器
您可以直接从命令行运行服务器:
python3 main.py服务器将通过以下方式启动并监听MCP协议消息 stdio.
IDE设置
风帆设置
要将此服务器用作Windsurf中的工具源,请执行以下操作:
- 首选
Windsurf>Settings>Windsurf Settings>Cascade>Manage MCPs. - 点击
View Raw Config,这将打开一个JSON文件,mcp_config.json. - 添加以下配置:
{
"mcpServers": {
"particle-docs": {
"command": "/YOUR-PATH-TO/particle-mcp-server/.venv/bin/python3",
"args": ["/YOUR-PATH-TO/particle-mcp-server/main.py"],
"env": {}
}
}
}- 保存配置。点击
Refresh在MCP设置中。 - 服务器现在应该可以作为Windsurf中的工具使用。
可用工具
服务器公开了以下工具:
search_docs:搜索所有文档。refresh_resource:强制刷新特定页面的缓存内容。list_pages:列出所有可用的文档页面。
项目结构
particle-mcp-server/
├── src/ # Source code
│ ├── server.py # Main MCP server implementation
│ ├── config.py # Configuration and page definitions
│ ├── docs_fetcher.py # Fetches and caches documentation
│ ├── docs_parser.py # Parses and structures content
│ └── resources.py # MCP resource handlers
├── data/cache/ # Cached documentation content
├── requirements.txt # Python dependencies
└── main.py # Entry point