haive.mcp.utils.extract_mcp_github_repos¶
Enhanced MCP Repository Extractor with README Processing.
This script: 1. Extracts repository URLs from awesome-mcp-servers 2. Downloads and processes README files 3. Converts to LangChain Documents with metadata 4. Organizes resources for agent access
Classes¶
Statistics for extraction process. |
|
MCP Server Categories. |
|
Programming Languages. |
|
Supported Platforms. |
|
Enhanced MCP Repository Extractor. |
|
Server Scope. |
|
Complete MCP Server Document. |
|
Metadata for an MCP Server. |
Functions¶
|
Create a loader function for agents to access MCP documents. |
|
Main function. |
Module Contents¶
- class haive.mcp.utils.extract_mcp_github_repos.ExtractionStats(/, **data)[source]¶
Bases:
pydantic.BaseModelStatistics for extraction process.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class haive.mcp.utils.extract_mcp_github_repos.MCPCategory[source]¶
-
MCP Server Categories.
Initialize self. See help(type(self)) for accurate signature.
- class haive.mcp.utils.extract_mcp_github_repos.MCPLanguage[source]¶
-
Programming Languages.
Initialize self. See help(type(self)) for accurate signature.
- class haive.mcp.utils.extract_mcp_github_repos.MCPPlatform[source]¶
-
Supported Platforms.
Initialize self. See help(type(self)) for accurate signature.
- class haive.mcp.utils.extract_mcp_github_repos.MCPRepositoryExtractor(output_dir='agent_resources/mcp_servers')[source]¶
Enhanced MCP Repository Extractor.
Init .
- Parameters:
output_dir (str) – [TODO: Add description]
- async extract_repositories_from_readme()[source]¶
Extract repository information from the awesome-mcp-servers. README.
- Return type:
- async fetch_github_metadata(metadata)[source]¶
Fetch additional metadata from GitHub API.
- Parameters:
metadata (MCPServerMetadata)
- Return type:
None
- async fetch_readme_content(metadata)[source]¶
Fetch README content from GitHub.
- Parameters:
metadata (MCPServerMetadata)
- Return type:
str | None
- generate_statistics_report(documents)[source]¶
Generate statistics report.
- Parameters:
documents (list[MCPServerDocument])
- Return type:
None
- async process_repository(metadata)[source]¶
Process a single repository.
- Parameters:
metadata (MCPServerMetadata)
- Return type:
MCPServerDocument | None
- save_documents(documents)[source]¶
Save documents in various formats.
- Parameters:
documents (list[MCPServerDocument])
- Return type:
None
- class haive.mcp.utils.extract_mcp_github_repos.MCPScope[source]¶
-
Server Scope.
Initialize self. See help(type(self)) for accurate signature.
- class haive.mcp.utils.extract_mcp_github_repos.MCPServerDocument(/, **data)[source]¶
Bases:
pydantic.BaseModelComplete MCP Server Document.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- to_langchain_document()[source]¶
Convert to LangChain Document.
- Return type:
langchain_core.documents.Document
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class haive.mcp.utils.extract_mcp_github_repos.MCPServerMetadata(/, **data)[source]¶
Bases:
pydantic.BaseModelMetadata for an MCP Server.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].