Token导航 LogoToken导航TokenDH.com
MCP Production Server logo
安全风控stdio官方级别未说明来源级核验

MCP Production Server

MCP Server

MCP Production Server是一个生产级的AI模型集成服务器,提供高性能、可扩展和安全的功能,适用于企业级AI应用集成。

工具数

3

提示词数

0

GitHub Stars

0

资源数

0
安全认证PythonClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

afrankenstine

提供方

afrankenstine

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

MCP生产服务器

用于与Claude和其他AI模型集成的生产级模型上下文协议(MCP)服务器实现。

特性

  • 生产准备就绪:通过适当的错误处理、超时和弹性模式为规模而构建
  • FastAPI框架:高性能异步web框架
  • 数据库集成:带有SQLAlchemy ORM的PostgreSQL
  • 缓存层:Redis用于高性能缓存
  • 可观测性普罗米修斯指标、结构化日志记录、分布式跟踪
  • 安全:身份验证、授权、速率限制、输入验证
  • 韧性:断路器,指数回退重试
  • 测试:全面的单元、集成和负载测试
  • 部署:Docker、Kubernetes、蓝绿色部署

快速开始

先决条件

  • Python 3.11+
  • PostgreSQL 15+
  • Redis 7+
  • Docker和Docker Compose(用于容器化开发)

地方发展

  1. 克隆存储库:
git clone https://github.com/afrankenstine/mcp-production-server.git
cd mcp-production-server
  1. 创建虚拟环境:
python3.11 -m venv venv
source venv/bin/activate  # On Windows: venv\\Scripts\\activate
  1. 安装依赖项:
pip install -r requirements.txt
  1. 复制环境变量:
cp .env.example .env
# Edit .env with your configuration
  1. 使用Docker Compose启动服务:
docker-compose up -d
  1. 运行服务器:
python main.py

服务器将在以下时间可用 http://localhost:8000

项目结构

mcp-production-server/
├── src/
│   ├── api/              # FastAPI server
│   ├── mcp/              # MCP server implementation
│   ├── config/           # Configuration management
│   ├── database/         # Database models and connections
│   ├── errors/           # Error handling
│   ├── cache/            # Redis caching
│   ├── security/         # Auth, validation, rate limiting
│   ├── resilience/       # Circuit breakers, retries
│   ├── metrics.py        # Prometheus metrics
│   ├── logging_config.py # Structured logging
│   └── context.py        # Request context
├── tests/
│   ├── unit/             # Unit tests
│   ├── integration/      # Integration tests
│   └── load/             # Load tests
├── deploy/
│   ├── kubernetes/       # Kubernetes manifests
│   ├── docker/           # Docker configurations
│   └── terraform/        # Infrastructure as code
├── scripts/              # Operational scripts
├── docs/                 # Documentation
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── main.py              # Entry point

API终点

  • POST /mcp -MCP消息端点(JSON-RPC 2.0)
  • GET /health -健康检查
  • GET /metrics -普罗米修斯指标

配置

所有配置都是通过环境变量完成的。看 .env.example 查看可用选项。

关键环境变量:

  • DATABASE_URL -PostgreSQL连接字符串
  • REDIS_URL -Redis连接字符串
  • CLAUDE_API_KEY -API密钥
  • LOG_LEVEL -日志记录级别(调试、信息、警告、错误)
  • ENVIRONMENT -环境(开发、分期、生产)

测试

运行测试:

# Unit tests
pytest tests/unit/

# Integration tests
pytest tests/integration/

# Load tests
locust -f tests/load/locustfile.py --host=http://localhost:8000

部署

码头工人

构建并运行:

docker build -t mcp-server .
docker run -p 8000:8000 mcp-server

Kubernetes

部署到Kubernetes:

kubectl apply -f deploy/kubernetes/mcp-server.yaml

蓝绿部署

./scripts/deploy.sh

监控

  • 指标:普罗米修斯指标 /metrics
  • 日志:结构化JSON日志到stdout
  • 仪表盘:Grafana仪表板位于 http://localhost:3000

文档

许可证

Apache许可证2.0-请参阅 许可证 文件以获取详细信息。

贡献

欢迎投稿!请先阅读我们的投稿指南。

支持

有关问题和疑问,请打开GitHub问题。

目录标签

目录标签

安全认证PythonClaudeAI集成本地部署生产级服务器高性能框架数据库集成

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP