MCP Dockerized Server

MCP Dockerized Server

A minimal, containerized MCP server that exposes a Streamable HTTP transport with API key authentication, allowing secure access to MCP endpoints.

Category
Visit Server

README

MCP Dockerized Server

This repository provides a minimal MCP server based on [fastmcp]. The server exposes the Streamable HTTP transport and protects all requests using a simple API key.

Usage

Build and run with Docker

docker build -t mcp-server .
docker run -p 8000:8000 -v mcp_data:/data mcp-server

The container stores API keys in /data/api_keys.db. Mount a volume to persist keys across restarts.

Generate API keys

Use the management CLI inside the container to create keys:

docker run --rm -v mcp_data:/data mcp-server python manage.py generate-key

Generated keys are written to /data/api_keys.db inside the container or the mounted volume. You can confirm the file exists by listing it with a one-off container:

docker run --rm -v mcp_data:/data mcp-server ls -l /data/api_keys.db

The printed key can then be supplied via the X-API-Key header or api_key query parameter when calling the server.

Endpoints

The server exposes two simple HTTP endpoints:

Path Method Description
/mcp POST Streamable HTTP transport for MCP requests. Requires a valid API key.
/generate-key POST Generates a new API key. Requires an existing valid API key.

Interactive API documentation is available at /docs (also accessible via /doc) with the raw schema at /openapi.json.

Example requests

Generate a key via HTTP

curl -X POST http://localhost:8000/generate-key \
     -H "X-API-Key: <your-api-key>"

Call the MCP endpoint

You can issue JSON-RPC requests directly. The example below sends a ping request:

curl -X POST http://localhost:8000/mcp \
     -H "Content-Type: application/json" \
     -H "X-API-Key: <your-api-key>" \
     -d '{"jsonrpc": "2.0", "id": 1, "method": "ping"}'

Call a tool via HTTP

Tools are invoked using the tools/call method. Provide the tool name and any arguments in the JSON-RPC payload. The example below runs the built-in terminal tool:

curl -X POST http://localhost:8000/mcp \
     -H "Content-Type: application/json" \
     -H "X-API-Key: <your-api-key>" \
     -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "terminal", "arguments": {"cmd": "echo hello"}}}'

For more advanced interaction you can use the fastmcp Python client:

import asyncio
from fastmcp.client import Client, StreamableHttpTransport

async def main():
    transport = StreamableHttpTransport(
        "http://localhost:8000/mcp",
        headers={"X-API-Key": "<your-api-key>"},
    )
    async with Client(transport) as client:
        tools = await client.list_tools()
        print(tools)
        result = await client.call_tool("terminal", {"cmd": "echo hello"})
        print(result[0].text)

asyncio.run(main())

Plugins

Additional tools and resources can be added by placing modules in the plugins package. Each module should expose a setup(server) function which receives the FastMCP instance and registers tools or resources. All modules in this package are automatically imported on startup.

This repository ships with a terminal plugin providing a simple tool for running commands on the host system.

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