Cover image
Try Now
2025-04-14

Coreshub的MCP服务器:https://coreshub.cn/

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

CoreshubMCP服务器

1、项目结构

src/coreshub_mcp_server/
├── plugins/           # 插件目录,所有工具和提示插件
├── utils/             # 工具函数
│   └── signature.py   # 签名工具函数
├── base_plugin.py     # 工具和提示基类
├── settings.py        # 配置管理
└── server.py          # MCP服务器实现

2、运行

2.1、在命令行运行

(1)首先配置环境变量

可以在代码中配置,在settings.py中配置

class Settings:
    access_key = os.getenv("QY_ACCESS_KEY_ID","基石智算的AK")
    secret_key = os.getenv("QY_SECRET_ACCESS_KEY","基石智算的SK")
    user_id = os.getenv("CORESHUB_USER_ID","基石智算的账户ID")

或者在本机系统环境变量配置

export QY_ACCESS_KEY_ID="基石智算的AK"
export QY_SECRET_ACCESS_KEY="基石智算的SK"
export CORESHUB_USER_ID="基石智算的账户ID"

(2)在项目根目录使用 uv直接运行

uv run src/coreshub_mcp_server

命令行参数

  • --debug: 启用调试模式,输出详细日志
  • --list-plugins: 列出所有已加载的插件
  • --log-file: 指定日志文件路径

2.2、在Cherry Studio中运行

在Cherry Studio的设置——MCP服务器——添加服务器,进入编辑模式

命令填写:

sh

参数填写:

-c
cd 项目根目录路径 && uv run src/coreshub_mcp_server

环境变量填写:

QY_ACCESS_KEY_ID=基石智算的AK
QY_SECRET_ACCESS_KEY=基石智算的SK
CORESHUB_USER_ID=基石智算的账户ID

3、开发

3.1、添加新工具

src/coreshub_mcp_server/plugins 目录下创建新的Python文件,然后实现 BaseTool 和/或 BasePrompt 的子类。工具和提示现在是分离的概念,可以根据需要只实现其中一种或两种。

(1)工具实现示例:

from coreshub_mcp_server.base_plugin import BaseTool

class MyTool(BaseTool):
  tool_name = "my_tool"
  tool_description = "我的自定义工具"

  @staticmethod
  def model_json_schema():
    return {
      "type": "object",
      "properties": {
        "param": {
          "type": "string",
          "description": "参数描述"
        }
      }
    }

  async def execute_tool(self, arguments):
    # 实现工具逻辑
    pass

# 注册工具
MyTool.register()

(2)提示实现示例:

from coreshub_mcp_server.base_plugin import BasePrompt
from mcp.types import PromptArgument

class MyPrompt(BasePrompt):
  prompt_name = "my_prompt"
  prompt_description = "我的自定义提示"
  prompt_arguments = [
    PromptArgument(
      name="param",
      description="参数描述",
      required=False
    )
  ]

  async def execute_prompt(self, arguments=None):
    # 实现提示逻辑
    pass

# 注册提示
MyPrompt.register()

可用工具

1、get_epfs_filesystem 返回已经创建的epfs文件系统

  • zone
    • type: string
    • description: 区域标识,从上下文获取,选项:xb3,xb2,hb2
    • default: xb3
    • required: True
  • owner
    • type: string
    • description: 用户名
    • default: 基石智算的账户ID
    • required: True
  • user_id
    • type: string
    • description: 容器实例的拥有者ID,可以从上下文字段user_id获取
    • default: 基石智算的账户ID
    • required: True

2、get_epfs_bill_info 返回epfs文件系统的账单信息

  • resource_id
    • type: string
    • description: 资源ID,从上下文resource_id字段获取
    • required: True
  • zone
    • type: string
    • description: 区域标识,从上下文获取,选项:xb3,xb2,hb2
    • default: xb3
    • required: True
  • owner
    • type: string
    • description: 用户名
    • default: 基石智算的账户ID
    • required: True
  • user_id
    • type: string
    • description: 容器实例的拥有者ID,从上下文字段user_id获取
    • default: 基石智算的账户ID
    • required: True

3、get_container_info 返回已经创建的容器实例,也可根据参数进行查询

  • limit
    • type: integer
    • description: 返回结果的最大数量
    • default: 10
    • required: False
  • offset
    • type: integer
    • description: 分页偏移量
    • default: 0
    • required: False
  • zone
    • type: string
    • description: 区域标识,从上下文获取,选项:xb3,xb2,hb2
    • default: xb3
    • required: True
  • name
    • type: string
    • description: 按照实例名字进行模糊搜索
    • default: ""
    • required: False

4、get_ssh_info 返回特定实例的SSH信息

  • namespace
    • type: string
    • description: 容器实例的命名空间,从上下文字段namespace获取
    • default: 小写的基石智算账户ID
    • required: True
  • uuid
    • type: string
    • description: 容器实例的uuid,可以从上下文uuid中获取
    • required: True
  • zone
    • type: string
    • description: 区域标识,从上下文获取
    • default: xb3
    • required: True
  • owner
    • type: string
    • description: 容器实例的拥有者,可以从上下文字段user_id获取
    • default: 基石智算的账户ID
    • required: True
  • user_id
    • type: string
    • description: 容器实例的拥有者ID,可以从上下文字段user_id获取
    • required: True
  • services
    • type: array
    • description: 要开启的服务列表
    • default: ["ssh", "custom", "node_port"]
    • required: True

5、get_distributed_training 返回已经创建的分布式训练任务

  • end_at
    • type: string
    • description: 结束时间,格式为%Y-%m-%d %H:%M:%S
    • default: 当前时间
    • required: True
  • start_at
    • type: string
    • description: 开始时间,格式为%Y-%m-%d %H:%M:%S
    • default: 默认为一周前时间
    • required: True
  • limit
    • type: integer
    • description: 每页显示的条数
    • default: 10
    • required: True
  • offset
    • type: integer
    • description: 偏移量
    • default: 0
    • required: True
  • zone
    • type: string
    • description: 区域
    • default: 默认为xb3,可选xb2,hb2
    • required: True
  • owner
    • type: string
    • description: 所有者
    • default: 基石智算的账户ID
    • required: True
  • user_id
    • type: string
    • description: 用户ID
    • default: 基石智算的账户ID
    • required: True

6、get_distributed_training_detail_log 返回分布式训练任务的详细日志

  • end_time
    • type: string
    • description: 结束时间,格式为纳秒时间戳1745304819402256896
    • default: 当前时间
    • required: True
  • start_time
    • type: string
    • description: 开始时间,格式为纳秒时间戳1745283219402259200
    • default: 默认为12小时前
    • required: True
  • fuzzy
    • type: boolean
    • description: 是否模糊
    • default: True
    • required: False
  • reverse
    • type: boolean
    • description: 是否反转
    • default: True
    • required: True
  • size
    • type: integer
    • description: 每页显示的条数
    • default: 100
    • required: True
  • train_uuid
    • type: string
    • description: 训练ID
    • default: 来自上下文train_uuid,如果上下文没有,则需要询问,从get_distributed_training获取
    • required: True
  • zone
    • type: string
    • description: 区域
    • default: 默认为xb3,可选xb2、hb2
    • required: True
  • owner
    • type: string
    • description: 所有者
    • default: 基石智算的账户ID
    • required: True
  • user_id
    • type: string
    • description: 用户ID
    • default: 基石智算的账户ID
    • required: True

7、get_inference_service 返回已经创建的推理服务

  • zone
    • type: string
    • description: 区域标识,从上下文获取,选项:xb3,xb2,hb2
    • default: xb3
    • required: True
  • owner
    • type: string
    • description: 用户名
    • default: 基石智算的账户ID
    • required: True
  • key_words
    • type: string
    • description: 关键字
    • default: ""
    • required: False
  • page
    • type: integer
    • description: 页码
    • default: 1
    • required: False
  • size
    • type: integer
    • description: 每页数量
    • default: 10
    • required: False

8、get_inference_service_log 返回推理服务日志

  • zone
    • type: string
    • description: 区域标识,从上下文获取,选项:xb3,xb2,hb2
    • default: xb3
    • required: True
  • owner
    • type: string
    • description: 用户名
    • default: 基石智算的账户ID
    • required: True
  • service_id
    • type: string
    • description: 服务ID
    • default: 来自上下文service_id,如果上下文没有,则需要询问,从get_inference_service获取
    • required: True
  • size
    • type: integer
    • description: 每页数量
    • default: 100
    • required: True
  • reverse
    • type: boolean
    • description: 是否反转
    • default: True
    • required: True
  • start_time
    • type: string
    • description: 开始UTC时间
    • default: 默认为24小时前时间,格式为%Y-%m-%dT%H:%M:%S.000Z
    • required: False
  • end_time
    • type: string
    • description: 结束UTC时间
    • default: 默认为当前时间,格式为%Y-%m-%dT%H:%M:%S.000Z
    • required: False

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • paulwing
  • 使用MCP服务创建的测试存储库

    Reviews

    3.2 (9)
    Avatar
    user_dZUBol1L
    2025-04-24

    I've been using the mcp-server-coreshub for a while now, and it has significantly improved my productivity. The seamless integration with my existing systems and the user-friendly interface make it a standout tool. The reliable performance and excellent support from the coreshub team are commendable. Highly recommend!

    Avatar
    user_61D6N4cr
    2025-04-24

    As an avid user of mcp-server-coreshub, I must say this product excels in delivering reliable and efficient server management solutions. Created by the dedicated team at coreshub, its seamless integration and user-friendly interface make it a top choice for both beginners and advanced users. The support and continuous updates ensure a smooth experience, keeping my projects running flawlessly. Highly recommend!

    Avatar
    user_3cXBkiM6
    2025-04-24

    I've been using mcp-server-coreshub for a while now and it has been an outstanding experience. Coreshub has truly created a stellar product that simplifies server management. The interface is user-friendly and the efficiency it brings to my workflow is unmatched. Highly recommend it to anyone looking for a reliable server management tool.

    Avatar
    user_K3U7ve0a
    2025-04-24

    I have been using mcp-server-coreshub for a few weeks now and it has significantly streamlined my server management tasks. Developed by coreshub, this product offers a seamless and efficient user experience. It's clear that a lot of thought went into the design and functionality, making it a solid solution for anyone looking to enhance their server operations. Highly recommended!

    Avatar
    user_LgylExOP
    2025-04-24

    The mcp-server-coreshub is an outstanding product by Coreshub. It's a reliable server solution that excels in performance and flexibility. The seamless integration and user-friendly interface make it a pleasure to use. Highly recommend for anyone seeking a robust and efficient server experience.

    Avatar
    user_JU2cG1yC
    2025-04-24

    As a dedicated user of mcp-server-coreshub, I must say this product is phenomenal! The seamless integration and robust performance have significantly improved our server management. Coreshub has truly outdone themselves with this creation. From installation to daily operations, the experience has been smooth and efficient. Highly recommend it to anyone looking for a reliable server solution!

    Avatar
    user_jfhwXGSV
    2025-04-24

    I've been using mcp-server-coreshub for a while now, and it has significantly improved the efficiency of my workflow. The seamless integration and user-friendly interface make it a top choice for server management. Coreshub has really outdone themselves with this product. Highly recommended for both beginners and advanced users looking for a reliable server management tool.

    Avatar
    user_YXNYsgOz
    2025-04-24

    mcp-server-coreshub by coreshub is a robust and reliable server application. It offers seamless integration and excellent performance, making it a go-to choice for any serious developer. The setup process is straightforward, and the support team is responsive and helpful. Highly recommended for anyone in need of a solid server solution.

    Avatar
    user_GzDgffLg
    2025-04-24

    I've been using mcp-server-coreshub by coreshub for a while now, and it has exceeded my expectations. The seamless integration and robust performance make it an essential tool for my server management needs. The interface is user-friendly, and the support team is incredibly responsive. Highly recommend for anyone looking for a reliable server solution.