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.2

默认情况下,这个服务使用 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.3.tar.gz (4.9 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.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hexagram_mcp_service-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 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.3.tar.gz
Algorithm Hash digest
SHA256 a25514e9a390626c870d699f186f19c130f025989f72eafa7e34619c34d06b2a
MD5 2af7455e6ecd51d9e1577fd786a2aeb5
BLAKE2b-256 0e4608fff5e88b1af2b4907dc2de33acfaeb2f3e017bf7c39102c6f470833325

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hexagram_mcp_service-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d2fa227b44331a8b82600aa4b8dc6f25f749dd4b640cb7663d6f009fa0d81318
MD5 ee00a5c89f4e0f99455ec0884b2b8a01
BLAKE2b-256 4b52c126e63db015b90165701cd9c42f3e782d8a4f53ccfee1640957a7a4040f

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