使用说明
MCP Server Template - Python
Overview
Production-ready MCP server template for safely exposing tools to AI agents.
Includes tool registration, permissions, logging, error handling, and example workflows.
What This Repo Is NOT
- Not a framework for creating domain logic
- Not a ready-to-run trading or financial system
Features
- Tool categories: Read / Write / Destructive
- Scoped permissions & authentication stub
- Standardized error handling
- Logging and observability hooks
- Dockerized for easy deployment
- Example workflows using a mock domain
Getting Started
- Clone the repo
- Install dependencies
pip install -r requirements.txt # Python # npm install # TypeScript - Run the server
python -m server.main - (Optional) Run example workflows from
examples/ - (Optional) Run with Docker
docker build -t mcp-server-template . docker run mcp-server-template
Structure
- server/ – Server code and entrypoint
- tools/ – MCP tools (read, write, destructive)
- permissions/ – Permission definitions
- errors/ – Error types and handlers
- examples/ – Usage examples and mock-domain workflows
- tests/ – Test suite
