
MCP Server with Docker
A project that integrates Model Control Protocol with OpenAI's API, allowing OpenAI to access and utilize tools exposed by a dockerized MCP server.
README
MCP Server with Docker
This project demonstrates how to integrate the Model Control Protocol (MCP) with OpenAI's API, enabling OpenAI to access and use tools exposed by an MCP server running in Docker.
Prerequisites
- Docker installed on your system
- Git (to clone the repository)
Project Structure
server.py
: The MCP server implementation with a toolclient.py
: A client that connects to the server and calls the agentDockerfile
: Instructions for building the Docker imagerequirements.txt
: Python dependencies for the project
Data Flow Explanation
- User Query: The user sends a query to the system (e.g., "What is our company's vacation policy?")
- OpenAI API: OpenAI receives the query and available tools from the MCP server
- Tool Selection: OpenAI decides which tools to use based on the query
- MCP Client: The client receives OpenAI's tool call request and forwards it to the MCP server
- MCP Server: The server executes the requested tool (e.g., retrieving knowledge base data)
- Response Flow: The tool result flows back through the MCP client to OpenAI
- Final Response: OpenAI generates a final response incorporating the tool data
Running with Docker
Step 1: Build the Docker image
docker build -t mcp-server .
Step 2: Run the Docker container
docker run -p 8050:8050 mcp-server
This will start the MCP server inside a Docker container and expose it on port 8050.
Running the Client
Once the server is running, you can run the client in a separate terminal:
python client.py
The client will connect to the server, list available tools, and call the agent to answer the query.
Troubleshooting
If you encounter connection issues:
-
Check if the server is running: Make sure the Docker container is running with
docker ps
. -
Verify port mapping: Ensure the port is correctly mapped with
docker ps
or by checking the output of thedocker run
command. -
Check server logs: View the server logs with
docker logs <container_id>
to see if there are any errors. -
Host binding: The server is configured to bind to
0.0.0.0
instead of127.0.0.1
to make it accessible from outside the container. If you're still having issues, you might need to check your firewall settings. -
Network issues: If you're running Docker on a remote machine, make sure the port is accessible from your client machine.
Notes
- The server is configured to use SSE (Server-Sent Events) transport and listens on port 8050.
- The client connects to the server at
http://localhost:8050/sse
. - Make sure the server is running before starting the client.
Recommended Servers
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.
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.
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.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.