- MCP Docker Compose Setup
MCP Docker Compose Setup
MCP Docker Compose Setup
This repository contains a Docker Compose configuration for running multiple MCP (Multi-Channel Provider) sse services locally.
Getting Started
Follow these steps to set up and run the MCP Docker Compose environment:
1. Clone the Repository
git clone https://github.com/guanghuang/mcp-docker-compose.git
cd mcp-docker-compose
2. Create Configuration Files from Templates
Copy the sample configuration files to create your own local versions:
# Copy Docker Compose configuration
cp docker-compose.yml.sample docker-compose.yml
3. Configure DNS
Set up DNS resolution for the MCP services as described in the DNS Configuration section. The router-level DNS configuration is recommended for simplicity.
4. Customize Configuration Files
Edit the configuration files in the mcp-configs directory to add your credentials and connection details:
# Example: Edit database connection details
nano mcp-configs/postgres.config
5. Customize docker-compose.yml (Optional)
If you need to:
- Add additional MCP services
- Remove services you don't need
- Change port mappings
- Add environment variables
Edit the docker-compose.yml file:
nano docker-compose.yml
6. Start the Services
Start all the MCP services:
docker-compose up -d
7. Verify Services
Check that all services are running:
docker-compose ps
8. Access Services
Access the services via their respective URLs:
- Oracle: http://oracle-mcp.localhost:8088
- PostgreSQL: http://postgres-mcp.localhost:8088
- And others as listed in the Accessing Services section
Using with AI Assistants
MCP Servers Configuration
This setup can be used with Cursor, Windsurf, and other AI coding assistants that support the Model Context Protocol with SSE (Server-Sent Events). The repository includes a sample mcp-servers.json file with the necessary configuration.
Note: This setup uses the SSE (Server-Sent Events) interface of MCP servers. Tools that only support STDIO interface (like current versions of Claude Desktop) are not compatible with this setup.
For Cursor and other AI code editors that support SSE:
- Copy the content from the sample configuration below into your editor's MCP configuration
- Modify the URLs if you've changed any hostnames or ports
The MCP configuration for all services looks like:
{
"mcpServers": {
"oracle": {
"url": "http://oracle-mcp.localhost:8088/mcp/sse"
},
"postgres": {
"url": "http://postgres-mcp.localhost:8088/mcp/sse"
},
"sqlserver": {
"url": "http://sqlserver-mcp.localhost:8088/mcp/sse"
},
"azure-devops": {
"url": "http://azure-devops-mcp.localhost:8088/mcp/sse"
},
"jira": {
"url": "http://jira-mcp.localhost:8088/mcp/sse"
},
"confluence": {
"url": "http://confluence-mcp.localhost:8088/mcp/sse"
},
"figma": {
"url": "http://figma-mcp.localhost:8088/mcp/sse"
},
"opensearch": {
"url": "http://opensearch-mcp.localhost:8088/mcp/sse"
}
}
}
Simply customize these settings for your environment and add them to your AI assistant's configuration. Each tool has a different location for MCP configuration - check your tool's documentation for details.
Services
The following services are included:
-
Database Services
-
DevOps & Collaboration Services
- Azure DevOps (azure-devops-mcp)
- Jira (jira-mcp)
- Confluence (confluence-mcp)
- Figma (figma-mcp)
-
Search Services
- OpenSearch (opensearch-mcp)
-
Proxy
- Nginx (exposing services on port 8088)
MCP Docker Images
All MCP services are available as Docker images:
- Database: guang1/jdbc-mcp
- Azure DevOps: guang1/azure-devops-mcp
- Jira: guang1/jira-mcp
- Confluence: guang1/confluence-mcp
- Figma: guang1/figma-mcp
- OpenSearch: guang1/opensearch-mcp
Prerequisites
- Docker and Docker Compose installed
- DNS configuration that resolves
*-mcp.localhostto127.0.0.1
DNS Configuration
For this setup to work properly, you must configure your DNS to resolve all *-mcp.localhost hostnames to 127.0.0.1. This can be done in several ways:
Recommendation: Using router-level DNS configuration is the preferred approach as it's the simplest and most effective solution. It automatically works for all devices on your network without individual configuration and requires just a one-time setup. If you manage your own router/DNS server, configure this option first.
Router DNS (e.g., pfSense)
If you're using pfSense or another router with DNS resolver capabilities:
- Access your router's admin interface
- Navigate to the DNS Resolver settings
- Add the following to the
Custom optionssection:
server:
local-zone: "localhost" redirect
local-data: "*.localhost 86400 IN A 127.0.0.1"
- Apply the changes and restart the DNS resolver service
For OPNsense, add similar configuration to the Unbound DNS resolver.
Hosts File
macOS/Linux
Edit /etc/hosts:
sudo nano /etc/hosts
Add the following entries:
127.0.0.1 oracle-mcp.localhost
127.0.0.1 postgres-mcp.localhost
127.0.0.1 sqlserver-mcp.localhost
127.0.0.1 azure-devops-mcp.localhost
127.0.0.1 jira-mcp.localhost
127.0.0.1 confluence-mcp.localhost
127.0.0.1 figma-mcp.localhost
127.0.0.1 opensearch-mcp.localhost
Windows
Edit C:\Windows\System32\drivers\etc\hosts (requires administrator privileges) and add the same entries as above.
Local DNS Servers
If you prefer using a local DNS server for better control and flexibility:
Windows
-
Acrylic DNS Proxy:
- Download and install from Acrylic DNS website
- Add the following to the hosts file (
%ProgramFiles%\Acrylic DNS Proxy\AcrylicHosts.txt):
127.0.0.1 *.localhost- Restart the Acrylic DNS service
-
Simple DNS Plus:
- Install Simple DNS Plus
- Add a wildcard DNS record for
*.localhostpointing to127.0.0.1
macOS
-
dnsmasq:
- Install via Homebrew:
brew install dnsmasq - Create or edit
/usr/local/etc/dnsmasq.conf:
address=/.localhost/127.0.0.1- Start the service:
sudo brew services start dnsmasq - Configure macOS to use this local DNS server (System Preferences → Network → Advanced → DNS)
- Install via Homebrew:
-
MicroDNS:
- Simple GUI-based DNS server for macOS
Linux
-
dnsmasq:
- Install via package manager:
sudo apt install dnsmasq(Ubuntu/Debian) orsudo yum install dnsmasq(CentOS/RHEL) - Add to
/etc/dnsmasq.conf:
address=/.localhost/127.0.0.1- Restart the service:
sudo systemctl restart dnsmasq
- Install via package manager:
-
Bind9:
- For more advanced configurations, install Bind9 DNS server
- Add a wildcard zone for
localhostin your configuration
Using /etc/hosts with a Wildcard (macOS/Linux only)
For macOS and Linux, with additional tools you can enable wildcard support in the hosts file:
-
Install
libnss-myhostname:# On Ubuntu/Debian sudo apt-get install libnss-myhostname -
Edit
/etc/nsswitch.confto include:hosts: files myhostname dns
This approach requires additional configuration and may not work on all systems.
Configuration
Service Configuration
Each service has a corresponding configuration file in the mcp-configs directory. Customize these files with your actual credentials and connection details before starting the services:
oracle.config: Oracle database connection parameterspostgres.config: PostgreSQL database connection parameterssqlserver.config: SQL Server database connection parametersazure-devops.config: Azure DevOps API connection parametersatlassian.config: Jira and Confluence API connection parametersfigma.config: Figma API connection parametersopensearch.config: OpenSearch connection parameters
Nginx Configuration
The setup includes two Nginx configuration files:
nginx.conf: Main Nginx configuration that sets up virtual hosts for each servicemcp-proxy.conf: Proxy settings for proper forwarding of requests to backend services
The Nginx configuration automatically routes requests based on the subdomain pattern:
{service-name}-mcp.localhost:8088 → http://{service-name}:8080 (where {service-name} is resolved through Docker's internal DNS to the appropriate container)
Usage
To start all services:
docker-compose up -d
To view logs:
docker-compose logs -f
To stop all services:
docker-compose down
Updating MCP Images
When new versions of the MCP Docker images are released, you should update your local setup to get the latest features and security updates:
- Pull the latest images:
docker-compose pull
- Restart the services with the new images:
docker-compose down
docker-compose up -d
For a single service update:
# Pull just one image
docker pull guang1/jdbc-mcp:latest
# Restart just one service
docker-compose up -d --no-deps oracle
To check which images are outdated:
docker images | grep guang1
Accessing Services
Services are exposed through Nginx on port 8088. The default URLs are:
- Oracle: http://oracle-mcp.localhost:8088
- PostgreSQL: http://postgres-mcp.localhost:8088
- SQL Server: http://sqlserver-mcp.localhost:8088
- Azure DevOps: http://azure-devops-mcp.localhost:8088
- Jira: http://jira-mcp.localhost:8088
- Confluence: http://confluence-mcp.localhost:8088
- Figma: http://figma-mcp.localhost:8088
- OpenSearch: http://opensearch-mcp.localhost:8088
Troubleshooting
- If you can't access the services, ensure your DNS configuration is correctly set up
- Check Docker logs for any service-specific errors
- Verify that all required configuration files are properly set up in the
mcp-configsdirectory
Security Best Practices
When using MCP servers, keep the following security considerations in mind:
- Use read-only mode: For database MCP servers, set
enable.write.sql=falseunless you specifically need write access - Use dedicated accounts: Create service-specific accounts with limited permissions for each MCP server
- Network isolation: Whenever possible, run these services in an isolated network environment
- Secure credentials: Never commit real credentials to version control; use environment files that are excluded from git
- Regular updates: Keep your MCP docker images updated to receive security patches
Acknowledgements
These MCP servers are based on the Quarkiverse MCP Servers project with enhancements for containerized deployment. The Model Context Protocol (MCP) enables AI assistants to interface with various services and databases.
Customizing MCP Services
Removing MCP Services
If you don't need all the included MCP services, you can easily remove them from your setup:
- Edit the
docker-compose.ymlfile and remove the service section you don't need - Update your DNS or hosts file to remove the corresponding entries
- If needed, remove the related configuration file from the
mcp-configsdirectory
Example: To remove the Figma MCP, delete the following section from docker-compose.yml:
figma:
image: guang1/figma-mcp:latest
env_file:
- ./mcp-configs/figma.config
Adding New MCP Services
To add a new MCP service to the setup:
- Add the service definition to
docker-compose.ymlfollowing the existing pattern - Create a configuration file in the
mcp-configsdirectory for the new service - Update your DNS or hosts file to add the corresponding entry
Example: Adding MySQL Database MCP
Since MySQL uses the same JDBC MCP server as the other databases, you can add it as follows:
- Add to
docker-compose.yml:
mysql:
image: guang1/jdbc-mcp:latest
env_file:
- ./mcp-configs/mysql.config
environment:
- enable.write.sql=false
- Create
mcp-configs/mysql.config:
jdbc.user=mysql_user
jdbc.password=mysql_password
jdbc.url=jdbc:mysql://host:3306/database
- Add to your hosts file:
127.0.0.1 mysql-mcp.localhost
The MySQL MCP will be available at http://mysql-mcp.localhost:8088 after restarting Docker Compose.
Example: Adding a Modified MCP Service
If you've created a modified version of an existing MCP with custom functionality:
- Add to
docker-compose.yml:
custom-opensearch:
image: yourname/custom-opensearch-mcp:latest
env_file:
- ./mcp-configs/custom-opensearch.config
volumes:
- ./custom-plugins:/app/plugins # If your custom MCP needs additional files
- Create
mcp-configs/custom-opensearch.config:
opensearch.url=https://your-custom-opensearch:9200
opensearch.user=your-username
opensearch.password=your-password
custom.feature.enabled=true
-
Add to your hosts file:
127.0.0.1 custom-opensearch-mcp.localhost -
Build your custom Docker image (example Dockerfile):
FROM guang1/opensearch-mcp:latest
COPY custom-code/ /app/custom-code/
ENV CUSTOM_FEATURE=enabled
The custom OpenSearch MCP will be available at http://custom-opensearch-mcp.localhost:8088 after building your image and restarting Docker Compose.
Contributing
Contributions to improve the MCP Docker Compose setup are welcome. Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the Apache License 2.0 - see the individual MCP repositories for more details.
The MCP Docker Compose configuration is maintained by Guang Huang.