Skip to main content

A comprehensive and extensible cookiecutter template system for creating Model Context Protocol (MCP) servers with plugin architecture supporting multiple templates including RAG-enabled servers

Project description

egile-mcp-starter

PyPI - Version Tests Python Versions License Docker Code Style FastMCP MCP

A comprehensive cookiecutter template for creating Model Context Protocol (MCP) servers using the FASTMCP framework.

Features

  • ๐Ÿš€ Modern Python Setup: Uses Poetry for dependency management and packaging
  • ๐Ÿ—๏ธ FASTMCP Framework: Built on the efficient FASTMCP framework for MCP servers
  • ๏ฟฝ Plugin Architecture: Extensible template system with multiple server types
  • ๐Ÿ› ๏ธ Multiple Templates: Choose from MCP, RAG, or custom templates
  • ๐Ÿงช Testing Ready: Comprehensive test suite with pytest and coverage
  • ๐Ÿ”ง Development Tools: Pre-configured with Black, Flake8, MyPy, and pre-commit hooks
  • ๐Ÿณ Docker Support: Optional Docker configuration for easy deployment
  • ๐Ÿ”„ CI/CD Ready: GitHub Actions workflows for automated testing and deployment
  • ๐Ÿ“š Rich Documentation: Detailed README and code documentation
  • ๐ŸŽ›๏ธ Configurable: YAML-based configuration with environment variable support

Quick Start

Installation

# Install with pip (recommended)
pip install egile-mcp-starter

# Or use Docker
docker pull jpoullet2000/egile-mcp-starter
docker run -it jpoullet2000/egile-mcp-starter

# Or install from source
git clone https://github.com/jpoullet2000/egile-mcp-starter.git
cd egile-mcp-starter
poetry install

Generate a New MCP Server

# Using the installed command (default MCP template)
egile-mcp-starter

# Or if installed from source
poetry run egile-mcp-starter

# Choose a specific template
egile-mcp-starter --template rag

# List available templates
egile-mcp-starter --list-templates

# With custom project name
egile-mcp-starter --project-name "my_custom_server"

# With multiple options
egile-mcp-starter --template rag --output-dir ./my-projects --project-name "my_rag_server" --verbose

CLI Options

The egile-mcp-starter command supports the following options:

Option Short Description Example
--template -t Choose the template to use --template rag
--project-name Override the project name (affects directory and package name) --project-name "my_server"
--output-dir -o Output directory for the generated project --output-dir ./projects
--list-templates List all available templates and exit --list-templates
--verbose -v Print detailed status information --verbose
--no-input Don't prompt for parameters, use defaults --no-input
--config-file Path to cookiecutter config file --config-file config.yaml
--default-config Use default values for all template variables --default-config
--help Show help message and exit --help

Examples:

# Generate with custom name and template
egile-mcp-starter --template rag --project-name "my_awesome_rag_server"

# Non-interactive generation for CI/CD
egile-mcp-starter --no-input --project-name "test_server" --output-dir ./build

# List available templates
egile-mcp-starter --list-templates

Available Templates

The egile-mcp-starter uses a plugin architecture that supports multiple project templates. Choose the template that best fits your needs:

๐Ÿ”ง MCP Template (default)

The standard MCP server template with comprehensive features:

  • Server Types: Tools, resources, prompts, or full-featured servers
  • FASTMCP Integration: Built on the efficient FASTMCP framework
  • Development Ready: Testing, linting, CI/CD, Docker support
  • Flexible Configuration: YAML-based config with environment variables
egile-mcp-starter --template mcp

๐Ÿง  RAG Template

Advanced RAG-enabled MCP server with vector search capabilities:

  • Vector Databases: Chroma, Pinecone, Weaviate, Qdrant, FAISS support
  • Embedding Models: Sentence Transformers, OpenAI, Cohere
  • Document Processing: PDF, DOCX, Excel, text files
  • Web Scraping: Optional web page scraping and indexing
  • Chunking Strategies: Recursive, semantic, fixed-size
  • Reranking: Optional result reranking for better relevance
  • MCP Tools: ingest_documents, search_documents, scrape_and_index
  • MCP Resources: Document listing, metadata access, chunk search
egile-mcp-starter --template rag

๐Ÿ”Œ Plugin System Features

  • Extensible: Easy to add new templates without modifying core code
  • External Plugins: Third-party templates via entry points
  • Template Hooks: Pre/post-generation customization
  • Backward Compatible: Original functionality preserved
# List all available templates
egile-mcp-starter --list-templates

# Generate with specific template and options
egile-mcp-starter --template rag --output-dir ./my-projects --project-name "my_rag_server" --verbose

Generated Project Structure

The generated project will have this structure:

my-mcp-server/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ my_mcp_server/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ server.py          # Main MCP server implementation
โ”‚   โ”‚   โ”œโ”€โ”€ config.py          # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ tools/             # Tool implementations (if enabled)
โ”‚   โ”‚   โ”œโ”€โ”€ resources/         # Resource handlers (if enabled)
โ”‚   โ”‚   โ”œโ”€โ”€ prompts/           # Prompt templates (if enabled)
โ”‚   โ”‚   โ””โ”€โ”€ utils.py           # Utility functions
โ”‚   โ””โ”€โ”€ main.py                # Entry point
โ”œโ”€โ”€ tests/                     # Comprehensive test suite
โ”œโ”€โ”€ pyproject.toml            # Poetry configuration
โ”œโ”€โ”€ README.md                 # Project documentation
โ”œโ”€โ”€ Dockerfile               # Docker configuration (optional)
โ””โ”€โ”€ .github/workflows/       # CI/CD workflows (optional)

Extending the Plugin System

Adding Custom Templates

The plugin architecture makes it easy to add new templates:

  1. Create a Template Plugin:
from egile_mcp_starter import TemplatePlugin
from pathlib import Path

class MyTemplatePlugin(TemplatePlugin):
    def __init__(self):
        super().__init__(
            name="my_template",
            description="My custom MCP server template",
            version="1.0.0"
        )
    
    def get_template_path(self) -> Path:
        return Path(__file__).parent / "my_template"
    
    def get_default_context(self) -> dict:
        return {"project_name": "My Custom Server"}
  1. Register the Plugin:
from egile_mcp_starter import get_registry

registry = get_registry()
registry.register(MyTemplatePlugin())
  1. External Plugin Distribution:
# In your package's setup.py or pyproject.toml
entry_points = {
    'egile_mcp_starter.templates': [
        'my_template = my_package.my_template:MyTemplatePlugin',
    ],
}

Template Hooks

Customize the generation process with hooks:

  • Pre-generation: Modify context, validate inputs, compute dependencies
  • Post-generation: Initialize databases, download models, set up git repos

Development

Setting up Development Environment

# Clone the repository
git clone https://github.com/jpoullet2000/egile-mcp-starter.git
cd egile-mcp-starter

# Install dependencies
poetry install --with dev

# Install pre-commit hooks
poetry run pre-commit install

Running Tests

# Run all tests
poetry run pytest

# Run with coverage
poetry run pytest --cov=egile_mcp_starter --cov-report=html

# Run specific tests
poetry run pytest tests/test_generator.py -v

Code Quality

# Format code
poetry run black .

# Check linting
poetry run flake8 egile_mcp_starter tests

# Type checking
poetry run mypy egile_mcp_starter

# Run all pre-commit checks
poetry run pre-commit run --all-files

Documentation

For detailed information about templates and the plugin system, see:

  • Templates Guide: Comprehensive documentation on available templates, the plugin architecture, and how to create custom templates
  • Configuration: Detailed configuration options for each template
  • API Reference: Complete API documentation

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (poetry run pytest)
  5. Run code quality checks (poetry run pre-commit run --all-files)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments


Built with โค๏ธ to accelerate MCP server development

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

egile_mcp_starter-0.2.0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

egile_mcp_starter-0.2.0-py3-none-any.whl (66.3 kB view details)

Uploaded Python 3

File details

Details for the file egile_mcp_starter-0.2.0.tar.gz.

File metadata

  • Download URL: egile_mcp_starter-0.2.0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for egile_mcp_starter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dd415459848a89d11bbffff5611ab0cbebb94d307c284b7f7e1ce9686d037c58
MD5 b8a0ccab23c30bf8dcc51a86637b3c9a
BLAKE2b-256 a7f1b188c6a05136d34199ca56558d9bc0c0eba4c640ab20fceaa4db40e6b6dd

See more details on using hashes here.

File details

Details for the file egile_mcp_starter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: egile_mcp_starter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 66.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for egile_mcp_starter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 884cef6f55e76b5ba149c4473ef9481e7a1f4c934e9b05ff06e3a6679637ee3a
MD5 ee6ed27041fd55f325109398f78303fb
BLAKE2b-256 8f92b73d9c8cca6ee14d1917f5d378e748a9e4dc99d58c388e4e7be805d395a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page