MCP Platform Framework
A framework for building MCP servers with built-in enterprise capabilities such as authentication, authorization, telemetry, audit logging, and data classification, allowing domain developers to focus on business logic while maintaining governance and compliance.
README
MCP Platform Framework
Overview
The MCP Platform Framework provides a comprehensive infrastructure layer for implementing MCP (Model Context Protocol) domains, enforcing strict separation between platform concerns and domain business capabilities.
Principles
Domain Ownership
- Domains own business capabilities: Business logic, ontologies, semantic definitions
- Platform owns everything else: Authentication, authorization, telemetry, error handling, connectivity
- No domain forking: All domains use the same template from this central repository
Key Benefits
- Prevents integration sprawl: Clear separation prevents the MCP ecosystem from becoming the next generation of enterprise integration complexity
- Consistent infrastructure: All domains benefit from the same robust platform services
- Rapid development: Domain developers focus on business logic, not infrastructure
- Governance and compliance: Built-in support for audit, security, and data classification
Architecture
┌─────────────────────────────────────────────────────────────┐
│ MCP Platform Framework │
├─────────────────────────────────────────────────────────────┤
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │Authentication│ │ Authorization│ │ Telemetry │ │
│ │ (Entra ID, │ │ (RBAC, │ │ (Auto-collect│ │
│ │ JWT, etc.) │ │ Policies) │ │ tool calls) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Audit │ │ Error │ │Classification│ │
│ │ (Immutable │ │ Handling │ │ (Data │ │
│ │ logs) │ │ (Standardized│ │ controls) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ Connectivity Layer ││
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ |│
│ │ │ Semantic │ │ Warehouse │ │ Lakehouse │ ││
│ │ │ Models │ │ (SQL) │ │ (Delta) │ ││
│ │ └──────────────┘ └──────────────┘ └──────────────┘ ││
│ └─────────────────────────────────────────────────────────┘│
│ │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ Tool Registration ││
│ │ - Auto-discovery from domain modules ││
│ │ - Metadata generation ││
│ │ - MCP server integration ││
│ └─────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Domain Repositories │
│ (Created from template - no forking between domains) │
│ │
│ mcp-donor-management-domain/ │
│ ├── tools/ # Domain-specific tools │
│ ├── semantic_models/ # Semantic model access │
│ ├── tests/ # Domain tests │
│ ├── docs/ # Domain documentation │
│ ├── config/ # Environment configs │
│ ├── metadata/ # Domain metadata │
│ └── pipelines/ # CI/CD pipelines │
└─────────────────────────────────────────────────────────────┘
Quick Start
1. Install the Framework
# Clone the platform framework
git clone https://github.com/Edouard-Legoupil/mcp-platform-framework.git
cd mcp-platform-framework
# Install dependencies
pip install -r requirements.txt
# Install in development mode
pip install -e .
2. Create a Domain Repository
# Use the template generator
python -m platform.template create_domain DonorManagement \
"Manages donor information and analytics" \
"DER Team"
# Or programmatically
from platform.template import DomainGenerator
generator = DomainGenerator()
generator.create_domain(
name="DonorManagement",
description="Manages donor information and analytics",
owner="DER Team"
)
3. Develop Domain Tools
# In mcp-donor-management-domain/tools.py
from platform.registration import tool
from platform.auth import authenticated_tool, requires_permission
from platform.telemetry import track_tool_telemetry
from platform.audit import audit_tool_access
from platform.classification import classification
from platform.connectivity import semantic_model_execute
@tool(domain="DonorManagement")
@authenticated_tool
@requires_permission("donor.read")
@track_tool_telemetry(domain="DonorManagement")
@audit_tool_access(resource="GetDonorPortfolioHealth", domain="DonorManagement")
@classification("CONFIDENTIAL")
def get_donor_portfolio_health(donor_id: str) -> dict:
"""
Get the health status of a donor's portfolio
"""
# Use semantic model for business metrics
result = semantic_model_execute(
model_name="DonorSemanticModel",
query=f"Donor Portfolio Health for Donor {donor_id}"
)
return {
"donor_id": donor_id,
"health_score": result.data[0]["health_score"],
"risk_level": result.data[0]["risk_level"]
}
4. Start the MCP Server
# Start the server with all domains
python -m platform.main --config config.yaml --serve --port 8080
Platform Modules
Authentication
- Entra ID Integration: Microsoft Entra ID (Azure AD) authentication
- JWT Validation: Automatic JWT token validation
- Managed Identity: Azure Managed Identity support
- OAuth2 Handling: OAuth2 authentication flows
from platform.auth import authenticated_tool, requires_permission
@authenticated_tool
def public_tool():
pass
@requires_permission("donor.read")
def read_donor_data():
pass
Authorization
- Enterprise RBAC: Role-Based Access Control
- Permission Decorators: Easy permission checking
- Policy Enforcement: Complex policy evaluation
from platform.authorization import requires_permission
@requires_permission("donor.analyze")
def analyze_donor_data():
pass
Telemetry
- Automatic Collection: Every call generates standard telemetry
- Tool Name: Automatically captured
- Requester Identity: User information captured
- Duration: Execution time measured
- Status: Success/failure tracking
from platform.telemetry import track_tool_telemetry
@track_tool_telemetry(tool_name="GetDonorPortfolioHealth", domain="DonorManagement")
def get_donor_portfolio_health():
pass
Audit Logging
- Immutable Records: Tamper-proof audit logs
- Sensitive Access: Automatic logging of sensitive queries
from platform.audit import audit_tool_access
@audit_tool_access(resource="GetTopDonorContributions", domain="DonorManagement")
def get_top_donor_contributions():
pass
Error Handling
- Standardized Errors: Consistent error structures
- Error Codes: Unique error codes for each error type
from platform.errors import DataAccessException
raise DataAccessException("Access denied", "DONOR-001")
Data Classification
- Classification Levels: PUBLIC, INTERNAL, CONFIDENTIAL, STRICTLY_CONFIDENTIAL
- Governance Policies: Enforce policies through framework controls
from platform.classification import classification
@classification("CONFIDENTIAL")
def GetFundingPipelineRisk():
pass
Tool Registration
- Automatic Discovery: Tools are automatically discovered from domain modules
- Metadata Generation: Tool metadata is automatically generated
from platform.registration import tool
@tool(domain="DonorManagement")
def GetDonorPortfolioHealth():
pass
Fabric Connectivity
- Semantic Models: Encourage business metrics consumption through semantic models
- Warehouses: Standardized warehouse connectors
- Lakehouses: Lakehouse connectivity
from platform.connectivity import semantic_model_execute
result = semantic_model_execute(
model_name="FinanceSemanticModel",
query="Total Revenue by Region"
)
Configuration Management
- Environment-Aware: Separate configurations for DEV, TEST, PROD
- Key Vault Integration: Standardized retrieval of secrets
from platform.config import get_config_value, get_secret
timeout = get_config_value("request_timeout", default=30)
db_password = get_secret("database_password", domain="DonorManagement")
Repository Strategy
- Central Repository:
mcp-platform-frameworkcontains all platform code - Domain Repositories: Created from the template (e.g.,
mcp-donor-management-domain) - No Forking: Domains do not fork each other and do not create custom frameworks
Configuration
Platform Configuration
# config.yaml
platform:
environment: Dev
auth_enabled: true
auth_provider: entra_id
telemetry_enabled: true
audit_enabled: true
connections:
- name: FinanceSemanticModel
connection_type: semantic_model
connection_string: powerbi://dev-finance-model
domains:
DonorManagement:
settings:
max_retries: 3
connections:
- name: DonorSemanticModel
connection_type: semantic_model
secrets:
api_key:
source: keyvault
name: donor-api-key
CI/CD Pipeline
Each domain receives a pipeline out-of-the-box with:
- Build validation
- Testing (unit, integration, performance, security)
- Security scanning
- Deployment
Security
- Authentication: Entra ID, JWT, Managed Identity, OAuth2
- Authorization: RBAC with permission decorators
- Audit Logging: Immutable logs for sensitive access
- Data Classification: Enforcement of classification levels
- Secret Management: Key Vault integration, no embedded credentials
Support
For issues, questions, or contributions, please contact the platform team.
License
This project is licensed under the MIT License.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。