An MCP (Model Context Protocol) server that exposes the live editor to AI coding agents (Claude Code, Cursor, VS Code, Windsurf, …). Agents can see the document you are actually editing — including unsaved edits — rather than just files on disk.
The server is a small HTTP listener bound to 127.0.0.1 only, authenticated with
a per-install Bearer token. Phase 1 is read-only.
| Tool | Returns |
|---|---|
get_status |
server / host / plugin status, port, read-only flag, tool count |
get_active_document |
path (or untitled), buffer id, language, EOL, dirty flag, length, caret, selection |
get_selection |
the currently selected text |
get_text |
the live document text (optionally a 1-based line range) |
get_caret_context |
the lines around the caret |
list_open_documents |
the open, saved files across both views, with the active one flagged |
find_in_document |
matches (line, column, line text) for a literal or regex query |
Open Plugins → MCP Server → Show MCP Server Panel (or click the toolbar button). Press Start, then use one of the Copy client setup buttons to put a ready-to-paste config on your clipboard. For Claude Code:
claude mcp add --transport http nextpad http://127.0.0.1:52700/mcp \
--header "Authorization: Bearer <token>"
Requests appear live in the panel's activity log. The port, token, read-only
mode, and "start on launch" are configurable in the panel and persisted to
NppMcpServer.ini in the plugin config dir (token stored 0600).
- Binds
127.0.0.1only — never reachable from the network. - Every request requires
Authorization: Bearer <token>(constant-time compare). - Browser
Originheaders that aren't localhost are rejected (DNS-rebinding guard). - Read-only by default; no code execution.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(sysctl -n hw.ncpu)
cmake --install build # → ~/Library/Application Support/Nextpad++/plugins/NppMCP/Produces a universal (arm64 + x86_64) dylib, deployment target macOS 11.
test/harness_main.mm is a standalone transport/auth/JSON-RPC regression harness
that links only NppMcpServer.mm + Foundation (no editor needed).