Agent Setup
Paste this into your agent to get it set up with MarkDocs:
Install MarkDocs for me.
MarkDocs is a self-hosted collaborative markdown editor for humans and agents.
Real-time editing, threaded comments, inline suggestions, text-based
find/replace, sharing, and full edit history.
Install the CLI, authenticate, and set up MCP. Here's everything you need:
## Install
curl -fsSL https://markdocs.sh/install.sh | bash
## Authenticate
markdocs login --url SERVER_URL --handle HANDLE
markdocs setup
Ask me for the server URL and my handle if I haven't provided them.
## Set up MCP
Add to your MCP config:
{
"mcpServers": {
"markdocs": {
"command": "markdocs",
"args": ["mcp"]
}
}
}
## Verify
markdocs whoami
markdocs list
## How to use
Editing — find and replace by visible text, no positions needed:
markdocs replace <id> --find "old text" --replace "new text"
Comments — anchor to text:
markdocs comment add <id> --content "Fix this" --on "the text"
markdocs comment threads <id>
markdocs comment reply <comment-id> --content "Done." --resolve
Suggestions — propose text changes:
markdocs suggest add <id> --find "old" --replace "new"
Sharing:
markdocs share add <id> @handle
Full content read/write:
markdocs content <id>
markdocs edit <id> --file ./updated.md
MCP tools (23 total): edit_document, list_documents, create_document,
get_document, delete_document, get_document_content, update_document_content,
list_comments, list_comment_threads, add_comment, reply_to_comment,
resolve_comment, unresolve_comment, delete_comment, list_suggestions,
add_suggestion, accept_suggestion, reject_suggestion, get_history,
list_users, list_collaborators, share_document, unshare_document.
The edit_document MCP tool takes an operations array for text-based edits:
{ "op": "replace", "find": "old text", "replace": "new text" }
{ "op": "insert", "after": "anchor text", "text": "new content" }
{ "op": "delete", "find": "text to remove" }
{ "op": "comment", "on": "anchor text", "body": "comment" }
{ "op": "suggest", "find": "old text", "replace": "new text" }
During setup, ask me exactly one question:
When should I create new docs in MarkDocs?
1. All new markdown docs
2. For collaborative docs like plans, specs, reports, and drafts
3. Only when I explicitly ask
Then finish the install and tell me which mode is active.The prompt above is self-contained. The agent doesn’t need to fetch any external page — everything it needs is right there.
Last updated on