← Applications

Stichpunkt

A fast, self-hosted markdown wiki where plain .md files are the database. Agents write safely through MCP, and you read.

Stichpunkt on desktop: folder tree on the left, the article in the middle, outline, backlinks and properties on the right

Three-column desktop reader with folder tree, rendered markdown, outline, backlinks and properties.

Run locally →

A knowledge base is a folder of markdown files

Stichpunkt is German for "bullet point". The server renders a directory of markdown files to a fast, mobile-first reading interface. It keeps an in-memory index for search, tags and backlinks, and exposes the same operations over a REST API and an MCP server.

The web UI is deliberately read-only, with one exception: the MANIFEST editor on /manifest validates and saves that system page in place. Agents and scripts make all other changes through MCP or the token-protected REST API. People get a page built for reading. Agents get a write path that detects conflicts.

Because the files are plain markdown, you can still edit, sync, grep and back them up with any tool you like.

Files are the database

The server reads plain .md files. Edits made outside the app show up too.

Agents write safely

31 MCP tools with conflict detection, history, bulk edits with undo and a rule manifest.

Built for reading

Three columns on desktop, a bottom bar on the phone, and offline reading as a PWA.

Nothing executes

The server parses and validates queries and expressions. It never runs them as code.

What Stichpunkt does

Built for reading

CommonMark and GFM, frontmatter, [[wikilinks]] with aliases and heading anchors, #tags and syntax-highlighted code. Folders are namespaces.

Callouts, footnotes, emoji shortcodes and transclusion with ![[Page]]. Mermaid, Vega-Lite and KaTeX render lazily in the browser.

A quick switcher on Ctrl/⌘+K, breadcrumbs, outline, backlinks and a properties rail.

Stichpunkt on desktop: folder tree, article, outline, backlinks and properties

Collections are typed tables

Typed tables in SQLite with properties such as text, number, select, multi-select, date, checkbox, email and URL. Rows and cells are real records, filtered and sorted in SQL.

A table view with a filter bar, click-to-sort columns, collapsible group-by sections, column aggregates (count, sum, average, min, max), saved views and live reload. On a phone a table turns into cards.

Supports bulk selection, bulk edit and batch undo, with every row change recorded alongside its actor. CSV and JSON export return a portable snapshot.

A Books collection rendered as a table inside a page, with title, author, year and status columns

Declarative queries and expressions

A fenced pages block with a small YAML body lists pages from the index. Filter by tag, folder or links, sort by title, date or any frontmatter key, and show the result as a list, table or count.

${ … } is evaluated by a small own expression language: a Pratt parser and tree-walking evaluator in TypeScript, with no eval and strict limits.

```pages
tag: project
sort: modified desc
show: table
columns: [title, status]
limit: 20
```

Follows changes, works offline

The UI follows content changes over server-sent events. Changed blocks flash, the tree and the recent list update, and nothing reloads while text is selected.

As an installable PWA, the service worker caches the shell and the last 50 or so visited pages for offline reading.

Light, dark and system themes. The page applies the choice before first paint, so nothing flashes on reload.

Two agents write the same page

Every write carries the hash of the version the writer last read. If the page changed in between, the server answers 409 and nothing is overwritten. Let both agents read, write with one, then write with the other.

Agent A

base_hash none

Notes/Plan.md


              

hash

Agent B

base_hash none

    A simulation in your browser that follows the documented rule. It does not talk to a server.

    Run it with Docker or Node

    Requires Docker with Compose. Without Docker you need Node.js 22 or newer.

    With Docker

    git clone https://github.com/ssalentin/stichpunkt.git
    cd stichpunkt
    
    cp .env.example .env   # set MDWIKI_API_TOKEN
    mkdir space            # or copy your markdown here
    STICHPUNKT_COMMIT=$(git rev-parse HEAD) \
      docker compose up -d --build

    The sample compose file does not publish a port. Put your reverse proxy in front.

    Without Docker

    npm ci && npm run build
    SPACE_DIR=./space MDWIKI_API_TOKEN=… node build/index.js

    Generate a token with openssl rand -base64 32. It must have at least 32 characters, otherwise the API and MCP always answer 401.

    Read in the browser, write over MCP or REST

    The web UI, the REST API and the MCP tools share one service layer, so they behave the same.

    Register the MCP server, for example with Claude Code:

    claude mcp add --transport http stichpunkt https://stichpunkt.example.org/mcp \
      --header "Authorization: Bearer $MDWIKI_API_TOKEN"

    Create a page. base_hash: "" means the page must not exist yet.

    curl -X PUT https://stichpunkt.example.org/api/v1/pages/Notes/Hello \
      -H "Authorization: Bearer $MDWIKI_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"content": "# Hello\n\nA first note #demo", "base_hash": ""}'

    Open the site through your proxy. Browse by folder, search, or press Ctrl/⌘+K for the quick switcher.

    The public demo shows example content only. Its write API is closed, because the token is generated at each start and never stored.

    Routes and MCP tools

    All routes require Authorization: Bearer <token>. Page names are paths without .md.

    Method and pathPurpose
    GET /api/v1/searchFull-text search over pages and collection rows
    GET /api/v1/pages/<path>Content, frontmatter, hash and modification time
    PUT /api/v1/pages/<path>Write with base_hash. A stale hash returns 409 with the current version
    POST /api/v1/pages/<path>Append to a page
    POST /api/v1/pages/moveRename or move, and rewrite only the links that would break
    POST /api/v1/pages/batchWrite several pages atomically
    POST /api/v1/queryRun a pages query
    GET /api/v1/linksDead links, ambiguous links, orphans and missing anchors
    GET /api/v1/history/<path>Revision list, newest first
    GET /api/v1/diff/<path>Unified diff against a revision
    GET /api/v1/exportThe whole instance as one JSON bundle

    31 MCP tools

    GroupTool names
    Reading and discovery
    search list_pages read_page list_tags pages_by_tag get_backlinks query_pages evaluate
    Page writes and links
    write_page write_pages append_to_page move_page delete_page upload_attachment check_links
    History and manifest
    history diff activity get_manifest check_manifest validate_page
    Collections and batches
    list_collections get_collection query_collection_rows create_collection_row update_collection_row delete_collection_row save_collection_view bulk_update_collection_rows undo_collection_batch collection_history
    Safe writes

    Optimistic concurrency through a content hash, and per-file write serialisation. The server rejects paths with .., absolute paths, backslashes, dot-files and symlinks that leave the space.

    History, diff and activity

    Every MCP or REST write keeps a revision with actor, tool, byte counts and an optional note. The server keeps 50 revisions per page by default. Direct file edits are not versioned.

    The agent manifest

    An optional page named MANIFEST holds the documentation rules of the space. The frontmatter is machine-readable, the body is prose for humans and agents. Writes return warnings when a page does not fit the manifest.

    Reading and working layers

    A folder can belong to a reading, working or config layer. Search and listings hide working pages unless asked, and those pages show a draft notice. This is visibility, not access control.

    Environment variables

    VariableDefaultMeaning
    SPACE_DIR./spaceThe markdown directory
    MDWIKI_API_TOKENnoneBearer token for /mcp and /api, at least 32 characters
    POLL_INTERVAL10000Milliseconds between polls for changes made outside the app
    MAX_WRITE_BYTES1048576Maximum size of a page write
    MAX_UPLOAD_BYTES20971520Maximum size of an attachment
    HISTORY_KEEP50Revisions kept per page. 0 keeps every revision
    COLLECTIONS_DB/var/lib/stichpunkt/collections.sqliteThe SQLite file behind collections

    The full list, including the reverse-proxy contract and the health check, is in the README.

    One container, one service layer

    • Files are the source of truth. The index is rebuilt in memory and refreshed by polling modification times.
    • One service layer. The UI, the REST API and the MCP tools share the same operations.
    • Two routes in. Browsers come through a proxy with single sign-on, agents through a machine route with a bearer token.
    • Single container. SvelteKit with the Node adapter.

    Links

    browser ──► UI proxy (SSO) ──────┐
                                     ▼
    agents  ──► machine route ──► stichpunkt
                (bearer token)     ├─ web UI
                                   ├─ REST API
                                   ├─ MCP server
                                   └─ in-memory index
                                        │
                                        ▼
                                   SPACE_DIR (*.md)
    A collection on a phone, shown as cards with author and status

    More projects