MCP Development Environment

MCP Development Environment

Provides a Docker-based development environment with Python and Node.js MCP servers, enabling file operations, SQL queries, Redis caching, and debugging for building and testing MCP servers.

Category
Visit Server

README

MCP Development Environment

A comprehensive Docker-based development environment for building and testing Model Context Protocol (MCP) servers.

๐ŸŽฏ What's Included

Core Services:

  • Python MCP Server (Port 8000) - Full-featured implementation with debugging
  • Node.js MCP Server (Port 3000) - Alternative implementation
  • PostgreSQL (Port 5432) - Database with sample data
  • Redis (Port 6379) - Caching layer
  • Nginx File Server (Port 8080) - Static file serving with CORS

Development Features:

  • Hot reloading for both Python and Node.js
  • Built-in debugger support (Python: 5678, Node.js: 9229)
  • Comprehensive logging and monitoring
  • Pre-configured testing frameworks
  • Sample data and schemas
  • Code quality tools (linting, formatting, type checking)

๐Ÿš€ Quick Start

  1. Setup the environment:
# Make the setup script executable and run it
chmod +x setup.sh
./setup.sh
  1. Verify everything is working:
# Check service status
docker-compose ps

# Test endpoints
curl http://localhost:8080/health  # File server
curl http://localhost:8000/health  # Python MCP server  
curl http://localhost:3000/health  # Node.js MCP server
  1. Start developing:
# Edit the Python MCP server
vim src/main.py

# View logs in real-time
docker-compose logs -f mcp-server

# Run tests
docker-compose exec mcp-server python -m pytest

๐Ÿ”ง Key Features of the MCP Servers

Available Tools:

  • write_file - Write content to files
  • execute_sql - Run database queries
  • cache_set/get - Redis cache operations
  • list_directory - Browse file system
  • analyze_data - Basic data analysis on CSV files

Resources:

  • File system access to /data directory
  • Database table schemas and sample data
  • Configuration files and documentation

Sample Usage:

# The Python server provides tools for:
await mcp_server.call_tool("write_file", {
    "path": "analysis.txt", 
    "content": "Sample analysis results"
})

await mcp_server.call_tool("execute_sql", {
    "query": "SELECT * FROM users WHERE department = $1",
    "parameters": ["Engineering"] 
})

๐Ÿ› Debugging Setup

Python (VSCode):

{
  "name": "Python: Remote Attach",
  "type": "python", 
  "request": "attach",
  "connect": {"host": "localhost", "port": 5678},
  "pathMappings": [
    {"localRoot": "${workspaceFolder}/src", "remoteRoot": "/app/src"}
  ]
}

Node.js (Chrome DevTools):

  • Open chrome://inspect
  • Connect to localhost:9229

๐Ÿ“Š Monitoring & Logs

# View all service logs
docker-compose logs -f

# Monitor specific service
docker-compose logs -f mcp-server

# Check resource usage
docker stats

# Database operations
docker-compose exec postgres psql -U mcp_user -d mcp_dev

# Redis operations  
docker-compose exec redis redis-cli

๐Ÿ› ๏ธ Development Workflow

The environment supports both transport methods:

  • stdio (default) - For direct MCP client integration
  • HTTP/WebSocket - For web-based development and testing

You can easily switch between implementations or run both simultaneously for comparison and testing.

๐Ÿ—‚๏ธ Project Structure

mcp/
โ”œโ”€โ”€ src/                    # Python MCP server source
โ”‚   โ””โ”€โ”€ main.py            # Main Python server implementation
โ”œโ”€โ”€ src-node/              # Node.js MCP server source
โ”‚   โ””โ”€โ”€ server.js          # Main Node.js server implementation
โ”œโ”€โ”€ db/                    # Database initialization scripts
โ”‚   โ”œโ”€โ”€ init.sql           # Schema and tables
โ”‚   โ””โ”€โ”€ sample_data.sql    # Sample data
โ”œโ”€โ”€ data/                  # Data files (mounted to containers)
โ”œโ”€โ”€ static/                # Static files served by Nginx
โ”œโ”€โ”€ tests/                 # Test suites
โ”œโ”€โ”€ .vscode/               # VSCode debug configuration
โ”œโ”€โ”€ docker-compose.yml     # Service definitions
โ”œโ”€โ”€ python.Dockerfile      # Python server container
โ”œโ”€โ”€ node.Dockerfile        # Node.js server container
โ”œโ”€โ”€ nginx.conf             # Nginx configuration
โ”œโ”€โ”€ setup.sh               # Setup and management script
โ””โ”€โ”€ README.md              # This file

๐Ÿ”ง Management Commands

The setup.sh script provides convenient management:

./setup.sh setup     # Initial setup and start (default)
./setup.sh start     # Start services
./setup.sh stop      # Stop services  
./setup.sh restart   # Restart services
./setup.sh status    # Show service status
./setup.sh logs      # Show service logs
./setup.sh clean     # Remove everything (with confirmation)
./setup.sh help      # Show help

๐Ÿงช Testing

Both Python and Node.js servers include comprehensive test suites:

# Run Python tests
docker-compose exec mcp-server python -m pytest tests/ -v

# Run Node.js tests  
docker-compose exec mcp-server-node npm test

# Run tests with coverage
docker-compose exec mcp-server python -m pytest tests/ --cov=src

๐Ÿ” Database Schema

The PostgreSQL database includes several sample tables:

  • users - User accounts with departments and roles
  • products - Product catalog with categories and inventory
  • orders - Order history with status tracking
  • order_items - Order line items
  • analytics_events - Event tracking data
  • app_config - Application configuration

๐Ÿ“ก API Endpoints

File Server (Port 8080):

  • GET /health - Health check
  • GET /data/ - Browse data directory
  • GET /static/ - Browse static files
  • GET /api/docs - API documentation

Python MCP Server (Port 8000):

  • GET /health - Health check
  • MCP protocol via stdio transport

Node.js MCP Server (Port 3000):

  • GET /health - Health check
  • MCP protocol via stdio transport

๐Ÿšจ Troubleshooting

Services not starting:

  1. Check Docker is running: docker info
  2. Check port conflicts: netstat -tulpn | grep :8000
  3. View startup logs: docker-compose logs

Database connection issues:

# Test database connectivity
docker-compose exec postgres pg_isready -U mcp_user

# Connect to database manually
docker-compose exec postgres psql -U mcp_user -d mcp_dev

Redis connection issues:

# Test Redis connectivity
docker-compose exec redis redis-cli ping

Debug not working:

  • Ensure debug ports (5678, 9229) are not in use
  • Check firewall settings
  • Verify VSCode debug configuration matches container setup

๐Ÿค Contributing

  1. Fork the repository
  2. Make changes in your environment
  3. Test thoroughly with provided test suites
  4. Submit a pull request

๐Ÿ“„ License

This project is provided as-is for development and testing purposes.


This environment gives you a complete MCP development platform with real databases, caching, file systems, and debugging tools - perfect for building and testing production-ready MCP servers!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured