Skip to main content
Glama

MCP Dockerized Server

by antpavlenko

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:

PathMethodDescription
/mcpPOSTStreamable HTTP transport for MCP requests. Requires a valid API key.
/generate-keyPOSTGenerates 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

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"}'

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

import asyncio import fastmcp async def main(): async with fastmcp.Client( "http://localhost:8000/mcp", headers={"X-API-Key": "<your-api-key>"}, ) as client: tools = await client.list_tools() print(tools) asyncio.run(main())
-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. Usage
    1. Build and run with Docker
    2. Generate API keys
  2. Endpoints
    1. Example requests
      1. Generate a key via HTTP
      2. Call the MCP endpoint

    Related MCP Servers

    • -
      security
      A
      license
      -
      quality
      An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
      Last updated -
      2
      Python
      MIT License
    • A
      security
      A
      license
      A
      quality
      An MCP server implementation built to interact with Confluent Kafka and Confluent Cloud REST APIs.
      Last updated -
      24
      31
      63
      TypeScript
      MIT License
      • Apple
    • -
      security
      -
      license
      -
      quality
      A MCP server that requires user authentication via Auth0, allowing it to call protected APIs on behalf of authenticated users.
      Last updated -
      TypeScript
    • -
      security
      A
      license
      -
      quality
      A 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 -
      5
      TypeScript
      MIT License

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/antpavlenko/mcp_dockerized'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server