Provides containerized deployment of the MCP server with volume mounting for persistent storage of API keys, simplifying setup and operation across different environments.
Offers integration with Python applications through the fastmcp client library, enabling programmatic access to MCP tools and capabilities from Python code.
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
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:
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:
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
with the raw schema at /openapi.json
.
Example requests
Generate a key via HTTP
Call the MCP endpoint
You can issue JSON-RPC requests directly. The example below sends a ping
request:
For more advanced interaction you can use the fastmcp
Python client:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A minimal, containerized MCP server that exposes a Streamable HTTP transport with API key authentication, allowing secure access to MCP endpoints.
Related MCP Servers
- -securityAlicense-qualityAn MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.Last updated -2PythonMIT License
mcp-confluentofficial
AsecurityAlicenseAqualityAn MCP server implementation built to interact with Confluent Kafka and Confluent Cloud REST APIs.Last updated -243163TypeScriptMIT License- -security-license-qualityA MCP server that requires user authentication via Auth0, allowing it to call protected APIs on behalf of authenticated users.Last updated -TypeScript
- -securityAlicense-qualityA reference implementation for creating an MCP server supporting Streamable HTTP & SSE Transports with OAuth authorization, allowing developers to build OAuth-authorized MCP servers with minimal configuration.Last updated -5TypeScriptMIT License