Open source · MIT license · v3.5.1

Markdown knowledge base.
For one person or a small team.

Run it solo as a personal brain, or as a small company's shared knowledge base — corporate SSO sign-in, namespace-scoped role hierarchy, live collaboration, AI-ready over MCP. Notes are plain .md files on your hardware. No cloud. No lock-in.

$ git clone https://github.com/mahsanamin/mdnest.git && cd mdnest
$ ./mdnest-server setup
# edit mdnest.conf — pick AUTH_MODE, USER_PROVIDER, mounts
$ ./mdnest-server rebuild
# solo: http://localhost:3236 · team (with SSO + Caddy): https://notes.example.com
mdnest editor with split view — markdown editing on the left, live preview with Mermaid diagrams on the right

One platform. Every interface.

Access your notes from the web, terminal, REST API, or AI agents — all connected to the same plain files on your server.

Web Browser Live editor, real-time collab
Mobile Read & edit on the go
CLI Terminal, scripts, automation
REST API Build anything on top
AI Agents Claude, Cursor via MCP
Encrypted connection
Your Server mdnest on Docker
REST API WebSocket JWT Auth
Plain .md Files Your data, your disk
Team Access Roles & permissions
Git Backup Auto sync to GitHub

Everything runs on your server. No cloud services required. Team features and git sync are optional.

Why mdnest?

Your markdown. Your server. Your rules.

Use it the way you like

Personal knowledge base or team workspace. No compromises.

Live rich editor

Obsidian-style editing where markdown renders inline as you type. Bold shows bold, headings render instantly. Click-to-edit tables and mermaid diagram labels. Or use plain text mode -- your choice.

Inline comments with threads

Highlight any text and leave a comment; passages stay visibly yellow until resolved. Reply in threaded conversations. Click a highlight to jump to the chat. Comments are anchored to invisible UUIDs, so moving or renaming files keeps them attached.

Real-time collaboration

See who's editing, where their cursor is, and what they're typing -- live. Built-in WebSocket presence with conflict detection. No external services.

Three-tier role hierarchy

One or two SuperAdmins overall, plus per-team Admins who own a single namespace — invite teammates, manage grants, trigger git-sync — without seeing other teams. Collaborators get only the paths they're granted. Path depth caps prevent overly-narrow grants.

Corporate SSO + 2FA

Point mdnest at your OIDC provider — Google Workspace, Okta, Microsoft Entra, Keycloak, Auth0. Users sign in with their existing corporate accounts; the IdP owns MFA. Or use local username/password with TOTP, or Firebase Auth as a peer mode. One USER_PROVIDER setting flip — no code changes.

AI-native

Built-in MCP server. Claude, Cursor, and other AI agents can read, write, search, and organize your notes. Your knowledge base becomes context for your AI workflows.

Host once, access everywhere

Solo: laptop or home server with Tailscale for encrypted private access from any device. Team: built-in Caddy for automatic HTTPS via Let's Encrypt, or nginx + certbot, or Cloudflare Tunnel — backend stays loopback, only the proxy is exposed.

Plain files, zero lock-in

Notes are .md files in directories. cat, grep, git, VS Code -- every tool you already use works. No proprietary format, no migration needed.

CLI + REST API

The mdnest CLI lets you read, write, search, and manage notes from any terminal. Full REST API with token auth for scripts and automations.

Private by default

Binds to localhost. No cloud, no telemetry, no third-party accounts. Everything stays on your hardware. Add Tailscale for encrypted remote access.

Git sync on your terms

Optional auto-commit and push to a private repo. Pull from admin panel. Each namespace can have its own remote.

Works on every device

Responsive web UI for desktop, tablet, and mobile. Edit and preview toggle on phones. Drag to resize panels on desktop.

Terminal-first when you want it

The mdnest CLI works from any machine. Login once with a token, then read, write, search, and organize notes without leaving your terminal. Perfect for scripts, cron jobs, and AI pipelines.

CLI documentation
Terminal
$ curl -fsSL https://raw.githubusercontent.com/mahsanamin/mdnest/main/install-cli.sh | bash
Installed: /usr/local/bin/mdnest

$ mdnest login https://notes.company.com mdnest_abc...
→ Logged in to @work (SERVER_ALIAS from /api/config)

$ mdnest list @work # namespaces on @work
engineering product design

$ mdnest list @work/engineering # files in namespace
architecture/system-overview.md ...

$ mdnest read @work/engineering/architecture/system-overview.md
# System Architecture Overview ...

$ mdnest search @work/product "roadmap"
roadmap/2026-q2.md:1 # Q2 2026 Roadmap

$ echo "standup notes" | mdnest append @work/team/log.md -
ok

Up and running in 3 minutes

1

Configure

Clone the repo, run setup, edit credentials and mounts. For a team install: also flip USER_PROVIDER=sso and paste your IdP's client ID + secret.

./mdnest-server setup
./mdnest-server add-namespace
2

Deploy

One command builds and starts everything in Docker — backend, frontend, Postgres (if multi-user), git-sync, and Caddy (if you set CADDY_DOMAIN for automatic HTTPS).

./mdnest-server rebuild
3

Collaborate

Solo: add Tailscale and reach mdnest from any of your devices. Team: invite teammates from the admin panel, assign per-team Admins, watch cursors live as people edit.

# solo
tailscale serve --bg --https 3236 ...
# team
open https://notes.example.com

Your notes. Your server. Your rules.

Open source. Free forever. Personal or team. Takes 3 minutes to set up.

View on GitHub