About AgentMD
AgentMD is an MCP server for agents that need readable document content. It converts PDFs, DOCX, HTML, and URLs into clean Markdown, preserving tables and removing web-page boilerplate.
Key features
- 01Convert PDF, DOCX, HTML, and URLs
- 02Preserve tables in Markdown
- 03Extract main web-page content
- 04Convert local files or base64 bytes
Use cases
- 01Prepare documents for agent context
- 02Convert a web page into Markdown
- 03Extract content from local documents
MCP support
It exposes three conversion tools to MCP clients: URL, local-file, and base64 document conversion. It is available as a hosted Streamable HTTP server or can run locally over stdio.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://www.getagentmd.com/api/mcpclaude mcp add --transport http djrobson5-agentmd https://www.getagentmd.com/api/mcp{"mcpServers":{"djrobson5-agentmd":{"type":"http","url":"https://www.getagentmd.com/api/mcp"}}}Open in Cursor{"servers":{"djrobson5-agentmd":{"type":"http","url":"https://www.getagentmd.com/api/mcp"}}}Open in VS Code{"mcpServers":{"djrobson5-agentmd":{"type":"http","url":"https://www.getagentmd.com/api/mcp"}}}{"mcpServers":{"djrobson5-agentmd":{"serverUrl":"https://www.getagentmd.com/api/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
https://www.getagentmd.com/api/mcpAuth requiredTools
2| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The http(s) URL of the document or page to convert |
| mode | enum | No | "full" (default) returns the document body. "outline" returns just the heading tree — each line is `- [#3] Heading text (~120 tokens)`. For a long document, call with mode: 'outline' first, then fetch only what you need with section: '#3' or a heading title.full | outline |
| pages | string | No | PDFs only: 1-indexed, inclusive page ranges to convert, e.g. "1-3,5,8-" (an open-ended range runs to the last page). Ignored with a warning for non-PDF formats. |
| section | string | No | Return only one section: either "#<n>" using the index from a mode: 'outline' call (e.g. '#3'), or the heading text itself (case-insensitive; exact match wins, then prefix, then substring). Ignored when mode is 'outline'. |
| maxTokens | integer | No | Cap the returned markdown at roughly this many tokens, cutting at a paragraph boundary. When the output is cut, the result starts with a `> Truncated: ~X of ~Y tokens` line — narrow with pages or section rather than raising this. |
Details
From the project READMEagentmd-mcp
MCP server for AgentMD — convert PDF, DOCX, HTML, and URLs into clean, LLM-ready markdown, with tables preserved and web-page boilerplate stripped.
Agents ingest documents constantly, and most document formats are hostile to language models. This gives your agent three tools that turn any of them into markdown it can actually read.
Install
Get a free API key (50 conversions, no card) at https://www.getagentmd.com — or fully programmatically:
curl -X POST https://www.getagentmd.com/api/v1/keys/free \
-H "Content-Type: application/json" -d '{"email": "[email protected]"}'
Then:
Claude Code
claude mcp add agentmd --env AGENTMD_API_KEY=<your-key> -- npx -y agentmd-mcp
Any MCP client (mcp.json / claude_desktop_config.json):
{
"mcpServers": {
"agentmd": {
"command": "npx",
"args": ["-y", "agentmd-mcp"],
"env": { "AGENTMD_API_KEY": "<your-key>" }
}
}
}
Docker
docker build -t agentmd-mcp .
docker run -i --rm -e AGENTMD_API_KEY=<your-key> agentmd-mcp
The image runs the stdio server, so pass -i; the API key is supplied at run time with -e rather than baked into the image. To wire the container into an MCP client:
{
"mcpServers": {
"agentmd": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "AGENTMD_API_KEY", "agentmd-mcp"],
"env": { "AGENTMD_API_KEY": "<your-key>" }
}
}
}
Remote (no install) — the hosted server speaks streamable HTTP directly:
claude mcp add --transport http agentmd https://www.getagentmd.com/api/mcp \
--header "Authorization: Bearer <your-key>"
Tools
| Tool | Use it for |
|---|---|
convert_url_to_markdown | A web page or a document at an http(s) URL |
convert_file_to_markdown | A document on the local filesystem, by path |
convert_document_to_markdown | Document bytes you already hold, as base64 |
All three return markdown, prefixed with the detected title and any warnings.
Supported formats
- PDF — text extraction (scanned/image-only PDFs return a warning; OCR is on the roadmap)
- DOCX — headings, lists, and tables preserved
- HTML / URLs — main-article extraction, GFM tables, links resolved to absolute URLs
- Markdown / plain text — normalized passthrough
Limit: 25 MB per document.
Configuration
| Variable | Required | Purpose |
|---|---|---|
AGENTMD_API_KEY | yes | Your API key |
AGENTMD_BASE_URL | no | Point at a different deployment (self-hosting, staging) |
Pricing
First 50 conversions free (per email, no card). After that, $0.002 per successful conversion, billed monthly. No per-seat licensing — you pay for calls your agents actually make.
License
MIT (this client shim). The hosted service has its own terms.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.