MCP-YNU - FastMCP 服务器
使用 FastMCP 的动态 MCP 服务器实现,可自动从相应目录加载工具、资源和提示。
特征
从
tools/
、resources/
和prompts/
目录动态加载模块自动发现和注册模块
简单的配置和可扩展性
类型提示可提高代码清晰度和静态分析能力
用于监控服务器活动的综合日志记录
最近更新
在整个代码库中添加了类型提示
改进了 MCP 实例处理
增加了日志记录功能
添加 MIT 许可证
更新了带有参考链接的文档
目录结构
用法
在适当的目录中创建模块
通过
from mcp_server import mcp
运行服务器:
示例模块
工具模块示例(tools/example.py)
资源模块示例(resources/example.py)
提示模块示例(prompts/example.py)
调试
更新
.env
中的MCP_TRANSPORT_TYPE
,执行python main.py
启动 mcp 服务器执行
npx @modelcontextprotocol/inspector
打开检查。选择
SSE
传输类型,URL 为http://localhost:<mcp_server_port>/sse
或选择STDIO
传输类型,命令为python
,参数为/path/to/main.py
要求
Python >= 3.10
FastMCP
参考链接
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
动态 MCP 服务器实现,可自动从各自的目录加载工具、资源和提示,从而轻松扩展和配置。
Related MCP Servers
- AsecurityAlicenseAqualityMCP server that builds itself by creating new tools as needed based on user requests (Requires restart of Claude Desktop to use newly created tools).Last updated -427The Unlicense
- -securityFlicense-qualityA configurable MCP server that dynamically loads capabilities from a remote configuration to bridge MCP clients with remote APIs for executing actions, accessing resources, and utilizing prompt templates.Last updated -5965
- AsecurityAlicenseAqualityA tool that dynamically generates and configures MCP servers by automatically creating necessary directories and files according to user specifications.Last updated -11619MIT License