md2 for agents
The Model Context Protocol lets your agent call md2 as a tool: it writes Markdown, asks for a PDF, Word file or more, gets a link back, and draws on the template library.
Status: live now
The MCP server is live at the address below over Streamable HTTP (protocol version 2025-06-18). The REST API on the same origin works too, for any agent with an HTTP tool.
- Live now
- MCP · Endpoint
https://md2.dev/mcp/v2 - Live now
- REST
POST https://md2.dev/v1/convert
Two ways to authenticate
OAuth 2.1
For interactive clients: the client opens the sign-in page itself, and you copy nothing. It uses PKCE and dynamic client registration; the scopes are convert:read, convert:write, library:read and agent:use.
API keys
For non-interactive clients and scripts: a key starting with md2_, sent in the header Authorization: Bearer md2_…
Setup per client
Each client has two forms: the first uses OAuth and signs in automatically, the second uses an API key. The address is the same for all of them.
Claude Code
claude mcp add --transport http md2 https://md2.dev/mcp/v2 claude mcp add --transport http md2 https://md2.dev/mcp/v2 --header "Authorization: Bearer md2_YOUR_KEY" Claude Desktop
https://md2.dev/mcp/v2 {
"mcpServers": {
"md2": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://md2.dev/mcp/v2",
"--header",
"Authorization: Bearer md2_YOUR_KEY"
]
}
}
} Cursor
{
"mcpServers": {
"md2": {
"url": "https://md2.dev/mcp/v2"
}
}
} {
"mcpServers": {
"md2": {
"url": "https://md2.dev/mcp/v2",
"headers": {
"Authorization": "Bearer md2_YOUR_KEY"
}
}
}
} VS Code
{
"servers": {
"md2": {
"type": "http",
"url": "https://md2.dev/mcp/v2"
}
}
} {
"servers": {
"md2": {
"type": "http",
"url": "https://md2.dev/mcp/v2",
"headers": {
"Authorization": "Bearer md2_YOUR_KEY"
}
}
}
} Gemini CLI
{
"mcpServers": {
"md2": {
"httpUrl": "https://md2.dev/mcp/v2"
}
}
} {
"mcpServers": {
"md2": {
"httpUrl": "https://md2.dev/mcp/v2",
"headers": {
"Authorization": "Bearer md2_YOUR_KEY"
}
}
}
} The seven tools
convertMarkdown to 13 formats. A binary file comes back as a signed link valid for 24 hours, or inline as Base64 on request.
render_htmlSanitised HTML for the document, with its title and warnings, to check it before converting.
list_themesThe available themes, formats and text directions.
agent_draftAsks Mido, the writing agent, to write or edit a Markdown draft, Arabic first. It counts against your daily messages.
library_searchSearch the library of prompts, skills and project templates.
library_getThe full content of a library item by its id.
import_to_markdownOpens a public web page in a real browser and returns its main content as Markdown.
REST for any agent without MCP
If your client doesn't speak MCP, any agent that can send an HTTP request can print right now:
curl -X POST https://md2.dev/v1/convert \
-H "Content-Type: application/json" \
-d '{"markdown":"# Hello\n\nfrom md2","format":"pdf"}' \
-o hello.pdf