TroveMCP
Provides corpus-wide question answering, briefings, and dossiers over a Notion workspace by querying a locally synced SQLite mirror; the sync keeps the mirror in step with Notion and can optionally write completion dates back to Notion pages.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
TroveMCP
An MCP server that answers questions over a local SQLite database that a sync keeps in step with a Notion workspace, instead of calling the Notion API for every question. It is read-only unless given a write profile.
The server makes no network calls and needs no key. The sync (trove-sync) is
the only part that talks to Notion, and the only part that writes the database.
Why
The official Notion MCP returns at most 25 items per request. That is fine for "find me this page" and useless for anything that needs the whole picture — a morning briefing, a digest, "which imprints sign authors but have nothing in the works". Those questions are about all of the corpus at once, and a paged API answers them with a slice while looking like it answered them completely.
TroveMCP reads the synced database, computes the answer over the entire corpus, and returns the answer rather than the pages. A few thousand pages are a couple of megabytes; the arithmetic is instant, and it works while the API is unreachable.
> which imprints sign authors but have nothing in the works?
Lantern Books 6 authors, 0 manuscripts in the works
Quayside Press 6 authors, 0 manuscripts in the works
(computed over 40 authors and 103 live manuscripts of 320, synced 4 minutes ago)That is the demo below, asked in its own words.
Related MCP server: querywise-mcp
Requirements
Python 3.11 or newer
for your own data: a Notion workspace where you may add an integration
Install
Either clone the repository:
git clone https://github.com/breakneck-git/trovemcp.git
cd trovemcp
uv syncor let a client start it straight from git, with nothing installed by hand:
uvx --from git+https://github.com/breakneck-git/trovemcp troveThree commands come with it:
command | does |
| the MCP server over stdio; opens the database read-only, makes no network calls |
| the sync: reads Notion into the database, runs until SIGTERM or SIGINT |
| checks an export folder against |
Try it without any data of your own
The repository can generate a synthetic sync database — a small publishing house that does not exist — written through the sync's own functions, so it has the shape a real one has. From the clone:
uv run python examples/make_demo_db.py # writes examples/demo.dbAdd it to Claude Code (run in the clone, so $PWD is its root):
claude mcp add trove-demo \
-e TROVE_CONFIG="$PWD/examples/demo.toml" \
-e TROVE_HOST=demo \
-e TROVE_DB="$PWD/examples/demo.db" \
-- uv run --directory "$PWD" troveor, in any client that takes a JSON config (Claude Desktop's
claude_desktop_config.json, a project's .mcp.json):
{
"mcpServers": {
"trove-demo": {
"command": "uv",
"args": ["run", "--directory", "/path/to/trovemcp", "trove"],
"env": {
"TROVE_CONFIG": "/path/to/trovemcp/examples/demo.toml",
"TROVE_HOST": "demo",
"TROVE_DB": "/path/to/trovemcp/examples/demo.db"
}
}
}
}TROVE_DB is there because db_path in demo.toml is relative and the client
decides where the server starts. The database is stamped when it is generated:
left for a few hours it is stale, and the answers will say so.
Pointing it at your own workspace
Make an integration. In Notion, Settings → Connections → Develop or manage integrations → New integration, internal. To only read, it needs Read content. Copy its secret.
Share your databases with it. On each database (or a page above them): ⋯ → Connections → your integration. The sync reads every data source the integration can see.
Write
trove.toml. The smallest one that works:[hosts.laptop] role = "primary" # this machine writes the database from Notion db_path = "/absolute/path/to/trove.db" incremental_interval_s = 30 # seconds between incremental passes integration = "my-integration" # a label for your integration, kept in the databasetrove.example.tomlshows every key with comments; copy it totrove.toml(git ignores that name) and replace its example[[sources]],[dossier]and[briefing]entries with your own, or delete them.Run the sync, with the secret in the environment (the variable is
TROVE_NOTION_TOKENunless the host'stoken_envnames another):export TROVE_NOTION_TOKEN=your_token_here TROVE_CONFIG=/path/to/trove.toml TROVE_HOST=laptop uv run trove-syncIt keeps running and keeps the database in step; run it under your service manager (launchd, systemd) to keep it going.
Add the server as in the demo, with your
TROVE_CONFIGandTROVE_HOSTand withoutTROVE_DB. The server needs no token.
The config
One TOML file describes the workspace, and that file is the only thing that changes between workspaces. It holds:
[hosts.<name>]— a machine that holds a copy of the database: itsrole(primarywrites it from Notion,replicafollows), itsdb_path,integration(a label) andtoken_env, the name of the environment variable that holds the integration token. The token itself is never written in the file.nothing about which databases to read: the sync reads every data source shared with its integration. Each one found is a collection named after its title (
Task list→task_list), kept under that name if the database is renamed later.[sync] exclude = ["<data source id>", …]leaves some out. Pages outside databases (under another page, or in the workspace) are the collectionpages, with the title alone: each tick reads the ones edited since the last, and once a day a sweep notices the ones that went. They are read only; a[[sources]]entry namedpagestakesexportalone.[[sources]]— optional overrides of the data sources they name:data_source_id, the collection'sname(a-z,0-9and_only: it names a file of the export), and the roles of their fields, addressed by property id so that a rename in Notion changes nothing here. The export folder (export_dir) gets a file for every collection synced,pagestoo, and that includes the ones found later: a database shared with the integration tomorrow is in the folder after the next full pass, whoever reads the folder.export = falseon an override keeps that one out. Beside the files it keepstrove-export.manifest, the names it published last: a file it published before and no longer does is removed, anything else in the folder is left alone, and a<collection>.jsonit did not write is never written over: that collection stays out of the set, andexport.last_errornames the file. A folder with no manifest yet (an earlier version wrote it) is taken as the export's where a<collection>.jsonis a plain file that begins{"export_generated_at": ", as every export file does; only that head is read. The manifest begins with the line# trove export manifest v1: a file of that name without it, or a file at one of the export's hidden.<name>.tmpnames that is not the export's, is left as it is, and nothing is published until it is moved away (export.last_errornames it).[sources.writeback]— optional, off without it, and the one write that goes past the profiles of[write]: switch it on only if you want it.completed_field, the property id of a date. After each whole full pass theprimaryhost fills it on every page itsstatus_fieldcloses (closed_status) and whose date is empty, with the page's last edit time. It is the one write the sync makes itself, so its integration needs Update content in Notion. Every page is read first and written only if it is still closed and still without the date; at most[sync] writeback_max_per_passpages (50) a pass, the rest the next. Each pass leaves async_runsrow of kindwriteback.[export.contract]— optional: what the programs reading the export folder take from it. By collection, the keys of the file (wrapper) and of each of itsitems(item), each with the types its value may have (str,bool,number,list,dict,null). A set that breaks it is not published, andtrove-export-check --config trove.toml <export folder>checks a folder against it. With none, every set is published.[export.contract.manuscripts.item] id = ["str"] Stage = ["str", "null"][sync] timezone— the fixed offset (±HH:MM, default"+00:00", UTC) in whichtodayand the day words, date buckets (day,hour,weekday, …) and the window of acoverage = "window"source are counted. A zone name such asEurope/Athensis refused: there is no summer time, so set the offset you want the days cut at.[briefing]and[dossier]— what the standing briefing is made of and how long a dossier's lists get.project_dossierneeds[dossier] projects_collection, the collection that holds projects; there is no default, and without it the tool refuses and names the key.
[[sources]]
name = "manuscripts"
data_source_id = "<the data source's id>"
archived_fields = [] # [] says "this source has no archive"
status_field = "<property id>"
closed_status = ["Printed", "Withdrawn"]
[sources.relations]
"<property id>" = "authors" # a relation into another source
[sources.date_fields]
"<property id>" = "start" # the date lives inside an objectexamples/demo.toml is the same shape over the demo.
The config is found via TROVE_CONFIG, then ./trove.toml, then
~/.config/trove/trove.toml. TROVE_HOST picks the host; TROVE_DB replaces
its db_path.
Heartbeat
trove-sync can tell a monitor that it is alive. Set TROVE_HEARTBEAT_URL in
the sync's environment (not in trove.toml: the URL carries the monitor's
token, and is never logged). After a tick the sync sends one GET (5 s
timeout): the first after a start and a change between up and down at once,
the same state again at most once per [sync] heartbeat_interval_s (60 s by
default; set it to the monitor's own interval or less). ?status=up when no
collection failed and the last export passed the
contract gate (export.last_error empty), else ?status=down&msg=<the error, up to 200 characters>. This is the push format of Uptime Kuma, for example
https://kuma.example/api/push/your_token_here; any monitor that takes it
works. A status, msg or ping in the URL (the monitor's UI hands them out) is not needed: the
sync sets its own. The whole GET has 5 s, not each wait. Unset or empty: nothing
is sent. A heartbeat that fails (an error, a 4xx / 5xx,
no answer in 5 s) is a warning in the log, without the URL, and goes again on
the next tick; it changes nothing else.
Tools
Which tools a client sees depends on the config: by default only the read tools; the rest appear only when you allow them.
tool | answers | offered |
| what collections exist, their fields and types, what is truncated, what could not be read; per collection the Notion | always |
| items from one collection, filtered, sorted, sliced | always |
| the whole collection grouped and measured — counts, sums, extremes | always |
| the standing sections your config declares | always |
| everything pointing at one project | always |
| how far behind the database is and what the last sync passes did | always |
| the journal of writes made through Trove, refusals and dry runs included | always |
| the body of one page as markdown, read live from Notion | with |
| the unresolved comments on one page, read live | with |
| changes properties or the icon of a page | profile: |
| creates a page in a collection, with properties and a body | profile: |
| adds to or replaces a page's body from markdown | profile: |
| comments on a page or answers a thread | profile: |
| moves a page to Notion's trash and back | profile: |
| undoes one write from the journal | any profile |
| changes a collection's properties; the second may lose values | profile: |
| a database's title, description, icon and cover; a new one; to the trash and back | profile: |
| the views of a collection | profile: |
Every answer carries an envelope: when the sync last succeeded, how old that makes the data, and a warning once it has fallen behind.
Writing, by profile
By default Trove only reads: a server started without TROVE_PROFILE offers
no write tool at all, and the sync writes nothing to Notion unless a source has
a [sources.writeback] table (see the config above), which you add yourself
and which no profile governs. Writing by profile takes three things you add
yourself:
# trove.toml
[write]
socket = "/path/to/write.sock" # the sync daemon takes writes here; at most 103 bytes
profiles = "/path/to/profiles.toml"# profiles.toml
[profiles.example-editor]
write = ["example_db"] # collections whose pages it may change
delete = ["example_db"] # ... and move to the trash and backand TROVE_PROFILE=example-editor (with TROVE_CALLER to name who asks) in
the env of the trove server. The integration then needs the Notion
capabilities its writes use: Update content, Insert content, and for
comments Read comments and Insert comments. The server holds no token: it passes a write
to trove-sync, which checks the profile, the page's version and the value
against the schema, writes to Notion, puts the fresh page into the database at
once and journals the call. An edit of the profile file takes effect without a
restart, and the server tells the client its tools changed. A refusal starts
with its code: forbidden, version_conflict, invalid_value,
unknown_option, sync_down, config_invalid, …; outcome_unknown says
Notion's answer was lost and the write may have landed.
Who may write is who may open the socket. The daemon makes the socket
0660: its owner and group can connect, and so can anyone the socket's
directory lets through to it. The profile is named by the client
(TROVE_PROFILE in the server's environment) and the daemon does not check
who is on the other end of the connection: any process that can connect may
name any profile in the profiles file. So the security boundary is the
permissions of the socket and of its directory — give the group, and the
directory, only to the accounts that may write with every profile there.
Every write tool takes dry_run: it checks everything and returns the request
it would send, without sending it. The check is the daemon's, so a dry run needs
trove-sync running too; without it the answer is sync_down. The socket path
must fit a unix socket — at most 103 bytes — or the config is refused.
Nothing deletes a page for good: trash_page moves it to Notion's trash,
which keeps it 30 days. revert takes a write_id from writes and does the
reverse — the values before an update, formatting included, if the page has
not changed since; a restore for a trash, a trash for a restore.
Four things it refuses to fake
A truncated relation is not a count. Notion caps a relation property in a
page response, and an author with 90 manuscripts can arrive with 25 of them.
The sync reads such a property whole; what it could not read whole is marked,
and TroveMCP flags those fields in every answer that reads them, not only in
describe. Dossiers are built from the reverse direction — the items that point
back, which carry their pointer whole.
A window is not a corpus. Where a collection holds only a rolling window, answers say so and carry the window boundary instead of passing a week off as a lifetime.
A missing collection is not an empty one. If the sync has not registered a
collection, or its schema cannot be read, the honest answer is "this source is
unavailable", not 0. The second one is worse than an error, because every
other number in the response stays correct.
A stale database is not fresh data. A sync can lag or fail. Every answer states by how much and warns past a threshold you set. It never refuses to answer: working while the API is down is half the point.
What it does not do
No page bodies in the database. It holds page properties, not block content. With a
[write]table,read_bodyreads a body live from Notion through the sync daemon; without one, results include each page'sidandurl, so a Notion client can fetch the body when you actually need it.No write without a profile, or a writeback you switched on. The server opens the database read-only and never writes Notion itself; only
trove-syncwrites: by the profile file, and the completion dates of[sources.writeback]where you configured one.No network from the server. If
troveever needs a token, something has gone wrong with it.
Development
uv sync # project + pytest, into .venv
uv run python tools/full_test_run.py # the full run, behind a local lock: one at a timeThe wrapper runs uv run pytest -q and exits with pytest's exit code. If another
full run holds the lock it prints who holds it and waits;
extra arguments go straight to pytest. For a quick run of a single file while
working, uv run pytest tests/test_query.py is fine.
Tests build their own synthetic databases (tests/db_fixtures.py) and never
touch a real workspace.
Licence
MIT.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask plain-English questions of your database: answers, the query that ran, and the rows.
Document QA with citations, SQL-computed tables, deep research and a corpus radar.
151Query and audit AppSheet apps in natural language via Knotrik's pre-scanned definitions.
Query, explore, and manage your databases through natural conversation.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides access to your Amplenote SQLite database cache, enabling search and retrieval of notes and tasks, including full-text search, bidirectional references, task filtering by priority and due dates, and recently modified content tracking.-
- AlicenseAqualityDmaintenanceQuery SQL databases (SQLite, PostgreSQL, BigQuery, Databricks) in natural language through a business semantic layer — glossary, metrics, and a data dictionary grounded against your real schema. Read-only by default, with an embedded SQLite + sqlite-vec metadata store and no external infra required.253MIT
- AlicenseAqualityDmaintenanceReads the local SQLite cache of the Notion desktop app to enable fast, offline search and retrieval of Notion pages from Claude.5MIT
- FlicenseNot gradedqualityDmaintenanceEnables natural-language querying of SQLite databases through a governed semantic layer, with citations and typed abstention for PII or uncertified data.-