π§ This project is currently under development π§
Core implementation of the Model Context Protocol (MCP), designed as an MCP Server for Ingesting APIs, SDKs, and Schemas into AI Models. This module provides a hierarchical structure for managing and routing SDKs and other protocol information.
The main goal of mcp-ingest is to act as a central hub for various data sources, preparing and channeling them for AI model consumption. This is envisioned to be achieved by mounting specialized servers for different protocols.
mcp-ingest/
βββ .github/workflows/ # GitHub Actions workflows
βββ src/
β βββ config/ # Configuration files (settings.toml)
β βββ prompts/ # Prompt templates
β βββ resources/ # Resource definitions
β βββ router/ # Routing logic
β βββ tools/ # Tool implementations
β βββ exceptions.py
β βββ logger.py
β βββ server.py # Main server application
βββ tests/ # Unit and integration tests
βββ .gitignore
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile # Dockerfile for building the image
βββ entry_local.sh # Script for local development startup
βββ entry.sh # Entrypoint script for Docker container
βββ renovate.json # Renovate bot configuration
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python >=3.10
- UV (Python package installer and virtual environment manager)
-
Clone the repository:
git clone <repository-url> cd mcp-ingest
-
Create a virtual environment and install dependencies using UV: Make sure UV is installed. If not, follow the official installation guide.
uv sync
This command reads the
pyproject.tomlfile, creates a virtual environment (if one doesn't exist or ifuvis configured to do so), and installs all necessary dependencies listed inpyproject.tomlanduv.lock. -
Configure the application: Copy or symlink
src/config/settings.tomlto the root directory assettings.toml, or ensure yourPYTHONPATHallows the application to findsrc.config.settings. Theentry_local.shscript expectsBASE_DIRto be correctly set. Modify it if your project is located elsewhere:# In entry_local.sh BASE_DIR="/Users/nk/Projects/_/mcp-ingest" # Or your actual project path
-
Run the server locally: Execute the local entry script:
./entry_local.sh
This script will navigate to the project directory, activate the virtual environment (assuming it's in
.venv), change to thesrcdirectory, and start the Python server.
You can also build and run the application using Docker and Docker Compose.
-
Build the Docker image:
docker-compose build
-
Run the application using Docker Compose:
docker-compose up
The server will be accessible at
http://localhost:8008(or the port specified indocker-compose.yml).
Application configuration is managed via settings.toml. Key settings include:
[ ] TODO
The dynaconf library is used for managing configurations, allowing for flexible setup through environment variables or settings files.
To configure this ingestor with an MCP Server, you might use a configuration similar to the following in the server's settings:
"mcp-ingest": {
"type": "stdio",
"command": "bash",
"args": [
"/path/to/your/mcp-ingest/entry_local.sh"
// OR if running in Docker, the command might differ
// e.g., pointing to entry.sh within the container context
]
}Make sure the command and args point to the correct execution script and path within your environment. For local development, entry_local.sh is suitable. For a containerized deployment, entry.sh is typically used.
This project plans to leverage FastMCP's server composition capabilities to create a modular and extensible ingest system. The core idea is to have a central MCP Ingest Server that can dynamically mount various specialized protocol servers (e.g., an OpenAPI server, an SDK documentation server, a schema definition server).
As your MCP applications grow, you might want to organize your tools, resources, and prompts into logical modules or reuse existing server components. FastMCP supports composition through two methods:
-
import_server(Static Composition):- How it works: Performs a one-time copy of all components (tools, resources, templates, prompts) from a subserver into the main server. A
prefixis added to avoid naming conflicts (e.g.,subserver.tool(name="my_tool")becomesmain_mcp.tool(name="{prefix}_my_tool")). - Updates: Changes made to the
subserverafter importing are not reflected inmain_mcp. The subserverβslifespancontext is also not executed by the main server. - Best for: Bundling finalized, stable components.
- How it works: Performs a one-time copy of all components (tools, resources, templates, prompts) from a subserver into the main server. A
-
mount(Dynamic Composition / Live Linking):- How it works: Creates a live link between the
main_mcpserver and thesubserver. Instead of copying components, requests for components matching theprefixare delegated to thesubserverat runtime. - Updates: Changes to the mounted server are immediately reflected when accessed through the parent.
- Best for: Modular runtime composition, allowing dynamic updates. This is the planned approach for
mcp-ingest.
- How it works: Creates a live link between the
(Based on content from FastMCP Documentation)
- Modularity: Break down large applications into smaller, focused servers (e.g., a
WeatherServer, aDatabaseServer). Formcp-ingest, this could mean anOpenAPIServer,SDKParserServer, etc. - Reusability: Create common utility servers and mount them wherever needed.
- Teamwork: Different teams can work on separate FastMCP servers that are later combined.
- Organization: Keep related functionality grouped together logically.
When main_mcp.mount("prefix", subserver) is called:
- A live link is established between the parent server and the mounted server.
- The parent server uses the specified
"prefix"to route requests to thesubserver. - Requests for components matching the prefix (e.g.,
prefix_tool_name) are delegated to thesubserverat runtime. - FastMCP automatically handles the prefixing for tools, resources, templates, and prompts to avoid naming collisions, similar to
import_server.
FastMCP also supports different mounting modes (Direct vs. Proxy Mounting) and resource prefix formats (Path Format vs. Protocol Format), offering flexibility for various scenarios. Direct mounting is the default, accessing objects in memory, while proxy mounting treats the mounted server as a separate entity, preserving its full client lifecycle and lifespan context. The resource prefix format can be configured globally or per-server, with "path format" (resource://prefix/path/to/resource) being the default and recommended since FastMCP 2.4.
Note: The implementation of server mounting in mcp-ingest is a planned future enhancement and is not yet available in the current version.
This project is licensed under the MIT License - see the LICENSE file for details.


