mcp_server_proj_fc3

mcp_server_proj_fc3

3.1

If you are the rightful owner of mcp_server_proj_fc3 and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This document provides a comprehensive guide to deploying and utilizing a Python-based FC MCP SSE Server application.

注:当前项目为 Serverless Devs 应用,由于应用中会存在需要初始化才可运行的变量(例如应用部署地区、函数名等等),所以不推荐直接 Clone 本仓库到本地进行部署或直接复制 s.yaml 使用,强烈推荐通过 s init ${模版名称} 的方法或应用中心进行初始化,详情可参考部署 & 体验

fcai-start-mcp-python-hello-world 帮助文档

基于 Python 的 FC MCP SSE Server 案例

资源准备

使用该项目,您需要有开通以下服务并拥有对应权限:

服务/业务权限相关文档
函数计算AliyunFCFullAccess帮助文档 计费文档

部署 & 体验

案例介绍

基于 FastMCP 和 Starlette 构建的 Serverless 服务端事件(SSE)应用

功能特性

  • 使用 FastMCP 框架实现 SSE 协议支持
  • 集成 Starlette 高性能 ASGI 服务器
  • 提供示例工具端点 hello 返回 "Hello World!"
  • 支持阿里云函数计算部署

使用流程

调试

部署完成后,取得触发器 URL,即可使用任意支持 SSE 的 MCP Client 进行调试。您也可以使用 MCP 官方的调试器进行测试:

npx @modelcontextprotocol/inspector node build/index.js

注意:填写 URL 时,需加上 /sse 后缀。

二次开发指南

环境要求

  • Python ≥3.10
  • pip 包管理工具

安装依赖

pip install -r requirements.txt

本地运行

uvicorn main:app --host 0.0.0.0 --port 9000