Skip to main content
Glama
developkariyer

Modular MCP Server

Modular MCP Server

This is a modular, auto-discovering Model Context Protocol (MCP) server built with Python and FastAPI. It's designed to be a scalable foundation for providing tools to Large Language Models (LLMs).

Features

  • Auto-Discovery: Automatically loads tools from the /tools directory on startup.

  • Modular: Tools are self-contained in their own files.

  • Configurable: Uses a .env file for all configuration.

  • Secure: Includes best practices like read-only database users and whitelisting.

  • Performant: Runs on a high-performance Unix socket and uses an async database connection pool.

Related MCP server: my-mcp-server

Setup

  1. Clone the repository:

    git clone <repository_url>
    cd mcp
  2. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure your environment:

    cp .env.example .env

    Now, edit the .env file with your actual database credentials and settings.

Running the Server

To run the server on a Unix socket:

uvicorn mcp_server:app --uds /tmp/mcp.sock

Testing

You can test the running server using curl.

Discover tools:

curl --unix-socket /tmp/mcp.sock http://localhost/mcp/v1/tools | jq

Execute a tool:

curl -X POST \
  --unix-socket /tmp/mcp.sock \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"timezone": "Europe/Istanbul"}}' \
  http://localhost/mcp/v1/tools/get_current_time:execute | jq

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that wraps multiple backend servers for token-efficient tool discovery via lazy loading. It enables AI models to browse available servers and fetch specific tool schemas on-demand, significantly reducing initial context overhead.
    -
  • F
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server built with FastMCP that enables dynamic tool loading and configuration from individual Python files. It provides a flexible framework for automatically discovering, testing, and running tools via Stdio or HTTP transport modes.
    1
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server built with FastMCP that features dynamic tool loading and modular management via a dedicated tool directory. It supports both stdio and HTTP transport modes, enabling efficient development and deployment of custom MCP tools.
    -
  • F
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server framework featuring dynamic tool loading and automatic tool discovery from a dedicated directory. It leverages FastMCP to provide a robust environment for building, configuring, and testing individual Python-based tools.
    1
    -