- mcp_input_analyzer
mcp_input_analyzer
mcp_input_analyzer
Introduction
mcp_input_analyzer is a powerful open-source library designed to analyze user-described build features such as databases, API integrations, and tools. The primary goal of this library is to extract core server requirements including resources, tools, prompts, external systems, and transports needed for MCP (Microservices Configuration Platform). This tool ensures that your project's dependencies and configurations are clearly defined and structured.
Features
- Natural language to structured build feature extraction: Converts free-form text descriptions of build features into a structured format.
- MCP-compliant input structure generation: Generates input structures that conform to the MCP specifications, ensuring compatibility with MCP platforms.
- Validation of supported tools and protocols: Validates whether specified tools and protocols are supported by the library.
- Claude-readable JSON definition creation: Creates JSON definitions that can be easily read and processed by Claude or similar systems.
- Fallback logic for unsupported features: Provides fallback mechanisms to handle unsupported build features gracefully.
Installation Instructions
To install mcp_input_analyzer, you need Python 3.6+ installed on your system. You can then install the library via pip:
pip install mcp-input-analyzer
Alternatively, if you prefer to clone the repository and install from source, follow these steps:
git clone https://github.com/your-repo/mcp_input_analyzer.git
cd mcp_input_analyzer
pip install .
Usage Examples
Example 1: Basic Feature Extraction
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)
Example 2: Generating MCP-Compliant Input Structure
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)
Example 3: Creating Claude-Readable JSON Definitions
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 Documentation
MCPAnalyzer
The main class of the library.
-
Initialization:
MCPAnalyzer(description: str, fallback_behavior='default')description: A string describing the build features.fallback_behavior: Optional. Specifies the behavior for unsupported features ('default' or 'custom').
-
Methods:
extract_requirements():- Returns a dictionary containing structured server requirements extracted from the description.
generate_mcp_structure():- Generates and returns an MCP-compliant input structure based on the requirements.
create_claude_json():- Creates and returns a Claude-readable JSON definition of the server requirements.
License
mcp_input_analyzer is released under the MIT License. Please see the LICENSE file for more details.
Thank you for using mcp_input_analyzer! We welcome contributions from the community to make this tool even better. Feel free to open issues or submit pull requests on our GitHub repository.
⚠️ Development Status
This library is currently in early development. Some tests may be failing with the following issues:
Contributions to fix these issues are welcome! Please submit a pull request if you have a solution.