Skip to main content

A comprehensive CLI tool for rapidly creating, configuring, and deploying Model Context Protocol (MCP) servers

Project description

ModelContextKit

๐Ÿš€ A comprehensive CLI tool for rapidly creating, configuring, and deploying Model Context Protocol (MCP) servers

Python License

What is MCP?

The Model Context Protocol (MCP) is an open standard developed by Anthropic that enables AI applications (like Claude) to connect with external tools, data sources, and APIs in a standardized way. Think of it as "USB-C for AI applications" - it provides a universal connector between AI models and external systems.

Features

โœจ Quick Setup: Generate production-ready MCP servers in minutes, not hours
๐Ÿ”ง Multiple Backends: Support for databases, APIs, filesystems, web scrapers, email, and cloud storage
๐ŸŽฏ Interactive Wizard: Guided setup with intelligent configuration prompts
๐Ÿ“š Comprehensive Templates: Pre-built templates following MCP best practices
๐Ÿ”’ Security First: Built-in security features and input validation
๐Ÿงช Testing Ready: Generated projects include test suites and examples
๐Ÿ“– Auto Documentation: Comprehensive documentation generation
๐ŸŽจ Claude Desktop Integration: Automatic configuration for Claude Desktop

Installation

# Install base package
pip install modelcontextkit

# Install with specific backend support
pip install modelcontextkit[database]
pip install modelcontextkit[api]
pip install modelcontextkit[filesystem]
pip install modelcontextkit[webscraper]
pip install modelcontextkit[email]
pip install modelcontextkit[cloudstorage]

# Install with all backends
pip install modelcontextkit[all]

Quick Start

Interactive Wizard (Recommended)

modelctx wizard

Command Line Interface

# List available backend types
modelctx list

# Create a database MCP server
modelctx create my-db-server --backend database

# Create an API integration server
modelctx create my-api-server --backend api

# View templates
modelctx templates

Supported Backends

๐Ÿ—„๏ธ Database Backend

Connect to SQL databases (PostgreSQL, MySQL, SQLite) with built-in connection pooling and security.

Generated Tools:

  • execute_query(query: str) - Execute SQL queries safely
  • get_table_schema(table_name: str) - Get table structure
  • list_tables() - List all tables

Configuration:

  • Database connection parameters
  • Connection pooling settings
  • Query timeout and limits

๐ŸŒ REST API Backend

Integrate with REST APIs with authentication, rate limiting, and error handling.

Generated Tools:

  • api_request(endpoint: str, method: str, data: dict) - Make HTTP requests
  • get_api_status() - Check API health

Authentication Support:

  • Bearer tokens
  • API keys
  • OAuth2 flows

๐Ÿ“ Filesystem Backend

Access and manipulate local files and directories with security controls.

Generated Tools:

  • read_file(file_path: str) - Read file contents
  • write_file(file_path: str, content: str) - Write to files
  • list_directory(dir_path: str) - List directory contents
  • search_files(pattern: str, directory: str) - Search for files

๐Ÿ•ท๏ธ Web Scraper Backend

Scrape and parse web content with respect for robots.txt and rate limiting.

Generated Tools:

  • scrape_url(url: str) - Extract content from web pages
  • extract_links(url: str) - Get all links from a page
  • take_screenshot(url: str) - Capture page screenshots

๐Ÿ“ง Email Backend

Send and receive emails via SMTP/IMAP with support for attachments.

Generated Tools:

  • send_email(to: str, subject: str, body: str) - Send emails
  • list_emails(folder: str, limit: int) - List emails from folder
  • read_email(email_id: str) - Read specific email

โ˜๏ธ Cloud Storage Backend

Connect to cloud storage services (AWS S3, Google Cloud Storage, Azure Blob).

Generated Tools:

  • upload_file(local_path: str, remote_key: str) - Upload files
  • download_file(remote_key: str, local_path: str) - Download files
  • list_objects(prefix: str) - List stored objects
  • delete_object(key: str) - Delete objects

Generated Project Structure

my-mcp-server/
โ”œโ”€โ”€ server.py                 # Main MCP server file
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ pyproject.toml           # Python project metadata
โ”œโ”€โ”€ README.md                # Project documentation
โ”œโ”€โ”€ .env.template            # Environment variables template
โ”œโ”€โ”€ .gitignore              # Git ignore rules
โ”œโ”€โ”€ config/
โ”‚   โ”œโ”€โ”€ config.yaml         # Main configuration file
โ”‚   โ”œโ”€โ”€ claude_desktop_config.json  # Claude Desktop integration
โ”‚   โ””โ”€โ”€ logging.yaml        # Logging configuration
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ models/             # Data models
โ”‚   โ”œโ”€โ”€ services/           # Business logic
โ”‚   โ””โ”€โ”€ utils/              # Utility functions
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_server.py      # Server tests
โ”‚   โ””โ”€โ”€ test_tools.py       # Tool-specific tests
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ API.md              # API documentation
โ”‚   โ””โ”€โ”€ DEPLOYMENT.md       # Deployment guide
โ””โ”€โ”€ scripts/
    โ”œโ”€โ”€ setup.sh            # Setup script
    โ””โ”€โ”€ deploy.sh           # Deployment script

Configuration

The tool supports flexible configuration through:

  • Interactive prompts during wizard mode
  • Configuration files (YAML/JSON)
  • Environment variables for sensitive data
  • Command-line arguments for automation

Example configuration:

# config/config.yaml
server:
  name: "my-api-server"
  description: "API integration MCP server"
  
backend:
  type: "api"
  base_url: "https://api.example.com"
  auth_type: "bearer"
  rate_limit: 60
  
security:
  validate_inputs: true
  log_requests: true
  timeout: 30

Claude Desktop Integration

Generated servers automatically include configuration for Claude Desktop:

{
  "mcpServers": {
    "my-mcp-server": {
      "command": "python",
      "args": ["/path/to/my-mcp-server/server.py"],
      "env": {
        "API_KEY": "your-api-key",
        "DATABASE_URL": "your-db-connection"
      }
    }
  }
}

Development and Testing

Each generated project includes:

  • Unit tests with pytest
  • Integration tests with real MCP client
  • Mock data for development
  • Development server with hot-reload
  • MCP Inspector integration for testing
# Run tests
cd my-mcp-server
python -m pytest

# Start development server
python server.py --dev

# Test with MCP Inspector
npx @modelcontextprotocol/inspector python server.py

Security Features

  • ๐Ÿ”’ Input validation and sanitization
  • ๐Ÿ›ก๏ธ Access controls and permission systems
  • ๐Ÿ“ Audit logging for all operations
  • ๐Ÿ” Secure credential management
  • ๐Ÿšซ SQL injection prevention
  • ๐ŸŒ CORS and rate limiting

CLI Reference

# Create new MCP server
modelctx create <project-name> --backend <type> [options]

# Interactive wizard
modelctx wizard

# List available backends
modelctx list

# Manage templates
modelctx templates [list|add|remove]

# Generate documentation
modelctx docs <project-path>

# Deploy server (if configured)
modelctx deploy <project-name>

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

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

Support


Made with โค๏ธ for the MCP community

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

modelcontextkit-0.1.0.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

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

modelcontextkit-0.1.0-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

Details for the file modelcontextkit-0.1.0.tar.gz.

File metadata

  • Download URL: modelcontextkit-0.1.0.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for modelcontextkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7798ef31d59c9b6b0d078c8caf2076709bab2d6baf59399c2fe82ec61bee917e
MD5 b15822cece76718010a07608166178bd
BLAKE2b-256 a98b9b89d46dfad73822d3597ab85c3072996808e278e09872125a82ddf47688

See more details on using hashes here.

File details

Details for the file modelcontextkit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for modelcontextkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 650aa9c02209acbc3c338c15c4c989bb2f049e18918e16ca38d80b0ebe163301
MD5 7bf0b740f1cf81ca715da402d447b09f
BLAKE2b-256 311131ca8f20edaf69e0713ed00c3281b1c20c9afb96d9b4017ce1ec50585640

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