MCP Markdown Template
Automatically transforms markdown templates (like GitHub Issue templates) into MCP tools and FastAPI endpoints. Load templates from local files, directories, or URLs to create typed API endpoints with Swagger UI documentation.
README
<div align="center">
<h1> MCP Markdown Template </h1>
</div>
š Core Idea
Transform markdown templates (like GitHub Issue templates) into MCP tools automatically. Write a template once, get both a FastAPI endpoint and an MCP tool.
šļø Architecture
mcp_tools/
āāā models.py # Data models (Template, TemplateVariable)
āāā loader.py # Load templates from files, directories, URLs
āāā parser.py # Extract variables & render with Jinja2
āāā generator.py # Create FastAPI endpoints dynamically
āāā server.py # FastMCP server with CORS
How it works:
- Load - Fetch templates from local files, directories, or URLs
- Parse - Extract
<variables>and metadata from YAML frontmatter - Generate - Create typed FastAPI endpoints with Pydantic models
- Serve - Expose as both REST API (
/api/docs) and MCP tools (/mcp)
š Features
- Auto-generate MCP tools from markdown templates
- Multiple sources - Load from local files, directories, or URLs
- Swagger UI - Test endpoints at
/api/docs - Docker ready - Production-ready container setup
- CI/CD - GitHub Actions for automated workflows
š ļø Getting Started
Local Development
Install dependencies:
uv sync
Run the MCP server:
uv run uvicorn mcp_tools.main:starlette_app --host 127.0.0.1 --port 8000
Docker
Build the Docker image:
docker build -t docker.io/username/mcp-markdown-template:latest .
Run the container with various template sources:
# Mount local templates directory
docker run -i --rm -p 8000:8000 \
-v /path/to/your/templates:/app/templates \
-e MCP_TEMPLATES_SOURCE=/app/templates \
docker.io/hsiangjenli/mcp-markdown-template:latest
# Load from URL (GitHub raw URL)
docker run -i --rm -p 8000:8000 \
-e MCP_TEMPLATES_SOURCE=https://raw.githubusercontent.com/hsiangjenli/mcp-markdown-template/refs/heads/main/.github/ISSUE_TEMPLATE/demo.md \
docker.io/hsiangjenli/mcp-markdown-template:latest
# Multiple sources (comma-separated)
docker run -i --rm -p 8000:8000 \
-e MCP_TEMPLATES_SOURCE="/app/templates,https://raw.githubusercontent.com/owner/repo/main/template.md" \
-v /path/to/local/templates:/app/templates \
docker.io/hsiangjenli/mcp-markdown-template:latest
MCP Server configuration (for Claude Desktop, etc.):
{
"servers": {
"markdown-template": {
"url": "http://localhost:8000/mcp",
"type": "http"
}
},
"inputs": []
}
Template Sources
| Format | Example |
|---|---|
| Local directory | /path/to/templates/ |
| Local file | /path/to/template.md |
| URL | https://raw.githubusercontent.com/.../template.md |
| Multiple | source1,source2 (comma-separated) |
Environment Variables
| Variable | Default |
|---|---|
MCP_TITLE |
Python MCP Template |
MCP_DESCRIPTION |
A template for creating MCP-compliant FastAPI |
MCP_TEMPLATES_SOURCE |
.github/ISSUE_TEMPLATE |
š Documentation
Build docs locally:
scripts/build_docs.sh && uv run mkdocs build
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.