这是一个用于 Port.io API 的模型上下文协议(MCP)服务器,它能让 Claude 与 Port.io 的开发者平台功能进行交互,为开发工作带来便利。
本服务器可使 Claude 与 Port.io 开发者平台交互,下面将为你介绍具体的安装和使用方法。
在你的 claude_desktop_config.json 中添加以下内容:
{
"mcpServers": {
"portMCP": {
"type": "custom",
"endpoint": "http://localhost:8000"
}
}
}
在你的 settings.json 或 .env 文件中添加以下内容:
# settings.json
{
"mcpServers": {
"portMCP": {
"type": "custom",
"endpoint": "http://localhost:8000"
}
}
}
# .env 文件
MCP_SERVERS_PORT_MCP_TYPE=custom
MCP_SERVERS_PORT_MCP_ENDPOINT=http://localhost:8000
# 加载默认模型
curl -X POST http://localhost:8000/load-model?model_name=default
# 加载自定义模型
curl -X POST http://localhost:8000/load-model?model_name=my_custom_model
# 单句推理
curl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"input": "你的输入内容"}'
# 批量推理
curl -X POST http://localhost:8000/batch-predict \
-H "Content-Type: application/json" \
-d '{"inputs": ["输入1", "输入2"]}'
# 获取单个结果
curl http://localhost:8000/results/123
# 获取批量结果
curl http://localhost:8000/batch-results?ids=123,456
# 安装依赖
pip install -r requirements.txt
# 启动服务器
python -m src.port_mcp_server
# 更新版本号
make release VERSION=1.0.0
# 手动步骤(如需要)
git tag v1.0.0
git push --tags
本 MCP 服务器根据 MIT 许可证发布。这意味着你可以自由使用、修改和分发软件,但需遵守 MIT 许可证的条款。更多详情,请参阅项目存储库中的 LICENSE 文件。
通过以上指南,您可以轻松配置并使用端口 MCP 服务器,与 Port.io 平台无缝集成,提升开发效率。