Your editor, readable by your AI
From v0.1.118, Notepatra ships notepatra-mcp — a Model Context Protocol server that lets Claude Desktop, Claude Code, OpenAI Codex, the OpenAI Agents SDK, and any spec-compliant MCP client see what you have open, search your workspace, run read-only SQL (over data files in the Full edition), read your Git status and Noter notes, and — only with your explicit per-action approval — edit, save, and create notes. The server talks to your client over stdio and to the editor over a local socket, and opens no network connections of its own. Tools that use a saved database connection talk to that database, and the REST and git network tools run only after you approve them; see Is my data sent anywhere?
notepatra-mcp-windows-x64.zip) plus a one-click notepatra-mcp.mcpb Claude Desktop bundle as release assets. Everything on this page describes v0.1.135.
v0.1.125, v0.1.126 and v0.1.127 were all MCP-only releases, driven by testing this server against a real editor rather than by new features. v0.1.125 fixed a credential leak in
search_project, a goto_line that reported success from the wrong line, and a sidecar that hung on every mistyped argument. A retest then found that the credential fix covered only one of four read paths — see what changed in v0.1.127 below.
What it is
MCP (the Model Context Protocol) is the open standard AI assistants use to talk to tools. Notepatra's implementation is a small standalone binary, notepatra-mcp, that sits between your AI client and the running editor:
AI client (Claude Desktop, Claude Code, Codex, ...)
│ stdio · JSON-RPC 2.0 (MCP)
▼
notepatra-mcp ──local socket──▶ Notepatra (the running editor)
- Transport: a stdio JSON-RPC 2.0 MCP server. It speaks MCP protocol revision
2025-06-18and also accepts2025-03-26and2024-11-05from older clients. - Editor connection: pass
--socketand the server talks to the running editor over a dedicated per-user local socket (a Unix domain socket on Linux and macOS, a named pipe on Windows; the editor opens it on launch). Without--socket, the server runs against a built-in mock editor, so you can exercise the protocol without Notepatra running. - Capabilities: tools (119 of them), resources (your open tabs and Noter notes), and prompts (three ready-made ones).
- Safety: read and act tools need no permission; every write shows an approval card inside the editor window and does nothing until you click Approve. Details below. The read tools
run_query,list_tablesanddescribe_table, and the act tooltest_connection, connect to a database you saved, with its stored credentials, without a card.
In practice: ask your assistant "what do I have open?", "find where the config is parsed", "diff these two tabs", "format this JSON and put it in a new tab" — and it drives the actual editor on your screen.
The tool surface — 119 tools, three tiers
notepatra-mcp exposes 119 tools, grouped in three tiers by what they can touch. Read tools observe; the ones that use a saved database connection query that database. Act tools drive visible, non-destructive editor actions (view and theme changes are saved as preferences, as the View menu does). Write tools change documents, files, settings, your repository, a database or a remote server — and every one of those is gated behind a human approval card.
Tier 1 — Read (46 tools, no approval needed)
| Tool | What it does |
|---|---|
list_open_tabs | List the open tabs with id, index, title, file path, and modified state. The id is stable; the index is not. |
read_tab | Read the text of one open tab, selected by tab_id, tab_index, or title. Takes max_bytes and reports truncated + total_chars, so a large buffer can be paged instead of swallowing your whole context. |
get_selection | Get the currently selected text, with the tab it belongs to. |
get_status | Editor state: active tab, file path, language, encoding, cursor position. |
app_info | Application info: name, version, edition (Lite/Full), platform. |
list_recent_files | List recently opened file paths. |
find_in_tab | Find text inside one open tab (default: the active tab), selected by tab_id, tab_index, or title — a literal substring, or a regular expression with {regex: true}. |
search_project | Search all open tabs plus files under the workspace folder, case-insensitive (capped at 200 matches) — a literal substring, or a regular expression with {regex: true}. Reports workspace_searched and scope, so a tabs-only search can never pass for a project-wide one. |
list_notes | List Noter notes with title, file name, and last-modified time; include_trash: true adds the notes in the Noter Trash. |
read_note | Read one Noter note by its file path. |
list_reminders | List your Noter reminders with id, note title, due time, and bucket (Overdue / Today / This week / Later). |
git_status | Read-only git status for the workspace repository. |
git_diff | Read-only git diff, optionally scoped to one path; staged: true shows what is staged for the next commit. |
git_log | Read-only git log (recent commits; default 20, capped at 100). |
git_show | Read-only git show for a commit or ref. |
git_branch | Read-only list of branches in the workspace repository. |
validate_npd | Validate a Notepatra diagram (.npd) — a tab or supplied source; returns parse errors with line numbers, and the column of an unclosed bracket or quote. |
run_sql | Run a read-only SELECT and return columns + rows — over a file in your open workspace folder (csv_path, as table data: CSV / Parquet / JSON in Full, CSV in Lite), or, with no csv_path, an empty in-memory SQLite scratch database. SELECT-only and sandboxed — see the note below. |
list_languages | List the canonical language names set_language accepts (as shown in the Language menu). |
get_capabilities | Editor capability profile: edition, platform, version, tool count and tiers, and feature flags (DuckDB, WebEngine, Noter, charts — with the reason when charts are unavailable, since macOS Full has none). |
get_diagram_source | Read the .npd source of an open Diagram tab, by tab_id or tab_index. |
list_connections | List your saved database connections (name, driver, database) — never passwords. |
run_query | Run a read-only SELECT against a saved named connection (PostgreSQL / MySQL / SQL Server / SQLite / DuckDB) — what run_sql cannot reach; mutations rejected. Full edition (DuckDB) for DuckDB-driver connections. |
list_tables | List the user tables available over a saved named connection. |
format_json | Format JSON text and return the result (fails on invalid JSON). Takes indent and minify; format_sql takes indent and keyword_case; format_html takes indent and minify. |
format_sql | Format SQL text and return the result. |
format_html | Format (or minify) HTML text and return the result. It never changes what the document means: when the formatter cannot prove that, the call fails with the reason and its line:column. |
check_brackets | Check () [] {} balance and begin/end keyword pairs in text or a tab, as Bracket Tools > Check does. |
fix_brackets | Auto-fix unbalanced brackets and return {fixed, changed, report} — the tab itself is not changed. |
hash_text | MD5 / SHA-1 / SHA-256 / SHA-512 of text or a tab (Utilities > Hash). |
encode_text | Base64 or URL encode/decode text or a tab (Utilities > Base64 / URL). |
diff_text | Line diff of two texts or tabs with the Compare view's engine; returns hunks with 1-based line numbers. |
repair_json | Explicit, opt-in JSON repair (JSON Tools > Fix): {fixed, repaired, report}. Repairs only unambiguous faults; anything ambiguous, such as a truncated document, is declined with a positioned report and repaired:false. format_json still refuses invalid JSON. |
markdown_convert | Tools > Markdown Converter as data: table, list, code block, bold, italic, link, heading, HTML to Markdown. |
mermaid_to_npd | Translate Mermaid diagram text to Notepatra Diagram (.npd) source with the Diagram tab's importer. Flowcharts only: other Mermaid types return an error naming the type. |
list_symbols | Classes and functions in a tab, from the Function List parser: {name, kind, line}. |
list_hunks | The changed hunks of one file versus HEAD (the change gutter), numbered for git_hunk. Credential files refused. |
list_conflicts | Conflicted files, or one file's <<<<<<< regions with both sides, numbered for resolve_conflict. |
search_notes | Search the text of every Noter note the way the Noter sidebar does (every term must appear); returns file, title and a snippet. |
get_preferences | The editor and view preferences MCP may change, with each key's type and range. AI, cloud, network, plugin, update and history settings are never included. |
describe_table | Columns and types of one table on a saved connection, with the primary key where the catalog reports it (SQLite). |
parse_http_file | The requests in .http text or a tab: name, method, URL with {{variables}} unexpanded, line numbers, header names. |
curl_to_request | A curl command as method, URL, headers and body (the REST client's importer). Nothing is sent. |
request_to_curl | A request as a curl command line (Copy as cURL). Nothing is sent. |
hex_dump | Up to 64 KB of bytes from a tab's file or a file in the workspace folder, 16 bytes per line; credential files and paths outside the workspace refused. |
generate_password | Passwords or passphrases from the Password Generator engine. The result goes to your MCP client and its model provider. |
run_sql stays safe. Every query is checked by the SQL classifier and rejected unless it is a pure SELECT — no INSERT, UPDATE, ATTACH, COPY, or DDL ever runs. On the Full (DuckDB) edition there is a second wall: the target CSV / Parquet / JSON is first materialized into an in-memory table, then DuckDB's external filesystem access is turned off (SET enable_external_access=false) before the untrusted SQL executes — so the query cannot reach host files even through read_text, read_csv_auto, glob, or a replacement scan. The csv_path argument is confined to your open workspace. Results are row- and cell-capped so a single answer can't exfiltrate a whole file.Tier 2 — Act (22 tools, visible and non-destructive)
| Tool | What it does |
|---|---|
open_file | Open a file in a new tab, or focus the tab that already has it. |
new_tab | Create a new untitled tab, optionally pre-filled with text, a language and a title. |
goto_line | Move the cursor to a line in a tab — for pointing you at a location. |
select_range | Select a range of text in a tab by 1-based line/column (columns clamp to the line), so replace_selection has a selection to act on. |
set_language | Set a tab's syntax-highlighting language. Accepts friendly aliases (python, js, cpp, go) and resolves them to the canonical name. |
compare_tabs | Open Notepatra's side-by-side Compare view for two open tabs, each named by tab_id_a / tab_id_b (stable) or index_a / index_b. |
open_note | Open one Noter note in the editor by its file path. |
create_diagram | Create a new Diagram (.npd) tab — pre-filled with source or a flow / er / system starter template — and focus it; reports parse validity. |
open_noter | Open or focus the Noter panel tab. |
open_data_analyst | Reveal and focus the AI dock in Data Analyst mode. |
render_chart | Render a chart inline in the Data Analyst transcript (Vega-Lite or the simplified {type,x,y,data} form). Full edition on Linux and Windows only (needs WebEngine; macOS Full has none). |
activate_tab | Bring a tab to the front, by tab_id or tab_index. |
set_read_only | Turn a tab's read-only lock on or off. |
bookmarks | List, toggle (at a 1-based line) or clear a tab's bookmarks. |
fold | Fold or unfold every region of a tab. |
set_view | Word wrap, zoom (font size 6-48), whitespace, end-of-line markers, indent guides — through the View menu's own actions. |
set_theme | Switch to System, Light, Dark or Monokai (Settings > Theme). |
set_preview | Show or hide the Preview pane for a tab. |
open_connections_dialog | Open Manage Connections (non-modal), where you type passwords; MCP never takes or returns one. |
open_schema_browser | Open the database schema browser (non-modal). |
compare_with_file | Compare a tab with a file on disk (Tools > Compare with File); the path must pass the credential deny-list. |
test_connection | Open a saved connection with its stored settings and credentials and report ok or the error (passwords and key=value secrets scrubbed); 20 s timeout. No card: it changes nothing, but it does connect to that database. |
Tier 3 — Write, with approval (51 tools, human-gated)
| Tool | What it does |
|---|---|
insert_text | Insert text into an open tab at the cursor, or at an explicit line/column. |
replace_selection | Replace the currently selected text with new text. |
apply_edit | Find-and-replace in one tab, or every open tab (scope: all_open, one card listing each tab and its count). Literal and case-sensitive by default — $1 stays $1; regex, match_case and whole_word use the Replace dialog's engine. If the document changes while the card waits, nothing is replaced. |
save_tab | Save an open tab to its file on disk, or Save As to a new path. |
create_note | Create a new Noter note with a title and body. |
append_note | Append text to an existing Noter note. |
set_reminder | Set a due-time reminder on a Noter note. |
export_diagram | Export a diagram tab (by tab_id or tab_index) to a file: PNG, JPEG and PDF always, WebP / SVG / HTML where the build supports them (get_capabilities lists diagram_export_formats). Written to a temporary name and replaced in one step. |
set_diagram_source | Replace the entire .npd source of a Diagram tab; the canvas re-renders. |
export_query_results | Run a read-only SELECT against a saved connection and write the results to a CSV or JSON file. |
export_chart | Render a chart off-screen and export it to a PNG / SVG / HTML / spec file. Full edition on Linux and Windows only (needs WebEngine; macOS Full has none). |
close_tab | Close a tab. No card when it has no unsaved changes; with unsaved changes it is refused unless discard_unsaved is set, and then the card says they will be lost. |
reload_tab | Reload a tab from disk. No card when nothing unsaved would be lost; otherwise the card says so. |
rename_file | Rename a tab's file inside its folder: no separators, never overwrites, protected names refused. |
save_all | Save every modified file-backed tab behind one card that lists them; untitled tabs are skipped and reported. |
undo | Undo the last edit(s) in a tab. |
redo | Redo undone edit(s) in a tab. |
transform_lines | One Line Operations / Blank Operations transform (sorts, dedupe, remove empty or blank, join, reverse, trim, tab/space) on the selection or document — one undo step. |
convert_case | UPPER / lower / Proper / Sentence / iNVERT case on the selection or document. |
comment_lines | Comment, uncomment or toggle a line range with the language's line or block comment syntax. |
line_edit | Duplicate, delete, or move up/down one line. |
set_eol | Set CRLF / LF / CR line endings, converting existing ones by default. |
set_encoding | Convert to an encoding (text kept), or reinterpret the file from disk (refused over unsaved changes unless discard_unsaved). |
git_stage / git_unstage | Stage or unstage files in the workspace repository. A path starting with -, outside the repository, inside .git or on the credential deny-list is refused before any card. |
git_commit | Commit what is already staged; the card lists the files and the message. Refused when nothing is staged (no commit -a); hooks run normally. |
git_branch_create / git_checkout | Create a local branch (optionally switching to it) or switch to one, never forced: git's own refusal to overwrite local changes is returned. Open files that change go through the usual reload prompt, which never drops unsaved edits. |
git_stash | Stash push (untracked files included), pop or apply. |
git_discard | Discard uncommitted changes to tracked files; the card warns of data loss. Untracked files are never deleted. |
git_fetch / git_pull / git_push | Network operations on the current branch and its configured upstream only: pull is --ff-only, push is never forced; git's error is returned; 60 s timeout. |
git_hunk | Stage one hunk, or revert it in the working copy (data loss, said on the card). |
resolve_conflict | Keep ours, theirs or both for one conflict region and save the file in its own encoding; refused while the file has unsaved edits. |
rename_note / trash_note / restore_note | The Noter sidebar's Rename, Move to Trash and Restore. An open note follows a rename and leaves the editor on trash, so autosave never writes the old path. |
delete_note_permanently | Delete a note that is already in the Noter Trash; the card says it cannot be undone. |
delete_reminder / snooze_reminder / dismiss_reminder | Manage a Noter reminder by the id list_reminders returns. |
export_note | Export a note to Markdown, or to PDF where the build has the renderer (Full edition); protected destinations refused. |
set_preference | Change one allow-listed preference (font, tab width, spaces, wrap, margins, theme, autosave interval and similar); saved and applied to every open editor at once. |
set_workspace_folder | Make a folder the workspace. Refused: the filesystem root, your home folder or anything containing it, ~/.ssh, ~/.gnupg, ~/.config and similar, and system folders. |
execute_sql | Run one data-changing statement on a saved connection. The card shows the connection, driver, host and the whole statement. Stacked statements and everything the SQL gate refuses outright (file and network reads, side-effecting functions, xp_cmdshell-style procedures, COPY, ATTACH, LOAD, SET, CREATE FUNCTION) are refused even with approval. |
add_connection / update_connection / delete_connection | Manage saved connections without any password, token or options string. Moving a connection to another server or user clears its stored password. |
rest_request | Send one HTTP request (http and https only) through the REST client, from arguments or a request in a .http tab with its variables resolved. The card shows the host, path, header names and body size; redirects are not followed; the body comes back capped at 256 KB. |
clear_recent_files | Clear File > Recent Files. |
What changed in v0.1.133
The goal of this release: an MCP client can drive the editor itself, not only read it. Seventy tools are new, and nine contract defects found by an audit are fixed.
- Editing, tabs, view and pure text. Thirty of the new tools: sort, dedupe, trim, join and reverse lines; case; comments; duplicate, delete and move lines; line endings and encoding; undo and redo; find and replace with regex, match case and whole word, in one tab or across all open tabs on one card; activate, close, reload and rename tabs, save all, read-only lock; theme, word wrap, zoom, folding, bookmarks, Preview pane, compare with a file; hash, Base64 and URL encoding, diff, bracket check and fix, explicit JSON repair, Markdown conversion, Mermaid import, symbol list, password generation.
- Git, Noter, settings, data and REST. The other forty: stage, commit, branch, stash, discard, fetch, pull and push in the workspace repository; per-hunk staging and conflict resolution; Noter search, rename, trash and reminders; an allow-listed set of preferences and the workspace folder;
describe_table,test_connection,execute_sqland connection management without passwords;.httpparsing, cURL conversion andrest_requestthrough the REST client;hex_dump; clearing recent files. Each write card says exactly what will happen, with a red warning line where data is lost. The AI assistant itself is not reachable over MCP. - Writes that leave the editor need the highest remote scope. Over the opt-in remote gateway,
execute_sql,rest_request,git_fetch,git_pullandgit_pushrequire the newwrite_externalscope, which is never a default: bothserve --max-scope write_externalandpair --scope write_externalmust ask for it. Over stdio they are ordinary writes behind the same approval card. run_sqlover a CSV works in Lite. Acsv_pathinside the workspace folder is loaded into an in-memory SQLite copy (tabledata) with the same read-only gate; Full keeps using DuckDB.- A held write follows the document, not a position. A write waiting on the approval card used to remember the tab index; close or move a tab during the two-minute wait and the edit landed in whichever document now held that index. The card now pins the tab's stable id, re-resolves it on Approve, and fails if the tab is gone.
apply_editalso fails if the match the card described has moved. - One tab resolver, everywhere.
goto_lineandset_languageignoredtab_idand acted on the focused tab; the diagram tools advertisedtab_idand then demandedtab_index. Every tab-taking tool now resolves through the same code, and a stale id is an error, never a fallback.compare_tabstakestab_id_a/tab_id_b. - Write destinations have a deny-list. Save As, exports and every buffer edit refuse credential stores and files that run code later:
authorized_keys, shell rc and profile files, autostart and LaunchAgents entries, the Windows Startup folder, cron spools,.git/hooksand.gitconfig. The check runs before any card, on the path, its canonical parent and any symlink target. - The card counts down and asks for attention. It shows the time left before auto-deny and flashes the taskbar entry (it never steals focus). A client that sends a
progressTokenreceivesnotifications/progresswhile the user decides. - Smaller fixes.
open_file,new_tab,create_diagramandget_statusreturntab_id;get_statusadds line endings, line count, length, selection, read-only, word wrap and the workspace folder. Exports are written to a temporary name and replaced in one step.format_*moved to the read tier. A relativeread_notepath resolves inside the Noter folder.resources/listsays so when the Noter folder cannot be listed. Stopping the editor with SIGTERM removes its endpoint file.
What changed in v0.1.127
Retesting v0.1.126 found a sixth credential door, and the interesting part is not the door — it is why there kept being another one.
select_range accepted any range inside a credential file and get_selection returned it as text. get_selection had been exempted on the reasoning that a selection is human-made, so reading it back implies consent — but select_range lets the client choose the range, which makes that reasoning false.
apply_edit was a quieter form of the same thing: it reads the buffer as a match oracle, so "no match" versus an approval card naming the match reports what a file contains, one probe at a time, without ever returning a byte of text.
Why the fix is structural rather than a sixth guard
Three consecutive releases shipped this same shape. v0.1.125 unified two hand-maintained copies of the deny list. v0.1.126 added the check to four verbs. The retest then found a fifth and a sixth.
Every one of those fixes was correct and none of them converged, because what kept going stale was not the list — it was the enumeration. Every new verb had to remember to ask, and the point of a security guard is that it does not depend on remembering.
Buffer text now leaves the editor through exactly one accessor, which refuses before it returns. select_range refuses to stage a selection over a credential file at all, so no future verb can inherit a leak that was already set up for it. And a test lints the bridge source and fails the build on any direct buffer read that bypasses the accessor — so a verb added next year cannot reintroduce the class without turning a test red.
Two smaller corrections
- The truncation marker was lying about the cap. Ask
read_tabformax_bytes: 100and the text still ended[truncated at 5 MB]— a constant left over from before the argument existed. It now reads[truncated: showing 100 of 2688894 characters]. The v0.1.126 notes also claimedread_tab"always reportstruncatedandtotal_chars"; that is true of the editor-to-sidecar wire and not of the tool result, which is plain text, so the marker is where those counts have to live. select_rangeadvertisedtab_idand then rejected it with-32602, so a client generating calls from the published schema failed. One verb out of thirteen slipped the v0.1.126 sweep. A test now walks the entire tool list and asserts every advertisedtab_idis genuinely accepted — a schema that lies is worse than a missing feature, because it makes correct clients fail. Separately,list_open_tabspublished the field asidwhile every verb takestab_id; both names are emitted for one release.
What changed in v0.1.126
v0.1.125 fixed a credential leak in search_project. A retest of that release found the fix covered one read path out of four — and eight other defects alongside it. Everything below is now the shipped behaviour.
search_project's filesystem walk to skip credential files, and that was the only place the check ran. So the leak survived in the plainest possible form — stop searching and just ask:
open_file {"path": ".../.ssh/id_rsa"} opened it with isError:false, and read_tab returned the entire private key. find_in_tab returned the matching key lines. And search_project's open-tab leg read the same file straight out of the buffer while its disk leg refused it.
All four now check the same list, and
open_file refuses before the tab exists — opening a key and then declining to read it would still put it on your screen.
Tools that reported success while returning the wrong answer
format_jsoninvented structure. The MCP path called the editor's JSON auto-fixer, which is right for the JSON panel — a human sees the repair and can undo it — and wrong here.[1,2came back as[1,2]withisError:false: a truncated config file made syntactically valid and semantically invented. Format-then-write-back would have fabricated data you never had. It validates strictly now and fails with a parse position.- A search that simply missed reported "No workspace folder is open". Whether a folder is open is not a fact about your query, but the error only fired when the open tabs happened to contain nothing — so the same tabs answered "not found" for one query and "you have no folder open" for another. Zero matches is a successful search now, with the reduced coverage carried in a
notice. - Without
--socket, everything was fabricated and nothing said so. Only--helpwarned, and the consumer is a model that never reads it. Every mock result now carries a[MOCK DATA]block and_meta.mock.
Tabs have a stable id
Every write verb used to address its target by tab_index. That index is positional: close a tab to its left and it silently re-points at a different document, underneath a caller with no way to notice. Out-of-range was the lucky case — you get an error. A shifted-but-still-valid index writes silently, with the approval card the only thing in the way.
list_open_tabs now publishes an id per tab that survives reordering, save-as, and its neighbours closing, and every verb that names a tab accepts tab_id. Asking for an id that is gone tells you it was closed, rather than reporting a bad index you never supplied. tab_index keeps working everywhere it did.
Smaller corrections
search_projectnow actually sends theworkspace_searchedandscopefields v0.1.125 promised — the editor had been sending them all along and the sidecar's own result struct discarded them.read_tabtakesmax_bytes, and a capped read ends with a marker stating how much you got of how much there is, so a multi-megabyte buffer can be paged rather than filling your context in one call.find_in_tabacceptstitle, whichread_tabalways accepted andfind_in_tabrejected as an unexpected argument.- An invalid pagination cursor on
tools/listis rejected instead of ignored — returning the full list is indistinguishable from "your cursor was valid, here is page 2".
The write-approval model
The write tools never execute on arrival (close_tab and reload_tab skip the card only when nothing unsaved would be lost). Each incoming write request shows a non-modal approval card inside the Notepatra window — it does not steal focus or block your typing — describing what the assistant wants to do, with a preview of the text involved and two buttons: Approve and Deny.
- Nothing happens until you click Approve. The tool call blocks; the assistant just waits.
- 120-second auto-deny, shown on the card. The card counts down the time left. If you don't respond within two minutes, the request is denied automatically and the assistant receives the error
approval timed out. A client that sent aprogressTokenhearsnotifications/progresswhile it waits. - The card names the document, and the write follows it. Each card says which tool, which tab, which operation and on what scope. If that tab is closed before you approve, the write fails instead of landing in another document.
- Some destinations are never offered. Writes to credential stores, shell start-up files, autostart entries, cron spools, git hooks and
.gitconfigare refused before any card appears. - Deny is a first-class answer. Click Deny and the assistant receives
denied by user— as a tool error it can read and react to, not a silent failure. - One card at a time, in order. Multiple pending writes queue FIFO; you decide each one individually. No batch-approve.
- No headless fallback — by design. If there is no visible editor window to host the card, the write is denied with
approval unavailable. There is no auto-approve setting, no environment variable, and no config flag that bypasses the card.
The gate lives in the editor process itself (the C++ bridge), not in the MCP sidecar — so a modified or malicious MCP client still cannot write without a human clicking Approve inside Notepatra. Read and act tools don't prompt: they do not change document text or write your files (view and theme changes are saved as preferences). They are not all local, though: tools that use a saved database connection open a connection to that database.
Setup — pick your client
The server binary is notepatra-mcp. All snippets below pass --socket, which connects it to the running editor; make sure notepatra-mcp is on your PATH (or use its absolute path), and have Notepatra running when the assistant calls a tool.
Get notepatra-mcp
From v0.1.118, every GitHub release ships prebuilt notepatra-mcp binaries — cosign-signed like every other release artifact:
notepatra-mcp-linux-x64.tar.gznotepatra-mcp-linux-arm64.tar.gznotepatra-mcp-macos-arm64.tar.gznotepatra-mcp-windows-x64.zipnotepatra-mcp.mcpb(Claude Desktop one-click)
Extract, chmod +x notepatra-mcp, and put it somewhere on your PATH:
tar xzf notepatra-mcp-linux-x64.tar.gz
chmod +x notepatra-mcp
sudo mv notepatra-mcp /usr/local/bin/
macOS: Notepatra and the sidecar are not notarized yet. First launch of the app: open it once, then go to System Settings › Privacy & Security and click Open Anyway (on macOS 14 and earlier, right-click › Open also works). If macOS blocks the sidecar binary, clear its quarantine flag: xattr -d com.apple.quarantine /usr/local/bin/notepatra-mcp (use your path).
Or build it from source — the sidecar lives in notepatra-mcp/ in the repo and needs only stable Rust, no other dependencies:
cd notepatra-mcp
cargo build --release # binary at target/release/notepatra-mcp
Windows named-pipe transport arrived in v0.1.119 but did not actually work: it deadlocked on the first verb after the greeting, so no tool call ever completed. It is fixed in v0.1.120 — the sidecar connects to the running editor over a named pipe (\\.\pipe\…) and --socket works there for real. As of v0.1.120 the signed release bundle provides a prebuilt Windows binary (notepatra-mcp-windows-x64.zip, cosign-signed like the others) and a one-click Claude Desktop bundle (notepatra-mcp.mcpb — install it from Claude Desktop's Settings → Extensions), so Windows users no longer need to build from source. cargo install notepatra-mcp remains a fully supported alternative on every platform.
| Client | Vendor ecosystem | How it connects | Works with Notepatra? |
|---|---|---|---|
| Claude Desktop | Anthropic | stdio, via claude_desktop_config.json — or one-click via the notepatra-mcp.mcpb bundle (Settings → Extensions) | Yes |
| Claude Code | Anthropic | stdio, via claude mcp add | Yes |
| Codex CLI | OpenAI | stdio, via config.toml | Yes |
| OpenAI Agents SDK | OpenAI | stdio, via MCPServerStdio | Yes |
| Cursor, Windsurf, VS Code, others | Various | stdio, via each client's MCP config | Yes — any spec-compliant stdio MCP client |
| ChatGPT connectors | OpenAI | Remote URL only | No — cannot reach a desktop editor (see limitations) |
| claude.ai web connectors | Anthropic | Remote URL only | No — cannot reach a desktop editor (see limitations) |
Claude Desktop
Add Notepatra to claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"notepatra": {
"command": "notepatra-mcp",
"args": ["--socket"]
}
}
}
Restart Claude Desktop; the Notepatra tools appear in the tools menu.
Claude Code
One command:
claude mcp add notepatra -- notepatra-mcp --socket
Then /mcp inside Claude Code shows the server and its 119 tools.
OpenAI Codex CLI
Add a block to ~/.codex/config.toml:
[mcp_servers.notepatra]
command = "notepatra-mcp"
args = ["--socket"]
OpenAI Agents SDK
Use the SDK's stdio server class (Python shown):
from agents import Agent, Runner
from agents.mcp import MCPServerStdio
async with MCPServerStdio(
params={"command": "notepatra-mcp", "args": ["--socket"]},
) as notepatra:
agent = Agent(
name="Editor assistant",
instructions="Help the user work with what they have open in Notepatra.",
mcp_servers=[notepatra],
)
result = await Runner.run(agent, "What tabs do I have open?")
Any other MCP client
Anything that can launch a stdio MCP server works — Cursor, Windsurf, VS Code, or your own client. Configure it to run the command notepatra-mcp with the argument --socket. The server identifies itself as notepatra-mcp and advertises the tools, resources, and prompts capabilities.
Tip: running notepatra-mcp without --socket starts it against a built-in mock editor — handy for testing a client integration without Notepatra running.
Resources and prompts
Beyond tools, the server exposes two other MCP capabilities:
Resources
notepatra://tab/N— each open tab, as plain text.resources/listenumerates them with their titles.notepatra://note/<basename>— each Noter note, as plain text. If two notes share a basename, the colliding ones are addressed by their URI-encoded full path instead, so every note stays reachable.notepatra://notes/unavailable— listed only when the editor cannot list your notes (for example, the OS blocks the Noter folder); its description and contents give the reason.
Clients that support MCP resources (Claude Desktop's attachment picker, for example) can pull a tab or note straight into the conversation without a tool call.
Prompts
| Prompt | What it does |
|---|---|
review-current-file | Code-review the file open in the active tab — embeds its live contents and language. |
explain-selection | Explain the text currently selected in the editor. |
summarize-notes | Summarize your Noter notes (embeds up to the 3 most recent). |
Limitations — the honest list
- The editor must be running. With
--socket, tools need a live Notepatra to talk to; if it isn't running, they return the clean error "Notepatra is not running (start the editor first)" rather than hanging. - Writes need a visible window. The approval card must appear somewhere; with no visible window, writes are denied with
approval unavailable. That is deliberate — see the approval model. - Cloud-only connector surfaces can't reach it. ChatGPT connectors and claude.ai web connectors only speak to servers reachable at a public URL. A desktop editor on your machine is not that, so those surfaces cannot use
notepatra-mcp. Use the desktop or CLI clients above instead. - Windows named-pipe transport (added v0.1.119, working from v0.1.120). The v0.1.119 implementation deadlocked on every verb, so Windows tool calls never completed; v0.1.120 fixes it. The sidecar connects to the running editor over a Windows named pipe (
\\.\pipe\…), so--socketworks on Linux, macOS, and Windows alike. Prebuilt Windows binaries (notepatra-mcp-windows-x64.zip) and the one-clicknotepatra-mcp.mcpbClaude Desktop bundle ship as v0.1.120 release assets;cargo install notepatra-mcpremains a fully supported alternative on every platform. - Large reads are capped.
read_tabtruncates at 5 MB (and says so with a marker in the text) and accepts a smallermax_bytes;search_projectreturns at most 200 matches per search. - Credential files are refused, and you cannot override it.
open_file,read_tab,find_in_taband both legs ofsearch_projectrefuse anything matching the credential deny-list — SSH/GPG/AWS key directories,id_rsaanywhere on a path,.envfiles,*.pem/*.key/*.pfx/*.p12/*.jks, Terraform state. This constrains the MCP surface, not you: open the file yourself and the editor shows it normally. A legitimate*.pemtest fixture will be refused, which is the intended trade — a refused read costs you one click, a leaked key does not. - The
Denybutton is less tested than the timeout. Approval-card denial by 120-second timeout is verified repeatedly; denial by clicking Deny is exercised in the automated suite but has had less real-hands testing. - Search defaults to literal.
find_in_tabandsearch_projectmatch a literal substring by default; pass{regex: true}for a regular-expression search (an invalid pattern is rejected with a clear error).
FAQ
Is my data sent anywhere?
Not by the MCP server itself, and nothing by default. The notepatra-mcp binary opens no network connections: it talks to your AI client over stdio (pipes between two processes on your machine) and to the editor over a local per-user socket, and the shipped binary is compiled without networking at all (every CI job runs it and fails unless it reports built without remote support). Some tools do reach beyond your machine, through the editor:
- Saved database connections.
run_query,list_tablesanddescribe_table(read tier) andtest_connection(act tier) connect to a database you saved, with its stored credentials, without an approval card.export_query_resultsandexecute_sqldo so only after you approve. If that database is on another machine, these calls cross the network to it. - REST and git.
rest_request,git_fetch,git_pullandgit_pushare write-tier tools: they reach the server or remote only after you click Approve.
One caveat that applies to every MCP server: whatever your assistant reads through these tools becomes part of its conversation, and goes wherever that client sends its conversations — a local model stays local, a cloud model does not. Choose the client and model accordingly.
What is the remote gateway in v0.1.120, and does it weaken any of this?
v0.1.120 adds an opt-in remote gateway, and it is off unless you deliberately build it: the code sits behind a
remote Cargo feature that is not in the default feature set, so cargo install notepatra-mcp and every
signed release binary contain no gateway and no networking or crypto dependencies at all. If you do build it
(cargo build --features remote), serve binds loopback only — 127.0.0.1, never a LAN or public
interface — and a client must complete an 8-digit one-time HMAC pairing to receive a 256-bit bearer token, of which only the SHA-256
is stored, mode 0600. Scopes are fail-closed: a client is read-only unless it paired for more, calls above its
scope are rejected at dispatch, and tools/list is filtered to the tiers it is allowed. A missing or invalid token never
elevates.
The approval gate is unchanged, and there is no remote approval. A remote write request is only forwarded to the editor, which raises the same Approve / Deny card on your screen. Nobody can approve a write from the far end of the connection, and there is no headless bypass. The editor itself never listens on the network — only the opt-in sidecar gateway binds a socket. Until LAN support and TLS land, use an SSH tunnel rather than exposing the port.
Can the AI edit my files without me noticing?
No. The only tools that can change a document or write a file are the 51 write tools, and each call requires you to click Approve on a card inside the editor within 120 seconds. No response means denied. (close_tab and reload_tab skip the card only when nothing unsaved would be lost.)
Is this the same as Notepatra's built-in AI Assistant?
No — they're complementary. The AI Assistant dock (Ctrl+Shift+A) is Notepatra talking to a model you configure. MCP is the reverse direction: an external assistant you already use (Claude, Codex, ...) talking to Notepatra. Neither requires the other.
Does it work with the Lite build?
Yes. The MCP bridge is part of the editor from v0.1.118 on both editions, and app_info reports which edition is running. On Lite, run_sql over a non-CSV file, DuckDB connections in run_query and PDF export of notes return an error saying they need the Full edition. The chart tools (render_chart, export_chart) return an error on Lite for Linux and Windows saying they need the Full edition, and on macOS, where neither edition renders charts, saying charts are not available in the macOS build.
Which tab is index 0?
Tab indices are zero-based, exactly as shown in the tab bar — including the Welcome tab when it's open. Use list_open_tabs first rather than guessing indices. Better still, use the id it returns: an index is positional and moves the moment a tab closes, while an id belongs to the document for as long as it is open.
What happened to the mock server?
Running notepatra-mcp without --socket still starts an in-memory demo editor, so any MCP client can exercise the protocol with nothing installed. As of v0.1.127 it says so on the wire: every result carries a [MOCK DATA] block and _meta.mock, and initialize reports serverInfo.mock. Before that, a config file that had lost its --socket served fabricated tabs an assistant could not tell from your real ones.