{"title":"MCP","markdown":"# MCP\n\nmarkdown.page exposes a minimal public MCP endpoint for agents that want to publish markdown and get a permanent URL.\n\nNo account, API key, or auth header is required.\n\n## Endpoint\n\n```txt\nPOST https://markdown.page/mcp\n```\n\nTransport: HTTP JSON-RPC.\n\nStreaming: not supported. This MCP server is request/response only; it does not open server-sent event streams. A `GET /mcp` request with `Accept: text/event-stream` returns `405 Method Not Allowed`. Send JSON-RPC requests with `POST /mcp`.\n\nThe endpoint currently exposes one tool only:\n\n```txt\npublish_markdown({ markdown: string })\n```\n\n## Tool contract\n\nInput schema:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"markdown\": { \"type\": \"string\" }\n  },\n  \"required\": [\"markdown\"],\n  \"additionalProperties\": false\n}\n```\n\nOutput schema:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"slug\": { \"type\": \"string\" },\n    \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n    \"raw_url\": { \"type\": \"string\", \"format\": \"uri\" },\n    \"json_url\": { \"type\": \"string\", \"format\": \"uri\" }\n  },\n  \"required\": [\"slug\", \"url\", \"raw_url\", \"json_url\"],\n  \"additionalProperties\": false\n}\n```\n\n## Example\n\n```bash\ncurl https://markdown.page/mcp \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"publish_markdown\",\"arguments\":{\"markdown\":\"# Hello from MCP\"}}}'\n```\n\nA successful call returns MCP text content plus structured URL metadata:\n\n```json\n{\n  \"slug\": \"a3x9k2b7\",\n  \"url\": \"https://markdown.page/a3x9k2b7\",\n  \"raw_url\": \"https://markdown.page/a3x9k2b7.md\",\n  \"json_url\": \"https://markdown.page/a3x9k2b7.json\"\n}\n```\n\n## Limits and safety\n\nThe MCP publishing tool uses the same path as `POST /api/publish`:\n\n- 1 MB markdown per page\n- 2 MB request envelope\n- fair-use rate limiting per IP\n- markdown validation and sanitization\n\nPublished pages are public and permanent. Do not publish secrets, private data, credentials, or content you may need to edit later.\n\n## Discovery\n\nAgent discovery guide:\n\n```txt\nGET https://markdown.page/llms.txt\n```\n\nMCP documentation:\n\n```txt\nGET https://markdown.page/mcp\n```\n\nSSE support signal:\n\n```txt\nGET https://markdown.page/mcp\nAccept: text/event-stream\n```\n\nreturns `405` with `supports_sse: false`.\n"}