Labsco
MCP SERVER

Logseq MCP Server

by dailydaniel

Let agents read your whole Logseq graph but write only inside their own namespace, with every write logged to today's journal.

Agent MemoryVerified
Summary
Turns an existing Logseq graph into agent memory you can still supervise, because the write surface is small and every write leaves a trace.

Two design choices do the work: agents write only under their own prefix, and each successful write appends a line to today's journal, so reviewing what they did is part of a note you already open. The guide tool and the named-query mechanism are the other half — they hand a model verified Datalog instead of letting it compose queries by hand.

What it is

A server for the file/Markdown version of Logseq, reached through Logseq's local HTTP API. Reads span the graph; writes are confined to one namespace prefix.

What you get
  • Full-text search across block content, using ripgrep over the graph folder when you point it at one, otherwise a datascript content match
  • Task lookup by marker, tag, descendant tag, page or priority
  • Namespace listing, which surfaces the child pages a parent page's own read will never show
  • Pages and blocks read as a normalized tree with ((block refs)) resolved, keeping each resolved block's uuid and status so you can act on it
  • Raw Datalog when you need it, plus named queries from the config that can be registered as tools of their own
  • A built-in guide tool returning the verified query and write rules for the graph, so a model does not re-derive them
  • Writes inside the agent prefix — create or update a page, set or remove page properties, and edit a block with read-before-write enforced by passing its exact current content
  • Structured task creation, the only path to a task block, and a narrow cross-namespace channel that changes nothing but a task's status marker
  • An audit line appended to today's journal on every successful write, and blacklisted pages hidden and redacted from every read
Requirements

Logseq running with its HTTP APIs server enabled (Settings → Features, then start it from the plug menu) and an authorization token from those settings, passed as LOGSEQ_API_TOKEN. Installed from PyPI as mcp-server-logseq and launched with uvx over stdio; LOGSEQ_API_URL points at Logseq, default http://localhost:12315. A streamable-http transport is also available for remote clients and requires its own bearer secret, LOGSEQ_MCP_HTTP_TOKEN — the server refuses to start in that mode without one. A config file is optional; the defaults are read-mostly.

Setup effort

One command plus a key — uvx mcp-server-logseq, then supply credentials