budgetdex
Connector indexes shared Notion pages and databases through the Notion API using read-only requests, enabling search over Notion content and SQL access to indexed Notion database tables. Notion export zip files can also be added without network access.
Connector supports Supabase through its Postgres/Session pooler connection, reading schema and planner statistics only and allowing read-only SQL queries over selected tables with timeouts and row caps.
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.
budgetdex
A local index over your own documents and tables, for AI agents. The agent says how many tokens it can spend; budgetdex returns the most useful hits packed into that budget (top hits in full, the rest as snippets or title lines). No LLM is called to build or query the index, no account is needed, and nothing leaves your machine unless you add a connector or download the optional model.
Status: alpha (0.0.2). Tested on macOS (Apple silicon) and, in CI, on Linux (Python 3.11–3.13); Windows is not tested. Search headers and CLI messages are currently in Japanese (the tool works on English and Japanese text alike). 日本語の説明は README_JA.md。
Install
uv tool install "budgetdex[vec]" # or: pipx install "budgetdex[vec]"Extras: vec (vector search: numpy, onnxruntime, tokenizers; no PyTorch), xlsx (openpyxl), pdf (pypdf), docx (python-docx), postgres (psycopg). Combine them as budgetdex[vec,xlsx,pdf,docx]. The core depends only on mcp. Without an extra, the affected files are listed by budgetdex status with an install hint, and search uses BM25 alone. Python 3.11+.
Related MCP server: semantic-code-intelligence
60-second quickstart
budgetdex add ~/notes # index a folder (md, txt, csv, tsv; xlsx/pdf/docx with extras)
budgetdex search "refund deadline" -b 500 # results packed into 500 tokens
budgetdex get <id> -b 800 # full text of one hit
budgetdex sql "select count(*) from my_table" # read-only SQL over indexed CSV/xlsx tables
budgetdex status # what is indexed, what was skipped and whyLater runs of budgetdex sync re-read changed files only. The index lives in ~/.budgetdex/default.db (set BUDGETDEX_HOME to move it).
Vectors are optional (better for paraphrases and English/Japanese mixes):
budgetdex embed --download # one-time ~135 MB model download, then embeds all chunksAfter later CLI syncs, run budgetdex embed again for new chunks; the MCP server does this by itself in the background.
Connect an agent (MCP over stdio)
Claude Code:
claude mcp add budgetdex -- budgetdex mcpAny other MCP client (JSON config):
{
"mcpServers": {
"budgetdex": { "command": "budgetdex", "args": ["mcp"] }
}
}The server re-syncs all sources in the background when it starts. A Claude Code plugin (server definition plus a usage skill) is in plugin/.
Tool | What it does |
| Ranked hits within |
| Full text of one hit within |
| Read-only SQL over the tables that search shows as |
The same is available from Python: budgetdex.open().search("...", budget=800).
Profiles and resources
Chosen per index with budgetdex profile NAME.
Profile | What it does | Memory (one CLI process) | Search p50 | Extra disk |
| BM25 only, no model | ~19–23 MB | ~35–45 ms | — |
| BM25 + vectors (multilingual-e5-small) | ~205 MB (peaks ~390–470 MB while loading / embedding) | ~50–70 ms | model ~143 MB |
| + cross-encoder re-ranking | ~466 MB | ~0.3 s | + ~144 MB |
Without the model, standard behaves like light-style BM25 search. As an MCP server, idle memory is ~51–54 MB (no model is loaded until a search needs it); after 100 searches ~61 MB (light) and ~240–260 MB (standard). The index file is about 3x the size of the indexed text.
Measured on one machine (Apple M2 Pro, a 1.5 MB / 1,525-chunk folder, macOS phys_footprint). Your numbers will differ.
Connectors (opt-in)
Nothing is contacted unless you add it explicitly. Secrets come from an environment variable (--env VAR, default BUDGETDEX_POSTGRES_URL / NOTION_TOKEN) or, on macOS only, the keychain (--keychain SERVICE; on Linux/Windows add --keychain stops with an error, use --env). Secrets are read when needed and never stored in the index, printed or returned to the agent.
Postgres / Supabase — budgetdex add postgres [--schema NAME] (extra postgres).
At sync, only the schema and planner statistics are read (table and column names, types, comments, approximate counts). No rows are copied into the index.
sqlqueries go to the database in aREAD ONLYtransaction with a statement timeout, a server-side cursor, a row cap and one 5 s deadline. A textual pre-check refuses writes first.Limits: these checks are a second line of defence. Use a database role that can only
SELECT— a function with side effects can still run inside a read-only transaction. Joins between local tables and Postgres tables are refused. Tables with row-level security and no policy for your role return 0 rows (the card showsRLS有効andbudgetdex statusprints a policy example).Supabase: use the Session pooler connection string with a dedicated read-only role. Step-by-step guide (Japanese) in README_JA.md, section “Supabase:手順”.
Notion API — budgetdex add notion.
Create an internal integration with only the "Read content" capability and share the pages you want indexed with it. The connector issues only
GETrequests andPOST /searchtoapi.notion.com.Limits: nested blocks up to 8 levels and at most 150 block requests per page; pages cut by a limit or with unreadable blocks are indexed partially and listed in
budgetdex status. System properties (created by, etc.) are not indexed; people properties only by the display name the API already returns.
Notion "Markdown & CSV" export zips can also be added as files (budgetdex add export.zip), without any network access.
Privacy and security
What leaves the machine: nothing, except (1) the connectors you add (your Postgres host,
api.notion.com), and (2) the explicitbudgetdex embed --download. No telemetry.The model download fetches exactly two files per model from
https://huggingface.co/<repo>/resolve/<pinned revision>/<file>, following Hugging Face's redirect to its file CDN (User-Agentbudgetdex):Xenova/multilingual-e5-small@761b726d…:onnx/model_quantized.onnx(118,308,185 bytes) andtokenizer.json(17,082,730 bytes) — ~135 MB.With
--reranker:cross-encoder/mmarco-mMiniLMv2-L12-H384-v1@1427fd65…:onnx/model_qint8_arm64.onnx(118,620,017 bytes, plain int8 ops, runs on any CPU) andtokenizer.json(17,082,660 bytes) — ~136 MB.The announced size is checked before reading; size and sha256 are checked before a file is put in place and again when the model is loaded. An interrupted download leaves no partial file. Files go to
$BUDGETDEX_HOME/models/.
The index is a plaintext copy of what you indexed (
default.db, mode 0600, not encrypted). Deleting a source file removes it at the next sync.Ignored by default:
.env*, key files (*.pem,id_rsa*, ...), names that look like passwords / tokens / API keys,.git,.ssh,.aws,.gnupg,.config,node_modules,.venv, ... and.gitignored paths.--allow GLOBoverrides only.gitignore. Obvious secrets (PEM keys, known key prefixes,password=...) are masked in output.Table rows are not in the search index. Table cards show column names, types and counts, but no cell values unless you opt in per source (
--table-values). Rows are reachable throughsql. One exception: when a question word (3+ characters) appears in no document but as a whole word in a text cell of a local table, the search header names the table, column and row count (never the value); personal- and secret-looking columns are never read for this.Local
sqlruns on a separate read-only SQLite connection with an authorizer (SELECT on user tables only; no writes, ATTACH, PRAGMA or extensions), a 5 s timeout and a row cap.Prompt injection cannot be fully prevented. Results are returned as data with their source, but a document can still contain instructions an agent may follow. Index only what you would let the agent read.
See SECURITY.md to report a problem.
Models and licences
No model is bundled; the optional ones are downloaded by you and keep their own licences:
intfloat/multilingual-e5-small(ONNX buildXenova/multilingual-e5-small): MIT.cross-encoder/mmarco-mMiniLMv2-L12-H384-v1: Apache-2.0 per its model card; it was trained on mMARCO, a translation of MS MARCO, whose terms restrict use to non-commercial research. Check whether that matters for your use before enablingmax.
src/budgetdex/spm.py re-implements the SentencePiece-Unigram segmentation of Hugging Face tokenizers (Apache-2.0) to save memory; see NOTICE.
Evaluation (honest version)
Measured at retrieval level: a question counts as answered when the answer string appears in the returned text. This is not an end-to-end agent measurement. Token counts are this package's own estimate, not calibrated against a real tokenizer.
Synthetic lab (generated fictional Notion pages, Postgres tables and files; two unseen seeds, ~90 search questions each): profile
standardat budget 1,000 answered 92% and 96% using ~885 tokens on average; returning the top 10 hits in full answered 93% and 96% using ~2,100–2,200 tokens. The data is synthetic and written by the same project, so real documents may behave differently.Private set (60 questions over a real personal folder, not used for tuning, scored once): plain hybrid top-10 RAG 0.73 at 3,802 tokens;
standard0.68–0.75 at budgets 1,000–1,900 (~880–1,690 tokens). Roughly the same answer rate at a quarter to a half of the tokens; the difference is within noise. An earlier independent 50-question set did not reach parity (0.52 vs 0.62).Weak spots: questions in another language than the document (e.g. English question, Japanese column names), paraphrases that share no words with the text, and detecting that the answer is not in the index at all.
Limitations
Alpha: the index format and output may change between 0.0.x versions.
Output headers and messages are in Japanese.
Cross-language and paraphrase questions are clearly weaker than same-language keyword questions (see above).
Local table columns (CSV, TSV, xlsx, Notion databases) are stored as INTEGER or REAL in
sqlonly when every non-empty cell is a clean number (no leading zeros, at most 15 digits, thousands separators like1,234allowed, decimals that a double keeps exactly); empty cells of those columns are NULL. Everything else stays text: codes with leading zeros (007, postal codes), longer digit strings, full-width digits, currency / units / percentages (¥1,200,30%),(5), dates and mixed columns. The table card says 整数 / 数値 for numeric columns and 数字の文字列 for numeric-looking text, which compares as text (cast it yourself if you need numbers). Indexes from before this change are converted once when opened writable (budgetdex statusshows tables still waiting).Token counts are estimates; leave some margin in a hard context limit.
One index per
BUDGETDEX_HOME; no multi-user or server mode.macOS keychain support only on macOS; Windows is untested.
Uninstall
claude mcp remove budgetdex # if you registered it with Claude Code
uv tool uninstall budgetdex # or: pipx uninstall budgetdex
rm -rf ~/.budgetdex # the index and downloaded models ($BUDGETDEX_HOME if you set it)Keychain items you created for connectors are not touched; delete them with security delete-generic-password -s SERVICE.
Development
uv sync --all-extras && uv run pytest -q
uv run budgetdex bench eval/sample/questions.jsonl --corpus eval/sample/corpusSee CONTRIBUTING.md and CHANGELOG.md. Licensed under the Apache License 2.0.
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
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Agent-native search engine with live web research optimized for AI agents.
SEC filings, Wikipedia, arXiv, US Census and more for AI agents, with every answer source-linked.
Search your knowledge bases from any AI assistant using hybrid RAG.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform semantic, hybrid, and filtered search on indexed local documentation with RAG capabilities.2MIT
- FlicenseBqualityCmaintenanceEnables coding agents to search locally indexed repositories with hybrid semantic and lexical retrieval, returning exact source citations with file paths and line ranges.4-
- FlicenseAqualityDmaintenanceProvides AI agents with multi-format document indexing, hybrid dense and sparse search with reranking, and relational SQL querying over extracted tables.12-
- AlicenseAqualityBmaintenanceEnables AI agents to search a locally built, topic-specific index over MCP using hybrid keyword and semantic retrieval with trust, version, recency, and evidence-aware ranking. It also lets agents outline coverage, fetch full documents or threads, and inspect index metadata.4MIT