mdMCP
Turn a Markdown file into a local MCP server, with zero dependencies.
pip install mdmcp
Quickstart
1. Write a tool file:
## Tool: health_check
Check if a URL is reachable.
### Parameters
- url (string, required): URL to check
### Execute
\```bash
STATUS=$(curl -sf -o /dev/null -w '%{http_code}' -m 5 "$MDMCP_URL")
echo "HTTP $STATUS"
\```
2. Serve it:
mdmcp serve tools.md
3. Connect to Claude Code:
{
"mcpServers": {
"my-tools": {
"command": "mdmcp",
"args": ["serve", "tools.md"]
}
}
}
That's it. Your Markdown is now an MCP server.
How it works
## Tool: namedefines a tool### Parametersdefines input schema (envvar-based, no string interpolation)### Executecontains a bash script inside a fenced code block- Parameters are passed as
$MDMCP_<NAME>environment variables
Commands
mdmcp list tools.md # List available tools
mdmcp run tools.md tool_name '{}' # Run a tool once
mdmcp serve tools.md # Start MCP stdio server
Security
- Minimal env: only PATH, HOME, USER, SHELL, LANG, TERM are inherited. API keys and tokens are NOT exposed to tool scripts.
- No string interpolation: parameters are passed as environment variables, not injected into shell code.
- Required param validation: missing required parameters return an error before execution.
- Timeout + process cleanup: 30s timeout with process group kill to prevent zombies.
Tips
- Always quote
"$MDMCP_VAR"in bash to prevent word splitting - Use
${MDMCP_VAR:-default}for optional params with bash-side defaults - You can use
python3 -cinside bash for complex logic (seeexamples/data-tools.md) - Use
set -euat the top of scripts for safer execution
Examples
See the examples/ directory:
- ops-tools.md — disk usage, port check, git log, docker status, health check
- dev-tools.md — find TODOs, run linter, check port (from Codex dogfood)
- data-tools.md — CSV summary, JSON inspect, file diff (from Gemini dogfood)
Known limitations
- Execute blocks only support
```fences (not~~~) - Parameter names must be
\w+(no spaces or special chars) - Nested
```inside heredocs will confuse the parser - All parameter values are strings in bash; cast manually if needed
License
MIT
Metadata
Release files for markdown-mcp-server 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markdown_mcp_server-0.2.0.tar.gz | 9.7 kB | Without provenance | Details for markdown_mcp_server-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markdown_mcp_server-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for markdown_mcp_server-0.2.0-py3-none-any.whl |
Total release size: 17.8 kB
Release files / markdown_mcp_server-0.2.0.tar.gz
| Download URL | markdown_mcp_server-0.2.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b84f0063f5d6c503815eb70662d12a96015f3dc5405430e976ce8f69706ef82
|
|
BLAKE2b-256 checksum How to use checksums |
96249e07b00fe0232379532fe852050a692d91b60b8f8d08166b8fe98aff8ec8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / markdown_mcp_server-0.2.0-py3-none-any.whl
| Download URL | markdown_mcp_server-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a788ebf59993fc26ab189cdf46fb11f12856c62c734709715e0678802973a098
|
|
BLAKE2b-256 checksum How to use checksums |
7c0d8f3e411eecafc0e0d52e2f790fab4c6bb3398a18cf536327bb4a38936fcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for markdown-mcp-server 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.