mdnest guide for AI agents

mdnest is a self-hosted Markdown notes server. You reach it with the mdnest command. Notes are plain Markdown files. Read this guide before you read or write notes, and follow it.

Find servers and paths

Pick the right command

Command Use it for
read <path> Print a note.
list <@alias/ns[/folder]> Show the files in a namespace or folder.
search <@alias/ns> "words" Find notes that contain the words.
create <path> - Make a NEW note. Fails if the note exists.
write <path> - Replace an EXISTING note. Fails if it does not exist.
edit <path> "old" "new" Change one exact string and leave the rest alone.
append <path> - / prepend <path> - Add to the end or the start. Creates the note if it is missing.
delete <path> Delete a note or folder.
move <path> <new-path> Move or rename. Never overwrites.

Choose the command on purpose. create and write fail loudly when the note is not in the state you expected, and that is the safe result: it tells you something changed. Do not switch to the other command just to make the error go away. Read the note first and find out why.

For a small change, edit is safer than reading the note, changing it and writing it back: it fails instead of overwriting someone else's newer save.

Write content safely

Send the content on standard input with - as the content argument:

cat > /tmp/note.md <<'EOF'
# Title

Code with `backticks`, "quotes" and $dollars stays as written.
EOF
mdnest create @alias/ns/folder/note.md - < /tmp/note.md

printf '%s\n' "$text" | mdnest create <path> - works too.

How notes render

Mermaid diagrams

Colors:

classDef frontend fill:#1971c2,stroke:#74c0fc,stroke-width:2px;
classDef backend  fill:#2f9e44,stroke:#8ce99a,stroke-width:2px;
classDef external fill:#e8590c,stroke:#ffc078,stroke-width:2px;
classDef data     fill:#6741d9,stroke:#b197fc,stroke-width:2px;
classDef infra    fill:#0c8599,stroke:#66d9e8,stroke-width:2px;
class Web,App frontend;

Syntax mistakes that replace the whole diagram with a parse error:

Keep one direction (flowchart LR or TB) and short labels, and use <br/> for a line break.

Chat with people and other agents

A chat is a note that people and agents post to. It is on by default (the server can turn it off with ENABLE_CHAT=false).

mdnest chat help prints every chat option.

Publish an HTML page

When the server has HTML pages on (ENABLE_PAGES), you can publish an HTML page, a report or dashboard written in HTML, for people to view in mdnest.

Check first, every time: mdnest features @alias (or --json) shows pages on or off, and whether a page's scripts run. Over MCP, call server_features. When pages is off, never offer or try one: write a Markdown note.

When to make one:

How:

More help