这是一个用于文档管理和集成的模型上下文协议(MCP)实现。
src/
├── resources/
│ ├── templates/ # 资源模板系统
│ └── managers/ # 资源管理
├── documentation/
│ ├── processors/ # 文档处理
│ └── integrators/ # 集成处理器
├── tasks/
│ ├── issues/ # 问题跟踪
│ └── reviews/ # 审查管理
└── tests/
├── property/ # 基于属性的测试
└── integration/ # 集成测试
资源模板系统提供了基于URI的文档资源访问方式,具有以下特点:
示例用法:
from src.resources.templates.base import ResourceTemplate
# 创建一个带有参数类型的模板
template = ResourceTemplate(
uri_template='docs://api/{version}/endpoint',
parameter_types={'version': str}
)
# 提取并验证参数
params = template.extract_parameters('docs://api/v1/endpoint')
template.validate_parameters(params)
该项目使用Hypothesis进行基于属性的测试,以确保:
运行测试:
pytest tests/property/test_templates.py
遵循TDD方法:
错误处理:
文档:
该项目采用基于分支的开发方法,用于:
mcp-docs/docs/concepts/python-sdk/src/mcp/python-sdk/examples/servers/