Skip to content

hsiangjenli/python-mcp-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python MCP Template

A DevOps-friendly template with CI/CD, Docker, and Documentation-as-Code (DaC) for building MCP server

๐Ÿš€ Core Idea

This template leverages fastmcp and FastAPI to seamlessly integrate MCP functionality while inheriting the original OpenAPI specifications.

๐ŸŒŸ Features

  • CI/CD Integration: Automate your workflows with GitHub Actions.
  • Dockerized Environment: Consistent and portable development and production environments.
  • Documentation-as-Code: Automatically generate and deploy documentation using MkDocs. This process also utilizes the openapi.json file to ensure API documentation is up-to-date.
  • FastAPI Integration: Build robust APIs with OpenAPI support.

๐Ÿ› ๏ธ Getting Started

Local Development

  1. Install dependencies:

    uv sync
  2. Run the MCP server:

    uv run --with fastmcp fastmcp run mcp_tools/main.py

Docker

  1. Build the Docker image:

    docker build -t python-mcp-template:latest .
  2. Run the container:

    docker run -i --rm -p 8000:8000 python-mcp-template:latest
  3. Run MCP Server:

{
  "mcpServers": {
    "python-mcp-template": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-p",
        "8000:8000",
        "python-mcp-template:latest"
      ]
    }
  }
}

๐Ÿ“š Documentation

  • Documentation is built using MkDocs and deployed to GitHub Pages.

  • To build the documentation locally:

    chmod +x scripts/build_docs.sh
    scripts/build_docs.sh
    mkdocs build

About

๐Ÿš€ A DevOps-friendly template with CI/CD, Docker, and Documentation-as-Code (DaC) for building MCP server .

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published