hedgedoc-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hedgedoc-mcp Create a new note with the title 'Meeting Notes' and content 'Discuss Q3 goals'."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
hedgedoc-mcp
An MCP server that lets AI agents — Claude Code, Codex, Cursor, VS Code, OpenCode, Pi, or any other MCP client — read and write notes on a self-hosted HedgeDoc 1.x instance.
HedgeDoc 1.x has no API token system, so this server handles the real auth model (session cookies from email/password login) and exposes it as a clean, agent-friendly toolset.
Why this exists
HedgeDoc is a great self-hosted, open-source, collaborative markdown editor. But if you want an AI agent to write notes to it programmatically, you hit a wall immediately: HedgeDoc 1.x has no API tokens. Every write endpoint (POST /new, etc.) requires an authenticated browser-style session, tracked via the Express session cookie configured by the instance (normally connect.sid).
This project does the unglamorous work of handling that correctly — login, cookie storage, automatic re-authentication on expiry — and wraps it in an MCP server so any agent can just call hedgedoc_create_note and not think about any of it.
Related MCP server: Joplin Server MCP
Features
🔐 Handles HedgeDoc 1.x's real auth model (session cookies, not tokens)
🔁 Auto re-login on session expiry — no manual cookie refresh needed
🛠️ 5 MCP tools: create, read, info, whoami, history
🐍 Standalone Python client (
hedgedoc_mcp.client.HedgeDocClient) usable outside MCP too✅ Fully tested — against an in-process fake HedgeDoc server; no live instance required
📦 Works with any MCP client — setup guides for 20+ agents: Claude Code, Codex, Cursor, VS Code, OpenCode, Pi, Gemini CLI, Goose, Zed, and more
Quick start
1. Install uv
Your agent starts the server for you with uvx, which downloads and caches hedgedoc-mcp from PyPI on first use. You only need uv installed:
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS / Linux
# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"You don't run uvx hedgedoc-mcp yourself: it's a stdio server, so it just waits for an agent to talk to it.
uv tool install hedgedoc-mcp # persistent install; point your agent at the `hedgedoc-mcp` executable
pip install hedgedoc-mcp # into an existing environment
# Unreleased changes from the main branch:
uvx --from git+https://github.com/mrsunglasses-experiments/hedgedoc-mcp hedgedoc-mcp2. Choose your credentials
The server is configured entirely through environment variables:
Variable | Required | Description |
| Yes | Your instance's URL as shown in the browser, e.g. |
| One of these two options | Email/password login. The server logs in on first use and again whenever the session expires. |
| One of these two options | A session cookie from |
| No | Only if your instance uses a session cookie name other than |
Recommended: set HEDGEDOC_EMAIL and HEDGEDOC_PASSWORD. That's all you need, and you never have to refresh anything. Email login must be enabled on the instance (CMD_EMAIL=true, the default).
Set these in your agent's MCP config (step 3), not just in your shell. Most agents start MCP servers with a minimal environment, so variables you export usually don't reach the server.
uvx --from hedgedoc-mcp hedgedoc-mcp-login --url https://md.example.com --email you@example.comIt prompts for your password (or reads HEDGEDOC_PASSWORD; avoid --password, which lands in your shell history) and prints HEDGEDOC_SESSION_COOKIE=... for your agent's config. With --write-env .env, it also saves the value to a file readable only by you. The server doesn't read .env files itself.
3. Connect your agent
For Claude Code:
claude mcp add hedgedoc --scope user \
-e HEDGEDOC_URL=https://md.example.com \
-e HEDGEDOC_EMAIL=you@example.com \
-e HEDGEDOC_PASSWORD='your-password' \
-- uvx hedgedoc-mcpMost other agents take the same three pieces of information: command uvx, argument hedgedoc-mcp, and the environment variables above. Config files and formats differ, though. docs/CLIENTS.md has a ready-to-paste config for each of these clients:
Terminal agents | Claude Code · Codex CLI · Gemini CLI · GitHub Copilot CLI · OpenCode · Pi · Amp · Goose · Crush · Hermes Agent · Factory Droid · Qwen Code · Devin CLI |
Editors and IDEs | Cursor · VS Code (Copilot) · Devin Desktop (Windsurf) · Zed · JetBrains · Cline · Kilo Code · Continue · Kiro |
Desktop apps |
The guide also covers keeping passwords out of config files that get committed, plus troubleshooting.
4. Try it
Ask your agent something like "Create a HedgeDoc note summarizing this conversation" or "Which HedgeDoc account are you logged in as?". If the tools don't show up, check the setup with MCP Inspector, which runs the server outside any agent.
Available tools
Tool | Description |
| Create a new note (optionally with a custom URL alias). Returns the note ID and URL. |
| Fetch a note's raw markdown content by ID or alias. |
| Get a note's title, description, view count, and timestamps. |
| Verify the session is valid and show the logged-in user. |
| List the logged-in user's recently viewed/pinned notes. |
There is no update tool: HedgeDoc 1.x has no HTTP endpoint for editing a note (see Known limitations), so write a note's full content when creating it.
Using the Python client directly
You don't need MCP to use this — the underlying client is a normal Python class:
from hedgedoc_mcp.client import HedgeDocClient
client = HedgeDocClient("https://md.example.com")
client.login(email="you@example.com", password="your-password")
result = client.create_note("# Research notes\n\nSome findings...")
print(result.url)
content = client.read_note(result.note_id)
info = client.note_info(result.note_id)Known limitations
HedgeDoc 1.x's HTTP API is genuinely limited compared to newer forks — see docs/LIMITATIONS.md for the full rundown, including:
No API tokens (session-cookie auth only)
No HTTP note-update endpoint
No delete endpoint over HTTP
These are constraints of the HedgeDoc 1.x server itself, not this client — the docs explain the workarounds this project uses and what genuinely isn't possible.
Development
git clone https://github.com/mrsunglasses-experiments/hedgedoc-mcp.git
cd hedgedoc-mcp
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
pytest # run tests (against an in-process fake HedgeDoc; no live server needed)
ruff check . # lint
ruff format --check . # formattingSee docs/ARCHITECTURE.md for how the auth flow and MCP layer fit together, and CONTRIBUTING.md for contribution guidelines.
License
MIT — see LICENSE.
Available Tools
5 toolshedgedoc_create_noteA
Create a new note on the HedgeDoc instance.
Returns JSON with two fields: 'note_id' (the unique identifier / URL slug)
and 'url' (the full URL where the note can be viewed or shared).
Use alias to assign a human-readable slug such as 'q3-research-notes'.
Notes cannot be edited afterwards: HedgeDoc 1.x has no HTTP endpoint for
updating note content, so write the complete content in one call.
Alias support requires FreeURL mode enabled on the server (CMD_ALLOW_FREEURL=true).
Inputs: content (required), alias.
hedgedoc_list_historyARead-only
List the logged-in user's recently viewed and pinned notes.
Returns a JSON array of note objects. Each object includes: 'id' (note ID or alias), 'text' (note title), 'tags' (array of strings), 'pinned' (boolean), and 'time' (last-viewed timestamp in milliseconds). Requires a valid session — returns an error if not authenticated.
Inputs: no named parameters.
hedgedoc_note_infoARead-only
Get metadata for a note.
Returns JSON with: 'title' (string), 'description' (string or null), 'viewcount' (integer — total views), 'createtime' and 'updatetime' (ISO 8601 timestamps, e.g. '2026-08-16T10:30:00.000Z'). Public notes need no authentication.
Inputs: note_id (required).
hedgedoc_read_noteARead-only
Fetch the raw markdown content of an existing note by its ID or alias.
Returns the note's markdown as a plain string. Public notes can be read without authentication; private ones need the configured account's access.
Inputs: note_id (required).
hedgedoc_whoamiARead-only
Verify the current session is valid and return the logged-in user's profile.
Returns JSON with user info (status, id, name, photo). Call this to confirm the server is correctly authenticated before attempting write operations, or to identify which account is active.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: create content, read content, inspect metadata, verify authentication, and list history. The only potential overlap is read_note vs note_info, but the descriptions clearly separate raw markdown retrieval from metadata fields. No two tools could be reasonably confused.
All names share a consistent hedgedoc_ prefix and mostly follow a verb_noun pattern (create_note, read_note, list_history). Minor deviations are note_info (noun_info) and whoami (bare verb), which break the pattern but remain unambiguous. Overall predictable and readable.
Five tools is slightly thin but reasonable for a read-centric HedgeDoc integration whose API lacks an update endpoint. Each tool earns its place: create, read, metadata, auth check, and history. It is a bit under-scoped for fuller note management but not problematically so.
The surface covers create, read, and metadata, plus auth and history, but has no delete operation and no way to update content (the latter is a documented API limitation). Listing only recently viewed/pinned notes rather than a full note listing is also a gap. Notable lifecycle operations are missing, though some are impossible via the HedgeDoc 1.x API.
Maintenance
Related MCP Connectors
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for AI agents to read, write, and organize notes in a local-first, human-in-the-loop note-taking app.9 npm2MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for Joplin Server that gives LLMs full access to notes, notebooks, tags, and attachments via the REST API.7MIT
- AlicenseAqualityDmaintenanceEnables creating, reading, and managing HedgeDoc 1.x notes and Mermaid diagrams from AI agents via the MCP protocol.1118 PyPI1MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for a full-stack note-taking application, exposing CRUD tools for notes with SSE transport for AI agent integration.1-