目录结构mcp-time-server/│├── src/│ └── mcp_time_server/│ ├── __init__.py│ ├── server.py # MCP Server核心│ ├── tools.py # MCP工具实现│ └── main.py # CLI入口│├── tests/│ └── test_tools.py│├── pyproject.toml # 项目配置uv/pip核心├── README.md├── LICENSE├── .gitignore└── uv.lock # uv生成示例代码server.py主要用于注册工具from mcp.server.fastmcp import FastMCP from .tools import get_current_time mcp FastMCP(time-server) mcp.tool() def current_time() - str: Get current system time return get_current_time()tools.py工具相关代码实现from datetime import datetime def get_current_time(): return datetime.now().isoformat()main.pyfrom .server import mcp def main(): mcp.run()pyproject.toml配置[project] name mcp-time-server version 0.1.0 description MCP time server example authors [ {namezhiyang} ] dependencies [ mcp ] requires-python 3.10 [project.scripts] mcp-time-server mcp_time_server.main:main [build-system] requires [hatchling] build-backend hatchling.buildgithub发布git init git add . git commit -m init mcp server git remote add origin https://github.com/xxx/mcp-time-server.git git push -u origin mainuvx运行工具uvx --from githttps://github.com/xxx/mcp-time-server mcp-time-server