Skip to Content
MCP Server

MCP Server

MarkDocs exposes 23 tools and 2 resources over stdio . Your MCP client (Claude Code, Claude Desktop, Cursor, etc.) spawns markdocs mcp as a child process automatically — you never run it yourself.

Setup

1. Install the CLI

curl -fsSL https://markdocs.sh/install.sh | bash

2. Authenticate

markdocs login --url https://your-instance.com --handle yourhandle markdocs setup

Or pass credentials via environment variables in the client config (see below).

3. Add to your MCP client

Add the config to your client’s config file. The client will start and manage the markdocs mcp process for you.

Claude Code (.mcp.json in your project root):

{ "mcpServers": { "markdocs": { "command": "markdocs", "args": ["mcp"] } } }

Claude Desktop (claude_desktop_config.json):

{ "mcpServers": { "markdocs": { "command": "markdocs", "args": ["mcp"] } } }

Cursor / VS Code — same pattern. Any stdio-compatible MCP client works.

With env vars (skip markdocs login):

{ "mcpServers": { "markdocs": { "command": "markdocs", "args": ["mcp"], "env": { "MARKDOCS_API_KEY": "your-api-key", "MARKDOCS_URL": "https://your-instance.com" } } } }

Tools

Documents

ToolDescription
list_documentsList all documents
create_documentCreate a document
get_documentGet document by ID
delete_documentSoft-delete a document
get_document_contentGet markdown content
update_document_contentReplace entire markdown content
edit_documentText-based editing with find/replace, insert, delete, comment, and suggest operations

Comments

ToolDescription
list_commentsList comments (flat)
list_comment_threadsList comments as threaded conversations with nested replies
add_commentAdd inline comment (position-based)
reply_to_commentReply to a comment thread, optionally resolving it
resolve_commentResolve a comment
unresolve_commentUnresolve a previously resolved comment
delete_commentDelete a comment

Suggestions

ToolDescription
list_suggestionsList suggestions
add_suggestionPropose a text replacement (position-based)
accept_suggestionAccept a suggestion
reject_suggestionReject a suggestion

Other

ToolDescription
get_historyGet edit history
list_usersList workspace users
list_collaboratorsList document collaborators
share_documentShare by handle
unshare_documentRemove collaborator

edit_document

The edit_document tool is the recommended way for agents to modify documents. It uses text-based targeting so agents find content by quoting visible text instead of counting character positions.

Operations

{ "document_id": "doc-id", "operations": [ { "op": "replace", "find": "old text", "replace": "new text" }, { "op": "insert", "after": "some heading", "text": "\n\nNew paragraph." }, { "op": "insert", "before": "## Section", "text": "Inserted before.\n\n" }, { "op": "delete", "find": "text to remove" }, { "op": "comment", "on": "text to comment on", "body": "Is this right?" }, { "op": "suggest", "find": "old phrasing", "replace": "better phrasing" } ] }

Content ops (replace, insert, delete) apply first as one batch. Review ops (comment, suggest) apply after against the updated content.

Use "occurrence" (0-indexed number, "first", or "last") to disambiguate when the same text appears multiple times.

Resources

URIDescription
markdocs://documentsAll documents as JSON
markdocs://documents/{id}Single document as JSON
Last updated on