loading…
Search for a command to run...
loading…
Splits Markdown documents into hierarchical sections with parent-child and sibling relationships, enabling structured document access for AI assistants.
Splits Markdown documents into hierarchical sections with parent-child and sibling relationships, enabling structured document access for AI assistants.
Python License Execute Tests Deploy to Cloud Run Ask DeepWiki
Learn MCP Development by Example A complete, production-ready Model Context Protocol (MCP) server that demonstrates best practices for building intelligent document processing tools.
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.
The Model Context Protocol enables AI assistants to access external tools and data sources securely and efficiently. This server demonstrates how to:
# comments in fenced code blocksThis 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.py
To run the MCP server (if the environment is activated):
python src/main.py
If the environment is not activated, you can run using Poetry:
poetry run python src/main.py
The 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 Markdown text into a list of Section objects.
{
"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."
}
}
}'
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 tests
@mcp.tool decorator to expose functions as MCP tools# comments in fenced code blocks^(#+)\s+(.+)$ to find headerspython -m venv .venv && source .venv/bin/activate
poetry install
make lint: Run ruff for code formatting and lintingmake test: Run pytest test suitepython src/main.py: Start the development server# Run all tests
poetry run pytest
# Run with verbose output
poetry run pytest -v
# Run specific test file
poetry run pytest tests/test_splitter.py
The project includes GitHub Actions workflows for automated testing and deployment:
.github/workflows/execute_main_tests.yaml): Runs pytest test suite on push/PR to main branch.github/workflows/deploy_main.yaml): Automatically deploys to Google Cloud Run on push to main branchВыполни в терминале:
claude mcp add markdown-mcp -- npx Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolProvides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai