Get the FREE Ultimate OpenClaw Setup Guide →

mcp -example-python

Example template of a Python MCP server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dedalus-labs-mcp-server-example-python uvx dedalus-labs-mcp-server-example-python \
  --env OPENAI_API_KEY="Your OpenAI API key for AI features"

How to use

This MCP server hosts a documentation-focused knowledge base with AI-assisted Q&A capabilities. It serves Markdown docs stored under the docs/ directory, supports searching across the repository of documentation, and can generate AI-driven answers from the docs using OpenAI. Available tools include list_docs() to enumerate docs, search_docs() to find relevant content by keywords, ask_docs() to fetch AI-powered answers from the documentation, index_docs() to index and refresh the documentation set, and analyze_docs() to perform task-oriented analysis on the docs. To use it locally, install the uv package manager, sync dependencies with uv sync, configure your OpenAI API key, and run the server with uv run main. The server is designed to run within /app, serving docs from /app/docs, and includes a built-in rate limiter (10 requests per minute) to protect API keys.

How to install

Prerequisites:

  • A system with a supported developer environment (macOS, Linux, or Windows with WSL).
  • Homebrew (for macOS) or Python/uv installed.
  • An OpenAI API key for AI features.

Installation steps:

  1. Install the uv package manager (example commands):

    • macOS (Homebrew): brew install uv
    • Linux/Windows: follow uv installation instructions from the official docs
  2. Install project dependencies and dependencies via uv: uv sync --no-dev

  3. Configure API keys:

    • Copy example env and set your key: cp config/.env.example .env.local

      Edit .env.local and add your OpenAI API key

  4. Run the server: uv run main

Optional testing: uv run python tests/test_server.py

Prerequisites recap:

  • uv package manager installed
  • Project dependencies synced (uv sync)
  • OPENAI_API_KEY configured for AI features
  • Server entry point available at main (root) and the MCP server code at src/main.py

Additional notes

Tips and common considerations:

  • The server serves docs from the docs/ directory and can index them using index_docs().
  • Ensure OPENAI_API_KEY is securely managed; consider restricting key usage to the server's environment.
  • If you encounter environment issues, verify that uv is correctly installed and that uv sync completes without errors.
  • The docs structure under docs/ should include modules like Getting Started, Hackathon info, and Deployment guides to maximize discoverability.
  • If deploying in Dedalus or a container, ensure the working directory aligns with /app and that /app/docs exists with your documentation content.

Related MCP Servers

Sponsor this space

Reach thousands of developers