BasicMcpServer
The BasicMcpServer project provides a fundamental reference implementation for an MCP server. It includes Docker containerization and a setup script for more complex servers, such as those integrated with Jira. This resource aims to support the creation and customization of MCP servers for various services.
BasicMcpServer: MCP Server Implementation Resources
This repository serves three primary purposes:
- Simple Example MCP Server: A basic reference implementation that you can clone and modify for your own needs
- Docker Containerization Demo: Shows how to set up an MCP server in Docker with end-to-end testing
- Setup Automation: Provides a script to generate more complex MCP servers (like the Jira integration)
MCP References
Key resources that informed this implementation:
- MCP Documentation - Official documentation and introduction to the Model Context Protocol
- Python SDK Repository - The official Python SDK for MCP
- MCP HTTP Client Example - Reference implementation that helped develop the test code in this repository
Contents
- Base MCP Server: Simple reference implementation with a basic tool
- Docker Configuration: Containerization setup with multi-stage builds
- End-to-End Tests: Demonstration of proper MCP server testing
setup_jira_mcp_server.sh
: Script for generating a Jira-integrated MCP servermcp_server_implementation_guide.md
: Comprehensive guide to MCP server implementation
Getting Started
Option 1: Use the Basic MCP Server as a Template
The simplest approach is to clone this repository and modify it for your needs:
# Clone the repository
git clone https://github.com/yourusername/BasicMcpServer.git my-mcp-server
cd my-mcp-server
# Modify src/server.py to implement your custom tools and resources
# Update config.py with your required environment variables
# Run with Docker or directly with Python
Option 2: Learn Docker-Based MCP Server Implementation
Study the Docker configuration and end-to-end tests to understand:
- Multi-stage Docker builds for efficient images
- Container configuration best practices
- Testing patterns for MCP servers
Option 3: Generate a Jira MCP Server
To create a complete Jira MCP server project structure:
-
Make the setup script executable (already done):
chmod +x setup_jira_mcp_server.sh
-
Run the script:
./setup_jira_mcp_server.sh
Command-line options:
Usage: ./setup_jira_mcp_server.sh [OPTIONS] Options: -n, --name NAME Specify project name (default: jira-mcp-server) --no-git Skip Git repository initialization --no-github Skip GitHub repository creation -h, --help Show help message
-
Follow the instructions that appear after the script runs:
- Navigate to the newly created project directory
- Configure your Jira credentials in the
.env
file - Build and run the Docker container
The script automatically:
- Creates the complete project structure with all necessary files
- Initializes a Git repository (unless
--no-git
is specified) - Creates a GitHub repository and pushes the code (if GitHub CLI is installed and authenticated)
- Makes all necessary scripts executable
This will create a more complex MCP server example that integrates with Jira, allowing AI assistants to interact with your Jira instance through the MCP protocol.
Option 4: Understand MCP Server Implementation
If you want to learn more about how MCP servers work and how to implement them:
- Read the comprehensive guide in
mcp_server_implementation_guide.md
- The guide covers:
- Project structure and setup
- Implementing MCP servers with FastMCP
- Docker containerization
- Testing strategies
- Deployment options
- Best practices
Customizing for Other Services
The Jira MCP server can be used as a template for creating MCP servers for other services:
- Generate the Jira MCP server project using the setup script
- Replace the Jira-specific code with code for your target service:
- Modify
src/services/
to implement your service integration - Update
src/server.py
to define tools and resources for your service - Update
src/config.py
to include the necessary configuration variables - Update
.env.example
with appropriate environment variables
- Modify
What is MCP?
The Model Context Protocol (MCP) is a standard for communication between AI assistants and external services. It enables AI assistants to:
- Discover and call tools that perform actions
- Access resources that provide information
- Interact with external systems through a standardized interface
By implementing an MCP server, you can extend the capabilities of AI assistants by giving them access to your services and data. This repository uses the official Python SDK and follows best practices for MCP server implementation.
Prerequisites
- Python 3.11 or higher
- Docker (for containerized deployment)
- Service-specific API credentials
License
This project is provided under the MIT License.