@@ -16,36 +16,36 @@ This document specifies the MCP (Model Context Protocol) server for cmdr, enabli
1616┌─────────────────────────────────────────────────────────────────┐
1717│ Tauri App │
1818│ │
19- │ ┌──────────────────────────────────────────────────────────┐ │
20- │ │ MCP Module (Rust) │ │
21- │ │ │ │
22- │ │ ┌─────────────────┐ ┌─────────────────────────────┐ │ │
23- │ │ │ Tool Registry │ │ MCP Protocol Handler │ │ │
24- │ │ │ - App commands │ │ - tools/list │ │ │
25- │ │ │ - File system │ │ - tools/call │ │ │
26- │ │ │ - Shell │ │ - resources/list (optional) │ │ │
27- │ │ └────────┬────────┘ └──────────────┬──────────────┘ │ │
28- │ │ │ │ │ │
29- │ │ ▼ ▼ │ │
30- │ │ ┌─────────────────────────────────────────────────────┐ │ │
31- │ │ │ Tool Executor │ │ │
32- │ │ │ - Invokes Tauri commands │ │ │
33- │ │ │ - Performs file operations │ │ │
34- │ │ │ - Runs shell commands │ │ │
35- │ │ └─────────────────────────────────────────────────────┘ │ │
36- │ └──────────────────────────────────────────────────────────┘ │
19+ │ ┌──────────────────────────────────────────────────────────┐ │
20+ │ │ MCP Module (Rust) │ │
21+ │ │ │ │
22+ │ │ ┌─────────────────┐ ┌─────────────────────────────┐ │ │
23+ │ │ │ Tool Registry │ │ MCP Protocol Handler │ │ │
24+ │ │ │ - App commands │ │ - tools/list │ │ │
25+ │ │ │ - File system │ │ - tools/call │ │ │
26+ │ │ │ - Shell │ │ - resources/list (optional) │ │ │
27+ │ │ └────────┬────────┘ └──────────────┬──────────────┘ │ │
28+ │ │ │ │ │ │
29+ │ │ ▼ ▼ │ │
30+ │ │ ┌─────────────────────────────────────────────────────┐ │ │
31+ │ │ │ Tool Executor │ │ │
32+ │ │ │ - Invokes Tauri commands │ │ │
33+ │ │ │ - Performs file operations │ │ │
34+ │ │ │ - Runs shell commands │ │ │
35+ │ │ └─────────────────────────────────────────────────────┘ │ │
36+ │ └──────────────────────────────────────────────────────────┘ │
3737│ │ │
3838│ ▼ │
39- │ ┌─────────────────┐ ┌─────────────────────────────────┐│
40- │ │ HTTP Server │◀───────│ External clients (Claude, etc.) ││
41- │ │ localhost:9224 │ └─────────────────────────────────┘│
42- │ └─────────────────┘ │
39+ │ ┌─────────────────┐ ┌─────────────────────────────────┐ │
40+ │ │ HTTP Server │◀───────│ External clients (Claude, etc.) │ │
41+ │ │ localhost:9224 │ └─────────────────────────────────┘ │
42+ │ └─────────────────┘ │
4343│ │ │
4444│ ▼ │
45- │ ┌─────────────────┐ │
46- │ │ Internal Agent │ (future - direct Rust calls) │
47- │ │ Thread │ │
48- │ └─────────────────┘ │
45+ │ ┌─────────────────┐ │
46+ │ │ Internal Agent │ (future - direct Rust calls) │
47+ │ │ Thread │ │
48+ │ └─────────────────┘ │
4949└─────────────────────────────────────────────────────────────────┘
5050```
5151
@@ -55,60 +55,60 @@ This document specifies the MCP (Model Context Protocol) server for cmdr, enabli
5555
5656These map directly to the command palette commands.
5757
58- | Tool ID | Description | Parameters |
59- | ---------| -------------| ------------|
60- | ` app.quit ` | Quit the application | none |
61- | ` app.hide ` | Hide the application | none |
62- | ` app.about ` | Show about window | none |
63- | ` view.showHidden ` | Toggle hidden files visibility | none |
64- | ` view.briefMode ` | Switch to brief view mode | none |
65- | ` view.fullMode ` | Switch to full view mode | none |
66- | ` pane.switch ` | Switch focus to other pane | none |
67- | ` pane.leftVolumeChooser ` | Open left pane volume chooser | none |
68- | ` pane.rightVolumeChooser ` | Open right pane volume chooser | none |
69- | ` nav.open ` | Open selected item | none |
70- | ` nav.parent ` | Navigate to parent folder | none |
71- | ` nav.back ` | Navigate back in history | none |
72- | ` nav.forward ` | Navigate forward in history | none |
73- | ` file.showInFinder ` | Show selected file in Finder | none |
74- | ` file.copyPath ` | Copy selected file path to clipboard | none |
75- | ` file.copyFilename ` | Copy selected filename to clipboard | none |
76- | ` file.quickLook ` | Preview selected file with Quick Look | none |
77- | ` file.getInfo ` | Open Get Info window for selected file | none |
58+ | Tool ID | Description | Parameters |
59+ | --------------------------- | --------------------------- -------------| ------------|
60+ | ` app.quit ` | Quit the application | none |
61+ | ` app.hide ` | Hide the application | none |
62+ | ` app.about ` | Show about window | none |
63+ | ` view.showHidden ` | Toggle hidden files visibility | none |
64+ | ` view.briefMode ` | Switch to brief view mode | none |
65+ | ` view.fullMode ` | Switch to full view mode | none |
66+ | ` pane.switch ` | Switch focus to other pane | none |
67+ | ` pane.leftVolumeChooser ` | Open left pane volume chooser | none |
68+ | ` pane.rightVolumeChooser ` | Open right pane volume chooser | none |
69+ | ` nav.open ` | Open selected item | none |
70+ | ` nav.parent ` | Navigate to parent folder | none |
71+ | ` nav.back ` | Navigate back in history | none |
72+ | ` nav.forward ` | Navigate forward in history | none |
73+ | ` file.showInFinder ` | Show selected file in Finder | none |
74+ | ` file.copyPath ` | Copy selected file path to clipboard | none |
75+ | ` file.copyFilename ` | Copy selected filename to clipboard | none |
76+ | ` file.quickLook ` | Preview selected file with Quick Look | none |
77+ | ` file.getInfo ` | Open Get Info window for selected file | none |
7878
7979### 2. File system operations
8080
8181Direct file system access for AI agents.
8282
83- | Tool ID | Description | Parameters |
84- | ---------| -------------| ------------|
85- | ` fs.list ` | List directory contents | ` path: string ` |
86- | ` fs.read ` | Read file contents | ` path: string ` |
87- | ` fs.write ` | Write file contents | ` path: string, content: string ` |
88- | ` fs.create ` | Create file or directory | ` path: string, type: "file" \| "directory" ` |
89- | ` fs.delete ` | Delete file or directory | ` path: string ` |
90- | ` fs.move ` | Move/rename file or directory | ` from: string, to: string ` |
91- | ` fs.copy ` | Copy file or directory | ` from: string, to: string ` |
92- | ` fs.exists ` | Check if path exists | ` path: string ` |
93- | ` fs.stat ` | Get file/directory metadata | ` path: string ` |
83+ | Tool ID | Description | Parameters |
84+ | ------------- | ------------------------------- | --------------------------------- ------------|
85+ | ` fs.list ` | List directory contents | ` path: string ` |
86+ | ` fs.read ` | Read file contents | ` path: string ` |
87+ | ` fs.write ` | Write file contents | ` path: string, content: string ` |
88+ | ` fs.create ` | Create file or directory | ` path: string, type: "file" \| "directory" ` |
89+ | ` fs.delete ` | Delete file or directory | ` path: string ` |
90+ | ` fs.move ` | Move/rename file or directory | ` from: string, to: string ` |
91+ | ` fs.copy ` | Copy file or directory | ` from: string, to: string ` |
92+ | ` fs.exists ` | Check if path exists | ` path: string ` |
93+ | ` fs.stat ` | Get file/directory metadata | ` path: string ` |
9494
9595### 3. Shell commands
9696
9797Execute shell commands with appropriate sandboxing.
9898
99- | Tool ID | Description | Parameters |
100- | ---------| -------------| ------------|
99+ | Tool ID | Description | Parameters |
100+ | ------------- | --------------------- | --------------------------------------- ------------|
101101| ` shell.run ` | Run a shell command | ` command: string, cwd?: string, timeout?: number ` |
102102
103103### 4. Context operations
104104
105105Get current app state for context-aware operations.
106106
107- | Tool ID | Description | Parameters |
108- | ---------| -------------| ------------|
109- | ` context.getSelection ` | Get currently selected file(s) | none |
110- | ` context.getCurrentPaths ` | Get paths of both panes | none |
111- | ` context.getFocusedPane ` | Get which pane is focused | none |
107+ | Tool ID | Description | Parameters |
108+ | --------------------------- | ------------------- -------------| ------------|
109+ | ` context.getSelection ` | Get currently selected file(s) | none |
110+ | ` context.getCurrentPaths ` | Get paths of both panes | none |
111+ | ` context.getFocusedPane ` | Get which pane is focused | none |
112112
113113## MCP protocol implementation
114114
@@ -145,13 +145,13 @@ The STDIO binary forwards all requests to `http://127.0.0.1:9224/mcp`.
145145
146146### MCP messages supported
147147
148- | Method | Description |
149- | --------| -------------|
150- | ` initialize ` | Initialize MCP session |
151- | ` tools/list ` | List available tools with schemas |
152- | ` tools/call ` | Execute a tool |
148+ | Method | Description |
149+ | ------------------ | ------------------------ -------------|
150+ | ` initialize ` | Initialize MCP session |
151+ | ` tools/list ` | List available tools with schemas |
152+ | ` tools/call ` | Execute a tool |
153153| ` resources/list ` | List available resources (optional) |
154- | ` resources/read ` | Read a resource (optional) |
154+ | ` resources/read ` | Read a resource (optional) |
155155
156156### Tool schema format
157157
@@ -178,12 +178,12 @@ Each tool is defined with a JSON schema for parameters:
178178
179179### Environment variables
180180
181- | Variable | Description | Default |
182- | ----------| -------------| ---------|
183- | ` CMDR_MCP_ENABLED ` | Enable MCP server | ` true ` in debug, ` false ` in release |
184- | ` CMDR_MCP_PORT ` | HTTP server port | ` 9224 ` |
185- | ` CMDR_MCP_ALLOW_SHELL ` | Allow shell command execution | ` false ` |
186- | ` CMDR_MCP_ALLOW_WRITE ` | Allow file write operations | ` false ` |
181+ | Variable | Description | Default |
182+ | ------------------------ | ------------------------------- | ---------------------------- ---------|
183+ | ` CMDR_MCP_ENABLED ` | Enable MCP server | ` true ` in debug, ` false ` in release |
184+ | ` CMDR_MCP_PORT ` | HTTP server port | ` 9224 ` |
185+ | ` CMDR_MCP_ALLOW_SHELL ` | Allow shell command execution | ` false ` |
186+ | ` CMDR_MCP_ALLOW_WRITE ` | Allow file write operations | ` false ` |
187187
188188### Security
189189
@@ -245,8 +245,8 @@ Similar configuration pointing to `http://localhost:9224/mcp`.
245245
246246## Future enhancements
247247
248- 1 . ** Internal agent** - Rust thread with LLM integration calling tools directly
249- 2 . ** Path sandboxing** - Restrict file operations to allowed directories
250- 3 . ** Audit logging** - Log all tool executions for debugging
251- 4 . ** Rate limiting** - Prevent runaway agents
252- 5 . ** Tool permissions** - Per-client tool access control
248+ 1 . ** Internal agent** : Rust thread with LLM integration calling tools directly
249+ 2 . ** Path sandboxing** : Restrict file operations to allowed directories
250+ 3 . ** Audit logging** : Log all tool executions for debugging
251+ 4 . ** Rate limiting** : Prevent runaway agents
252+ 5 . ** Tool permissions** : Per-client tool access control
0 commit comments