FastMCP库存服务器
一个最小的FastMCP服务器,它公开了PostgreSQL支持的库存管理工具。
项目布局
mcp_server/
main.py # FastMCP entrypoint
db/
connection.py # Async database pool helpers
seed_data.py # Idempotent seed routine
models/
inventory_model.py # Pydantic schemas
tools/
inventory_tools.py # MCP tools
Dockerfile # Runtime image for the MCP server
requirements.txt # Python dependencies
docker-compose.yml # Local stack with PostgreSQL + server使用Docker Compose运行
docker-compose up --build该命令启动PostgreSQL和FastMCP服务器(监听 http://localhost:8000).数据库在启动时会自动迁移和播种。
