Docs/Connecting to Minerva/MCP use

MCP use

The Model Context Protocol (MCP) is a standard way to give an AI agent tools. Minerva's MCP server exposes the same reads and proposals as the CLI — as tools any MCP client can call — so an agent like Claude Desktop, a coding agent, or an editor can ground itself in your thoughtbase and hand work back through the approval gate.

Not the other direction

This page is Minerva as an MCP server: your thoughtbase goes out to an outside agent. If you want the reverse — connecting Minerva to somebody else's MCP server, so its tools are available to Minerva's own assistant while you chat — that's Settings → MCP Servers. The two are independent and can run at the same time.

Starting the server

The MCP server is the mcp subcommand of the same CLI — install it once (on macOS, Help → Install ‘minerva’ Command in PATH…; on other platforms, build it from the source tree) and you have the minerva command. The server runs over standard input/output as a subprocess — you don't start it by hand so much as tell a client how to launch it. On its own:

minerva mcp --project /path/to/thoughtbase

It speaks newline-delimited JSON-RPC 2.0 and stays running until its input closes. Each modality initializes once and stays warm across tool calls.

Connecting a client

Most MCP clients take a small JSON entry naming a command to launch. Point it at minerva with the mcp subcommand and your thoughtbase path — the client runs it as a subprocess:

{
  "mcpServers": {
    "minerva": {
      "command": "minerva",
      "args": ["mcp", "--project", "/path/to/thoughtbase"]
    }
  }
}

Some clients — Claude Desktop among them — launch from a bare environment without your shell's PATH, so minerva may not resolve. If so, give the full path to the launcher instead. The install dialog shows it: ~/.local/bin/minerva, spelled out from your home folder, since a client won't expand ~ for you:

{
  "mcpServers": {
    "minerva": {
      "command": "/Users/you/.local/bin/minerva",
      "args": ["mcp", "--project", "/path/to/thoughtbase"]
    }
  }
}

Running from a source checkout instead? There's no launcher, so have the client run the built file with Node: "command": "node", with "/absolute/path/to/minerva/.vite/build/cli.js" as the first argument ahead of "mcp".

Tools

The server exposes eight tools — the reads return grounded JSON, and the one write is gated:

query_graph
SPARQL over the knowledge graph.
sql_query
DuckDB SQL over the tables Minerva registered (your CSV files and captioned markdown tables), by name. It can’t read files by path.
search_notes
Full-text search over notes.
grep_notes
Exact text search over every note's raw markdown, like grep — a literal string by default, or a regular expression with regex; case_sensitive and limit (default 50, at most 200) are optional. Returns the path and line of each match, so it suits a known phrase, a pattern such as unfinished - [ ] tasks, or checking whether something appears at all.
semantic_search
Meaning-based search over notes the app has embedded.
read_note
A note's raw markdown, by path. Paths inside .minerva/ and other hidden folders are refused.
gather_context
A topic slice — matching notes plus their link neighborhood — for the agent to seed itself.
propose_note
File a new note as a pending proposal (gated), with an optional one-line note summary that's shown in the review queue.
Why the agent's tools are fenced in

An outside agent reads your notes, and a note — especially one someone shared with you — can contain text written to steer whatever reads it. So the tools hold the line regardless of what the agent asks for: read_note won't open anything in .minerva/ (your conversations, settings and stored keys) or any other hidden folder; sql_query sees only the tables Minerva registered and can't read files by path — SHOW TABLES lists them and DESCRIBE <table> shows a table's columns; and propose_note can't target those folders or anything outside the thoughtbase. The same reads typed in your own shell — minerva read, minerva sql — aren't restricted this way, because you wrote them.

Grounded and gated

Reads come back grounded, so the agent can cite the exact notes it drew on. The only write is propose_note, which files a pending proposal stamped mcp:<client-name> — taken from the client's own name at connect time — and nothing lands until you approve it in the Proposals panel. In Minerva, proposals from an MCP client are labelled distinctly from the built-in AI, so the graph stays an audit log of who contributed what. See Conversations.

A note on freshness

The server notices on its own whether Minerva has the same thoughtbase open (the app leaves a .minerva/runtime.json marker while it does), and acts differently:

App open
propose_note and semantic_search are handed to the running app. A proposal goes through the app's own approval gate and appears in the Proposals panel right away; semantic search uses the app's current index.
App closed
Both run directly against the thoughtbase's files. A proposal is waiting in the Proposals panel the next time you open it.

Either way, read_note and grep_notes read the files as they are now. The knowledge graph, full-text index and tables behind query_graph, search_notes, sql_query and gather_context are loaded the first time a tool needs them and kept for the rest of the session, so restart the server to pick up notes edited since.