Skip to main content

A small Python MCP service ready for Alibaba Cloud Bailian custom MCP deployment.

Project description

Alibaba Cloud MCP Service

这是一个可以发布到 PyPI,并通过 uvx 在阿里云百炼自定义 MCP 中部署的 Python 服务。

特点

  • 默认使用 stdio 运行,适合阿里云的脚本部署方式
  • 同时保留 streamable-http 模式,方便本地调试或后续扩展
  • 提供了一个工具、一个资源和一个提示词,便于快速验证部署是否成功

打包发布

先构建包:

uv build

然后发布到 PyPI:

uv publish

如果你还没有配置 PyPI 凭据,可以先按 uv 的发布流程登录或设置 token,再执行发布。

本地运行

先安装依赖:

uv sync

然后启动服务:

uv run -m hexagram_mcp_service

如果想用 HTTP 方式调试:

set MCP_TRANSPORT=streamable-http
set MCP_PORT=8000
uv run -m hexagram_mcp_service

服务会监听 http://127.0.0.1:8000

在阿里云百炼里部署

在「MCP 管理」里选择「创建 MCP 服务」->「使用脚本部署」,然后把安装方式配置为 Python 的 uvx

推荐填写:

  • 命令:uvx
  • 参数:hexagram-mcp-service

这样阿里云会从 PyPI 拉取你的包,并直接启动导出的 console script。

如果你想显式指定版本,也可以使用:

  • 命令:uvx
  • 参数:hexagram-mcp-service==0.1.1

默认情况下,这个服务使用 stdio 作为脚本部署模式;如果你要本地调试 HTTP 模式,可以设置环境变量 MCP_TRANSPORT=streamable-http

可选的环境变量:

  • MCP_HOST:HTTP 绑定地址,默认 0.0.0.0
  • MCP_PORT:HTTP 端口,默认 8000
  • MCP_STREAMABLE_HTTP_PATH:HTTP 路径,默认 /mcp
  • MCP_JSON_RESPONSE:是否返回 JSON,默认 true
  • MCP_STATELESS_HTTP:是否启用无状态 HTTP,默认 true

可用能力

  • hexagram():按当前时间返回卦象名称
  • health():返回健康状态和运行时间
  • service://info:服务元数据资源
  • deployment_checklist(region):部署检查清单提示词

阿里云控制台填写建议

如果控制台要求填写服务描述,可以写成:

一个可通过 PyPI 发布并使用 uvx 部署的 MCP 服务,提供基础工具、资源和部署检查提示词。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexagram_mcp_service-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hexagram_mcp_service-0.1.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file hexagram_mcp_service-0.1.1.tar.gz.

File metadata

  • Download URL: hexagram_mcp_service-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hexagram_mcp_service-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ed9b4caa9628b37458c40e141f85bd4a10ff452ca20e3ee65b479a239434ca93
MD5 9acc89407e7485c07f188d7a5c77676e
BLAKE2b-256 3f823815d60a880b0ad183c972e376fe2747ed88774e26d61a97aaf21f0e125e

See more details on using hashes here.

File details

Details for the file hexagram_mcp_service-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hexagram_mcp_service-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hexagram_mcp_service-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f17eb3db775b2792979b675c82e3d8fe427cf3ee60d375f5eb6a3ca01f78573
MD5 e4a27d3eb9c3c92dceea77cfcfc88efb
BLAKE2b-256 162aacb041399282cfe7b55abd5e701442a40dfb5938024846549762506610aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page