Obsidian
Mac
在Mac使用终端命令安装DMG
终端无法访问外挂硬盘
小诗词
SSH 无密码登录及 Rsync 同步配置笔记
Cron专题
at 命令笔记
Kostal 服务器密码
Docker 安装指南
MySQL Workbench 数据库迁移:哪些内容不需要迁移?
kostia
配置管理系统(ConfigManager)设计说明
提取部署Nginx证书
Qdrant 数据库备份
交叉编码器微调中文笔记
docker
docker-compose
chevereto-compose.yml
Dify
MCP
HelloWold-Server
HelloWold-Client
Vue3
images
基于Qwen的分类器实现
Kochi Repo XML 配置编写教程
讲义
本文档使用 MrDoc 发布
-
+
首页
HelloWold-Server
```python from fastmcp import FastMCP mcp = FastMCP(name="MyServer") hello_call_count = 0 # Hello接口调用次数计数器 @mcp.tool() def hello(name: str) -> str: global hello_call_count hello_call_count += 1 return f"你好,{name}!调用次数:{hello_call_count}" @mcp.tool() def get_hello_count() -> int: """返回Hello接口的总调用次数""" return hello_call_count if __name__ == "__main__": mcp.run(transport="streamable-http", host="0.0.0.0", port=8080) ``` ## 参考文档 https://gofastmcp.com/servers/fastmcp
admin
2025年5月22日 13:24
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码