markdown-mcp
1. Click on "Install Server".
2. Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
3. In the chat, type `@` followed by the MCP server name and your instructions, e.g., "`@markdown-mcp` Split this markdown: # Intro
Some text
Details
More text"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a [step-by-step guide with screenshots](https://glama.ai/blog/2025-07-08-how-to-install-and-use-mcp-servers).
Markdown MCP Server
Learn MCP Development by Example A complete, production-ready Model Context Protocol (MCP) server that demonstrates best practices for building intelligent document processing tools.
What is this?
This is a Model Context Protocol (MCP) server that intelligently splits Markdown documents into hierarchical sections while preserving parent-child relationships and sibling connections. Built with FastMCP and FastAPI, it serves as both a useful tool and an educational resource for developers learning to create their own MCP servers. The project includes automated testing and deployment via GitHub Actions workflows.
Why MCP?
The Model Context Protocol enables AI assistants to access external tools and data sources securely and efficiently. This server demonstrates how to:
Build MCP-compliant tools that AI models can use
Handle structured document processing
Maintain relationships in hierarchical data
Integrate with modern Python web frameworks
Related MCP server: search-docs
Features
Core Functionality
Hierarchical Splitting: Maintains header relationships (H1 → H2 → H3...)
Sibling Detection: Identifies headers at the same level for navigation
Code-Aware Processing: Ignores
#comments in fenced code blocksRich Metadata: Includes parent references, sibling lists, and optional token counts
Technical Stack
MCP Compliant: Full Model Context Protocol interface support
FastAPI Powered: High-performance async server with automatic OpenAPI docs
Well Tested: Core splitting functionality covered with pytest
Type Safety: Complete type hints with Pydantic models
Docker Ready: Containerized deployment support
CI/CD: Automated testing and deployment via GitHub Actions
Requirements
Python >=3.12, <3.13
Quick Start
This project uses Poetry for dependency management. To get started:
git clone https://github.com/Gal-Gilor/markdown-mcp.git
cd markdown-mcp
python -m venv .venv && source .venv/bin/activate
poetry install
python src/main.pyUsage
To run the MCP server (if the environment is activated):
python src/main.pyIf the environment is not activated, you can run using Poetry:
poetry run python src/main.pyThe server will start on
http://0.0.0.0:8080.The MCP server is mounted at
/server.The MCP server is accessible at
/server/mcp.Available tools:
split_text(text: str) -> list[Section]: Splits the input Markdowntextinto a list ofSectionobjects.{ "section_header": "Getting Started", "section_text": "Welcome to the guide...", "header_level": 2, "metadata": { "parents": {"h1": "Introduction"}, "siblings": ["Advanced Topics", "FAQ"] } }Example Request:
curl -X POST http://localhost:8080/server/mcp/tools/call \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "split_text", "arguments": { "text": "# Header 1\n\nSome content here.\n\n## Header 2\n\nMore content." } } }'
Architecture Overview
Project Structure
src/
├── main.py # FastAPI app and MCP server setup
├── models.py # Pydantic data models
└── splitter.py # Core splitting logic
tests/
├── conftest.py # Test fixtures
└── test_splitter.py # Splitter functionality testsKey Components
FastMCP Integration: Uses
@mcp.tooldecorator to expose functions as MCP toolsPydantic Models: Type-safe data structures with validation
Hierarchical Processing: Two-pass algorithm for building document structure
Code Block Protection: Regex-based approach to ignore comments in code
How It Works
Code Block Processing: Protects
#comments in fenced code blocksHeader Detection: Uses regex pattern
^(#+)\s+(.+)$to find headersHierarchy Building: Maintains parent-child relationships using a stack
Sibling Detection: Groups headers at same level with same parent
Section Creation: Converts hierarchical structure to flat list of sections
Development
Setup
python -m venv .venv && source .venv/bin/activate
poetry installCommands
make lint: Run ruff for code formatting and lintingmake test: Run pytest test suitepython src/main.py: Start the development server
Testing
# Run all tests
poetry run pytest
# Run with verbose output
poetry run pytest -v
# Run specific test file
poetry run pytest tests/test_splitter.pyCI/CD
The project includes GitHub Actions workflows for automated testing and deployment:
Execute Tests (
.github/workflows/execute_main_tests.yaml): Runs pytest test suite on push/PR to main branchDeploy to Cloud Run (
.github/workflows/deploy_main.yaml): Automatically deploys to Google Cloud Run on push to main branch
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to navigate and query hierarchical documentation structures, supporting markdown files with YAML metadata and OpenAPI 3.x specifications. It features intelligent full-text search, metadata filtering, and a built-in web interface for both human and AI-driven documentation access.Last updated6MIT
- Alicense-qualityAmaintenanceEnables AI agents to search local Markdown documents using natural language, with automatic indexing and section-level retrieval.Last updated261MIT
- FlicenseAqualityAmaintenanceLets AI agents navigate documentation by section instead of reading files by brute force, reducing token usage and improving precision.Last updated64201
- FlicenseBqualityDmaintenanceTransforms markdown documents into immersive 3D visualizations using semantic analysis and spatial layout, enabling navigable knowledge structures.Last updated72
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
The document publishing layer for AI tools. Convert markdown to 6 destinations, 62 templates.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Gal-Gilor/markdown-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server