Skip to content

feat: MCP server section in Settings - #114

Merged
FabioHAraujo merged 1 commit into
mainfrom
feat/mcp-settings
Oct 29, 2026
Merged

FabioHAraujo merged 1 commit into
mainfrom
feat/mcp-settings

Conversation

@FabioHAraujo

Copy link
Copy Markdown
Contributor

Builds on #113 (the lownotes-mcp bridge): merge that first. Until then this diff also shows the bridge commits.

Settings gets an MCP server tab, so turning the server on no longer means editing settings.json.

Interface

  • Turn on the MCP server: off by default. Turning it on the first time also shares the open vault, so the switch alone is enough.
  • Status: shows whether the server is running and how many requests it has served since LowNotes started. The status refreshes every 2 s while the tab is open.
  • Privacy note: what an AI app reads goes to that app and to its AI provider, and notes from other devices can contain text written to steer an AI.
  • Shared vaults: one checkbox per vault. Clients still only read the vault that is open.
  • Connect an AI app: ready-to-copy configuration for Claude Desktop and Cursor (an mcpServers JSON entry) and a claude mcp add --scope user command for Claude Code, all pointing at lownotes-mcp next to the app.
    • If the bridge is missing, Settings says so.
    • On an AppImage, it warns that the path changes on every start.
  • Regenerate token: asks for confirmation (appConfirm), stores a new token and restarts the server, which disconnects every client.
  • Strings: all of them are in en-US, pt-BR and es-ES.

Backend

  • mcp_status returns whether the server runs, the request count, the bridge path and whether that path is temporary. It never returns the token.
  • save_mcp_settings(enabled, vaultIds) keeps only vault ids that exist, saves, and starts or stops the server.
  • mcp_regenerate_token replaces the token in the OS credential store and restarts the server.
  • Restart: it now waits for the previous server task to finish before binding again. Without that, Windows would refuse the pipe name and Unix could remove the new socket.
  • on_worker becomes pub(crate) so the MCP commands run on the blocking pool like the others.

Tests

  • tests/mcp-config.test.ts covers the client JSON and the shell quoting of the Claude Code command for Windows, macOS and a path with a quote.
  • tests/e2e/mcp.pw.ts turns the server on and checks the saved arguments and the shared vault. It also checks the status, the snippets with a Windows path, unsharing the vault, and regenerating the token.

Full AGENTS.md verification on Windows passes: install, version:check, check, check:e2e, bun test, the Python script tests, cargo fmt, clippy -D warnings, cargo test and bun run build, plus test:e2e. I ran it again after merging main (Excalidraw).

Not in this PR: the Allow changes switch in the issue belongs to the write tools (#105), which are out of scope for v0.5.0.

Closes #103

@FabioHAraujo FabioHAraujo added enhancement New feature or request priority: P2 Important: performance, architecture or release quality size: M Medium: a few days area: backend Rust side (src-tauri) area: frontend Svelte/TypeScript side (src) labels Oct 29, 2026
Settings gets an MCP server tab: turn the server on (sharing the open vault
the first time), choose the shared vaults, see whether it runs and how many
requests it served, copy the configuration for Claude Desktop, Claude Code
and Cursor, and regenerate the access token, which disconnects every client.

The backend adds mcp_status, save_mcp_settings and mcp_regenerate_token. A
restart waits for the previous server to release the pipe or socket. The
token stays in the OS credential store; the interface only sees the path of
the lownotes-mcp program.

Closes #103
@FabioHAraujo
FabioHAraujo merged commit 2d97efa into main Oct 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Rust side (src-tauri) area: frontend Svelte/TypeScript side (src) enhancement New feature or request priority: P2 Important: performance, architecture or release quality size: M Medium: a few days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings section for the MCP server

1 participant