Skip to content

feat: add READ_ONLY mode to disable write tools#3

Merged
es617 merged 3 commits into
es617:mainfrom
miltonnetofastpays:feature/read-only-mode
May 5, 2026
Merged

feat: add READ_ONLY mode to disable write tools#3
es617 merged 3 commits into
es617:mainfrom
miltonnetofastpays:feature/read-only-mode

Conversation

@miltonnetofastpays

Copy link
Copy Markdown
Contributor

Summary

Implements the feature requested in #1.

  • Adds READ_ONLY=true environment variable support
  • When set, the server skips registration of all write tools: write_note, edit_note, delete_note, move_note
  • Read-only tools remain unaffected: read_note, list_notes, list_folders, list_tags, get_note_metadata
  • A startup log message confirms which tools were disabled

Motivation

When exposing the MCP server to multiple AI clients, there is no server-level way to restrict write access. This flag lets operators expose a vault safely without relying on per-client filtering.

Usage

READ_ONLY=true

Set this environment variable before starting the server. No other configuration needed.

Changes

  • src/tools.ts: added readOnly parameter to registerTools; write tools are conditionally skipped
  • src/main.ts: reads READ_ONLY env var and passes it to registerTools

Closes #1

miltonnetofastpays and others added 3 commits May 5, 2026 13:35
When READ_ONLY=true, the server skips registration of write_note,
edit_note, delete_note, and move_note. Only read tools are exposed via
MCP, protecting vaults shared with multiple AI clients.

Closes es617#1
@es617 es617 force-pushed the feature/read-only-mode branch from 078be84 to 1c2c9cd Compare May 5, 2026 17:35
@es617 es617 merged commit 1214c88 into es617:main May 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: READ_ONLY mode to disable write tools

4 participants