HedgeDoc MCP Multitenant Proxy Server
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 Multitenant Proxy ServerCreate a new note titled 'Project Update' with markdown content."
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 Multitenant Proxy Server
This repository contains a Model Context Protocol (MCP) server that acts as a secure, multi-tenant proxy between an AI Assistant and the HedgeDoc backend API. It exposes 27 MCP tools covering 5 resource domains with full CRUD and permission management.
โจ Features
๐ Identity Passthrough โ Extracts the
Authorization: Bearer <token>header from incoming HTTP requests and forwards it to the HedgeDoc API without server-side authentication.๐ฅ Multi-Tenancy โ Uses Python
contextvarsto maintain thread-safe user identity isolation, ensuring all AI-driven actions are scoped to the authenticated user's permissions.๐ Full HedgeDoc Coverage โ 27 tools mapped to HedgeDoc API endpoints across 5 resource domains.
โก TOON Optimization โ Bulk list responses are automatically compressed using TOON (Token-Optimized Object Notation) to reduce token consumption and maximize context window efficiency.
๐ Efficient Gets โ GET responses return only commonly used fields by default. Full objects are available via an
include_all_fieldsflag.๐งช Comprehensive Testing โ 39 automated tests covering all tool domains, run via the test runner pipeline.
๐ท๏ธ Tool Annotations โ All tools expose standard MCP ToolAnnotations hints (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). The tags field carries grouping metadata (basic/primary/advanced + hedgedoc).
Related MCP server: hedgedoc-mcp-server
๐ง Environment Variables
Variable | Required | Description |
| Yes | Docker-internal URL of the HedgeDoc API (e.g. |
| Yes | Port number the MCP server listens on. |
| No | When |
| No | When |
| No | Public-facing URL for |
๐ฆ Installation & Local Development
Ensure you have Python 3.12+ installed.
Install dependencies:
pip install fastmcp httpx pydantic uvicorn toon-mcp-serverRun the server:
export HEDGEDOC_BASE_URL=http://localhost:7462 export HEDGEDOC_PUBLIC_URL=https://hedgedoc.example.com export MCP_SERVER_PORT=80 python -m src.main
๐ณ Docker Deployment
Build and run the server using Docker:
docker build -t hedgedoc-mcp:latest .
docker run -d --name hedgedoc-mcp \
-e HEDGEDOC_BASE_URL="http://hedgedoc-backend:3000" \
-e HEDGEDOC_PUBLIC_URL="https://hedgedoc.example.com" \
-e MCP_SERVER_PORT=80 \
-e IS_STATEFUL=false \
hedgedoc-mcp:latest
The MCP server serves at `http://hedgedoc-mcp:80/mcp` (Streamable HTTP).โ ๏ธ Important Notes
๐
include_all_fieldsโ Theinclude_all_fieldsparameter (available on allget_*andlist_*tools) controls whether all available fields are included in responses. Defaults toFalsefor performance; set toTrueonly when additional fields are needed.โก TOON Compression โ All bulk list responses are automatically compressed using TOON to reduce token consumption by 30โ60%.
๐ Required Fields & Defaults โ Each
create_*tool requires specific key fields. All other fields default to empty strings or reasonable values. The owner field is automatically set to the authenticated user for most resources.
๐ ๏ธ API Tool Mapping
The server implements 27 MCP tools organized into the following categories:
๐ Notes Core (6 tools)
create_noteโ Create a new note from markdown contentget_note_by_idโ Get a single note by ID or aliasupdate_noteโ Update an existing note's contentdelete_note_by_idโ Delete a note by ID or aliasget_note_contentโ Get raw markdown content of a noteget_note_metadataโ Get a note's metadata (title, tags, etc.)
๐ Notes Advanced (7 tools)
list_note_mediaโ List all media files attached to a notelist_note_revisionsโ List all revisions of a noteget_note_revision_by_idโ Get a specific revision by UUIDrevert_to_revisionโ Revert a note to a previous revisionadd_aliasโ Add an alias to a notemake_alias_primaryโ Set an alias as primary or non-primaryremove_aliasโ Remove an alias from a note
๐ Notes Permissions (6 tools)
get_note_permissionsโ Get a note's permission settingsset_note_user_permissionโ Set a user's permission on a noteremove_note_user_permissionโ Remove a user's permission from a noteset_note_group_permissionโ Set a group's permission on a noteremove_note_group_permissionโ Remove a group's permission from a notechange_note_ownerโ Change the owner of a note
๐ Notes Listing (4 tools)
list_all_my_notesโ List notes owned by the current userlist_all_shared_notesโ List notes shared with the current userlist_all_public_notesโ List public notes visible to the current userlist_all_pinned_notesโ List notes pinned by the current user
๐ค Profile & Media (4 tools)
get_my_profileโ Get the current user's profile informationlist_all_my_mediaโ List all media files owned by the current userget_media_by_idโ Get a single media file by UUIDdelete_media_by_idโ Delete a media file by UUID
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server โ exposes tasks, projects, messages, and files as tools for AI agents.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA production-grade MCP server designed for multi-tenant, authenticated, and observable AI agent systems, enabling secure tool execution across heterogeneous data sources.62MIT
- AlicenseAqualityCmaintenanceEnables creating, reading, and managing HedgeDoc 1.x notes and Mermaid diagrams from AI agents via the MCP protocol.111MIT
- FlicenseNot gradedqualityCmaintenanceA single MCP server that exposes safe, permission-checked tools for AI assistants to reach file systems, databases, APIs, Git, cloud services, and business applications.-
- FlicenseNot gradedqualityCmaintenanceMCP server for a full-stack note-taking application, exposing CRUD tools for notes with SSE transport for AI agent integration.1-