feat: Add Obsidian command execution support via MCP tools (#29)#47
Open
vanmarkic wants to merge 2 commits intojacksteamdev:mainfrom
Open
Conversation
…dev#29) Implemented two new MCP tools to expose Obsidian's command palette functionality: **New Tools:** 1. `list_obsidian_commands` - Lists all available Obsidian commands with their IDs and names 2. `execute_obsidian_command` - Executes a command by its ID **Use Cases:** - Automated daily note creation respecting plugin configurations - External triggering of plugin-specific workflows - Command palette automation through MCP integration - Integration with AI assistants for workflow automation **Implementation:** - Leverages existing Local REST API `/commands/` endpoints - Uses proper schema validation with empty object for no-arg tools - Includes descriptive examples in tool descriptions - URL-encodes command IDs to handle special characters safely **Example commands that can be executed:** - `daily-notes` - Create today's daily note - `editor:toggle-bold` - Toggle bold formatting - `workspace:split-vertical` - Split workspace vertically - Plugin-specific commands from installed plugins This allows MCP clients like Claude Desktop to discover and execute any Obsidian command, enabling powerful automation while respecting plugin settings and templates. Fixes jacksteamdev#29
- Test list_obsidian_commands schema structure - Test execute_obsidian_command schema with commandId argument - Test command ID validation and type checking - Test URL encoding for command IDs with special characters - Test encoding of colons, slashes, spaces in command IDs - Test ApiCommandsResponse and ApiCommand schema structures - Test integration between listing and executing commands - Verify common Obsidian command patterns are properly encoded
✅ Deploy Preview for superb-starlight-b5acb5 canceled.
|
istefox
added a commit
to istefox/obsidian-mcp-tools
that referenced
this pull request
Apr 11, 2026
The Open issues, Testing, Gotchas, and Suggested next steps sections were frozen at 2026-04-11 and did not reflect any of the work that has since landed on myfork/main. This commit brings CLAUDE.md back in sync with the actual working tree. Adds a new "Fork status" sub-section near the top explaining that active work happens on the istefox/obsidian-mcp-tools fork and how to read the fork markers (✅ + commit SHA) used further down. Gotchas: annotates the four previously-upstream-only bug notes that have now been fixed locally with [FORK: FIXED in <sha>] prefixes (patch_vault_file nested headings, patch_vault_file non-ASCII headings, hardcoded port 27124, Local REST API v3.4.x schema). Adds three new gotcha entries for production bugs the installer test suite uncovered during this session: resolveSymlinks ENOENT fallback returning a relative path, uninstallServer throwing on ENOENT during rmdir, and uninstallServer config cleanup being macOS-only — all three now fixed in the fork with commit SHAs recorded. Testing & CI: rewritten with current numbers (88 server + 66 plugin = 154 pass) and documentation of the new plugin test infrastructure that was missing from the original snapshot: bunfig.toml, the test-setup.ts module mock for "obsidian", .env.test for the build-time macro in install.ts, the spyOn(os, "homedir") pattern for HOME-based path tests, and the real-shell-script approach used by status.integration.test.ts. Project status — Static analysis findings: the "test coverage is thin" note is updated with the new counts; the "dual validators (zod + arktype)" note is marked [FORK: FIXED in 7e95366]. Open issues & PRs snapshot: adds a legend for the ✅ marker and annotates every cluster header (A through F) with the corresponding fork commit SHA. Cluster G's table gains a "Fork status" column showing 5 of 9 items closed and the remaining 4 (issue jacksteamdev#28, jacksteamdev#26, jacksteamdev#29 and PR jacksteamdev#47) still open. Suggested next steps: the 12-item roadmap is rewritten — steps 2-7 and 9 are marked ✅ with SHAs; step 1 (maintainership stance), step 8 (SDK upgrade), and steps 10-12 (cline_docs, branch pruning, prompt docs) remain open with updated rationale. Adds a "Still pending from Cluster G" subsection for the four remaining feature requests, and notes that command execution (jacksteamdev#29 / PR jacksteamdev#47) is gated on a security design review. No code changes. bun run check and plugin test suite (66 pass) were re-run as a sanity check and stay green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
list_commandstool to retrieve available Obsidian commandsexecute_commandtool to run commands by IDRelated Issue
Addresses feature request #29
🤖 Generated with Claude Code