Port Mcp Server 2wj

Port Mcp Server 2wj

🚀 端口 MCP 服务器

这是一个用于 Port.io API 的模型上下文协议(MCP)服务器,它能让 Claude 与 Port.io 的开发者平台功能进行交互,为开发工作带来便利。

🚀 快速开始

本服务器可使 Claude 与 Port.io 开发者平台交互,下面将为你介绍具体的安装和使用方法。

✨ 主要特性

端口 MCP 服务器功能

  • 模型管理:支持加载和管理多个语言模型。
  • 推理接口:提供统一的推理接口,简化调用流程。
  • 结果处理:自动解析推理结果,并提供多种格式输出。

📦 安装指南

获取你的 Port 凭证

  1. 创建一个 Port.io 帐户:
    • 访问 Port.io
    • 若没有帐户,则注册一个新的帐户
  2. 创建 API 密钥:
    • 进入你的 Port.io 仪表盘
    • 转到设置 > 凭证
    • 保存客户端 ID 和客户端秘密

Claude Desktop 配置

在你的 claude_desktop_config.json 中添加以下内容:

{
"mcpServers": {
"portMCP": {
"type": "custom",
"endpoint": "http://localhost:8000"
}
}
}

在 Cursor 中配置

在你的 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 平台无缝集成,提升开发效率。

  • 0 关注
  • 0 收藏,32 浏览
  • system 提出于 2025-10-05 19:54

相似服务问题

相关AI产品