mcp输入分析仪
引言
mcp输入分析仪 是一个强大的开源库,旨在分析用户描述的构建功能,如数据库、API集成和工具。该库的主要目标是提取核心服务器需求,包括MCP(微服务配置平台)所需的资源、工具、提示、外部系统和传输。此工具可确保项目的依赖关系和配置得到明确定义和结构化。
特性
- 自然语言到结构化建筑特征提取:将生成功能的自由格式文本描述转换为结构化格式。
- MCP兼容输入结构生成:生成符合MCP规范的输入结构,确保与MCP平台的兼容性。
- 验证支持的工具和协议:验证库是否支持指定的工具和协议。
- Claude可读JSON定义创建:创建可由Claude或类似系统轻松读取和处理的JSON定义。
- 不支持功能的回退逻辑:提供回退机制,以优雅地处理不受支持的构建功能。
安装说明
安装 mcp输入分析仪,你需要在你的系统上安装Python 3.6+。然后,您可以通过pip安装库:
pip install mcp-input-analyzer或者,如果您更喜欢克隆存储库并从源代码安装,请执行以下步骤:
git clone https://github.com/your-repo/mcp_input_analyzer.git
cd mcp_input_analyzer
pip install .使用示例
示例1:基本特征提取
from mcp_input_analyzer import MCPAnalyzer
# Initialize the analyzer with a sample description
description = """
We need to integrate an API for user authentication and a PostgreSQL database.
Also, we require Redis for caching and a custom logging tool for monitoring.
"""
analyzer = MCPAnalyzer(description)
requirements = analyzer.extract_requirements()
print(requirements)示例2:生成符合MCP的输入结构
from mcp_input_analyzer import MCPAnalyzer
description = """
We need to integrate an API for user authentication and a PostgreSQL database.
Also, we require Redis for caching and a custom logging tool for monitoring.
"""
analyzer = MCPAnalyzer(description)
mcp_compliant_structure = analyzer.generate_mcp_structure()
print(mcp_compliant_structure)示例3:创建Claude可读JSON定义
from mcp_input_analyzer import MCPAnalyzer
description = """
We need to integrate an API for user authentication and a PostgreSQL database.
Also, we require Redis for caching and a custom logging tool for monitoring.
"""
analyzer = MCPAnalyzer(description)
claude_json_definition = analyzer.create_claude_json()
print(claude_json_definition)API文档
MCPAnalyzer
图书馆的主要班级。
- 初始化:
MCPAnalyzer(description: str, fallback_behavior='default')- description:描述构建功能的字符串。 - fallback_behavior:可选。指定不支持功能的行为(“默认”或“自定义”)。
- 方法:
- extract_requirements():
- 返回一个字典,其中包含从描述中提取的结构化服务器需求。
- generate_mcp_structure():
- 根据需求生成并返回符合MCP的输入结构。
- create_claude_json():
- 创建并返回服务器需求的Claude可读JSON定义。
许可证
mcp输入分析仪 根据MIT许可证发布。请查看 许可证 文件以获取更多详细信息。
______________________________________________________________________
感谢您使用 mcp输入分析仪!我们欢迎社区的贡献,使这个工具变得更好。欢迎在我们的网站上打开问题或提交拉取请求 .
⚠️ 开发状态
这个图书馆目前处于早期开发阶段。某些测试可能因以下问题而失败:
欢迎为解决这些问题做出贡献!如果您有解决方案,请提交拉取请求。

