{"_id":"tauri-plugin-mcp-server","_rev":"3-42997de5501670dfe24c8ab7b9571468","name":"tauri-plugin-mcp-server","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"tauri-plugin-mcp-server","version":"0.1.0","keywords":[],"author":{"name":"Pegleg"},"license":"MIT","_id":"tauri-plugin-mcp-server@0.1.0","maintainers":[{"name":"pegleg2060","email":"pegleg2060@gmail.com"}],"bin":{"tauri-mcp-server":"build/index.js"},"dist":{"shasum":"caee0d871595a89a4e5dbc477064f738efc4dc2f","tarball":"https://registry.npmjs.org/tauri-plugin-mcp-server/-/tauri-plugin-mcp-server-0.1.0.tgz","fileCount":16,"integrity":"sha512-3vqyNi8TfhQ59aFgMUV9387P5rH3mZFDbRjclRcYAFnVsMhsHQuH/YASqn8BlZ/4uW7NfNG47rhL2abzgWQOzQ==","signatures":[{"sig":"MEQCIFQ+7MczDHGWuG+Np4BH0dEKs07JRo4eEDxA70aF+jOfAiBvWLvw66WJFlsrs7fbtyzx3H8FZg9g2FULBkesjYLlgA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83918},"main":"index.js","type":"module","gitHead":"2ba53fc60836a48cdda4e11c3b7c55fd184ed4de","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc"},"_npmUser":{"name":"pegleg2060","email":"pegleg2060@gmail.com"},"_npmVersion":"10.8.2","description":"This is a Model Context Protocol (MCP) server that connects to a Tauri application's socket server to provide tools for controlling and interacting with the Tauri application.","directories":{},"_nodeVersion":"20.20.0","dependencies":{"zod":"^3.24.4","@modelcontextprotocol/sdk":"^1.11.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3","@types/node":"^22.15.17"},"_npmOperationalInternal":{"tmp":"tmp/tauri-plugin-mcp-server_0.1.0_1772012609624_0.8512789791407356","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"tauri-plugin-mcp-server","version":"0.2.0","keywords":["tauri","mcp","model-context-protocol","automation","testing","ai-agents"],"author":{"name":"Pegleg"},"license":"MIT","_id":"tauri-plugin-mcp-server@0.2.0","maintainers":[{"name":"pegleg2060","email":"pegleg2060@gmail.com"}],"homepage":"https://github.com/P3GLEG/tauri-plugin-mcp#readme","bugs":{"url":"https://github.com/P3GLEG/tauri-plugin-mcp/issues"},"bin":{"tauri-mcp-server":"build/index.js"},"dist":{"shasum":"eab060a0bcc4d2739cfd56d2d98d9a65b0789eb5","tarball":"https://registry.npmjs.org/tauri-plugin-mcp-server/-/tauri-plugin-mcp-server-0.2.0.tgz","fileCount":21,"integrity":"sha512-PVECdEf9aNM04dYdSUAgqri14I1v6l3ZXHdAwTqwCpaq6MAlPt6rw6UsvknDc/Bojco3Xs3BSjAOglwjwMatPg==","signatures":[{"sig":"MEUCIHuTborXvBsK9HF6/fVdwLyGasY209aJX2nInde8Kw0SAiEA56Ug6cdPg5GwRCZg4hhTK2h7kcOGMkodXdK4m7TYfRw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tauri-plugin-mcp-server@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":138857},"main":"build/index.js","type":"module","engines":{"node":">=18"},"gitHead":"9c14b66197d736cd98cd2640711b71e11cc71fee","scripts":{"test":"node test/smoke-test.mjs","build":"tsc && node -e \"require('fs').chmodSync('build/index.js', 0o755)\"","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:502860da-96db-478b-a36c-7ad28507840b"}},"repository":{"url":"git+https://github.com/P3GLEG/tauri-plugin-mcp.git","type":"git","directory":"mcp-server-ts"},"_npmVersion":"12.0.1","description":"MCP server that lets AI agents interact with and debug Tauri applications via the tauri-plugin-mcp socket (screenshots, DOM access, input simulation, log querying)","directories":{},"_nodeVersion":"22.23.1","dependencies":{"zod":"^3.25.76","@modelcontextprotocol/sdk":"^1.27.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3","@types/node":"^22.15.17"},"_npmOperationalInternal":{"tmp":"tmp/tauri-plugin-mcp-server_0.2.0_1784196999342_0.6889067444055761","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"tauri-plugin-mcp-server","version":"0.3.1","description":"MCP server that lets AI agents interact with and debug Tauri applications via the tauri-plugin-mcp socket (screenshots, DOM access, input simulation, log querying)","main":"build/index.js","type":"module","bin":{"tauri-mcp-server":"build/index.js"},"scripts":{"build":"tsc && node -e \"require('fs').chmodSync('build/index.js', 0o755)\"","test":"node test/smoke-test.mjs","prepublishOnly":"npm run build && npm test"},"engines":{"node":">=18"},"keywords":["tauri","mcp","model-context-protocol","automation","testing","ai-agents"],"repository":{"type":"git","url":"git+https://github.com/P3GLEG/tauri-plugin-mcp.git","directory":"mcp-server-ts"},"author":{"name":"Pegleg"},"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.27.1","zod":"^3.25.76"},"devDependencies":{"@types/node":"^22.15.17","typescript":"^5.8.3"},"gitHead":"c7d271a06469bdf4744bfdeadca7458a1f3d02e5","_id":"tauri-plugin-mcp-server@0.3.1","bugs":{"url":"https://github.com/P3GLEG/tauri-plugin-mcp/issues"},"homepage":"https://github.com/P3GLEG/tauri-plugin-mcp#readme","_nodeVersion":"22.23.1","_npmVersion":"12.0.1","dist":{"integrity":"sha512-pu3IJj07KspLTXnpGaaHtZoTd9MZpg9AkMAiMOUhoog8Q4qJsKzzEUufGnNokzNjJrnNwM607YakGnM7QC3tnQ==","shasum":"09d54eebc1f89bbac48652158f3bfe80816be7df","tarball":"https://registry.npmjs.org/tauri-plugin-mcp-server/-/tauri-plugin-mcp-server-0.3.1.tgz","fileCount":25,"unpackedSize":153460,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tauri-plugin-mcp-server@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHCAlSRKYr0KznZAgTrrGNkWIsvPl693oeRRrWlMiepwAiBP0a9d+AbWFFluRqT0TTyVum/zZllw4gAnLMatQqj1kw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:502860da-96db-478b-a36c-7ad28507840b"}},"directories":{},"maintainers":[{"name":"pegleg2060","email":"pegleg2060@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tauri-plugin-mcp-server_0.3.1_1784269712021_0.3932364761957894"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-25T09:43:29.622Z","modified":"2026-07-17T06:28:32.475Z","0.1.0":"2026-02-25T09:43:29.878Z","0.2.0":"2026-07-16T10:16:39.494Z","0.3.1":"2026-07-17T06:28:32.179Z"},"bugs":{"url":"https://github.com/P3GLEG/tauri-plugin-mcp/issues"},"author":{"name":"Pegleg"},"license":"MIT","homepage":"https://github.com/P3GLEG/tauri-plugin-mcp#readme","keywords":["tauri","mcp","model-context-protocol","automation","testing","ai-agents"],"repository":{"type":"git","url":"git+https://github.com/P3GLEG/tauri-plugin-mcp.git","directory":"mcp-server-ts"},"description":"MCP server that lets AI agents interact with and debug Tauri applications via the tauri-plugin-mcp socket (screenshots, DOM access, input simulation, log querying)","maintainers":[{"name":"pegleg2060","email":"pegleg2060@gmail.com"}],"readme":"# Tauri MCP Server\n\nThis is a Model Context Protocol (MCP) server that connects to a Tauri application's socket server to provide tools for controlling and interacting with the Tauri application.\n\n## Overview\n\nThe server bridges MCP clients (like LLMs) with a Tauri application by:\n\n1. Connecting to the Tauri socket server via a Unix socket/named pipe (or TCP)\n2. Providing MCP tools that map to Tauri functionality\n3. Running as a stdio-based MCP server that any MCP client can use\n\n## Available Tools\n\nThe server registers 13 MCP tools:\n\n### `take_screenshot`\n\nCaptures a screenshot of an application window. By default saves the full image to disk and returns a small thumbnail inline (token-efficient); set `inline=true` for full base64 inline.\n\n**Parameters:**\n- `window_label` (optional): Window to capture (default: `\"main\"`)\n- `quality` (optional): JPEG quality 1-100 (default: 70)\n- `max_width` (optional): Maximum image width in pixels (default: 1024)\n- `max_size_mb` (optional): Maximum file size in MB (default: 1.0)\n- `output_dir` (optional): Directory to save the screenshot to (default: system temp)\n- `inline` (optional): Return full-resolution base64 inline instead of saving to disk (default: false)\n- `audience` (optional): `\"user\"`, `\"assistant\"`, or `\"both\"` — hint for who consumes the image\n\n**Returns:** Image content (thumbnail + file path, or full inline base64)\n\nNote: screenshot pixel coordinates do NOT match the CSS pixel coordinates used by `click`/`mouse_action`. Use `query_page` with `mode=\"find_element\"` to get click targets.\n\n### `query_page`\n\nInspects the current page.\n\n**Parameters:**\n- `mode` (required): `\"map\"` (structured element map with numbered refs — preferred), `\"html\"` (raw DOM), `\"state\"` (URL/title/scroll/viewport), `\"find_element\"` (exact CSS pixel coordinates of an element), `\"app_info\"` (app name, version, OS, windows, monitors)\n- `window_label` (optional): Target window (default: `\"main\"`)\n- Map-mode options: `include_content`, `interactive_only`, `scope_selector`, `max_depth`, `delta`, `wait_for_stable`, `quiet_ms`, `max_wait_ms`, `timeout_secs` (max 300), `include_metadata`\n- Find-element options: `selector_type` (`\"ref\"`, `\"id\"`, `\"class\"`, `\"css\"`, `\"tag\"`, `\"text\"`), `selector_value`, `should_click`\n\n**Returns:** JSON page map, HTML string, page state, element coordinates, or app info depending on mode\n\n### `click`\n\nClicks at a position in the webview, either by raw x/y coordinates or by resolving a selector to its center.\n\n**Parameters:**\n- `x`, `y` (optional): CSS pixel coordinates (required if no selector)\n- `button` (optional): `\"left\"`, `\"right\"`, `\"middle\"` (default: `\"left\"`)\n- `click_type` (optional): `\"single\"` or `\"double\"` (default: `\"single\"`)\n- `selector_type` (optional): `\"ref\"`, `\"id\"`, `\"class\"`, `\"css\"`, `\"tag\"`, `\"text\"`\n- `selector_value` (optional): Selector value (for `\"ref\"`, the ref number as a string)\n- `window_label` (optional): Target window (default: `\"main\"`)\n\n**Returns:** Confirmation message with the clicked coordinates\n\n### `type_text`\n\nTypes text into the page. Three modes: bulk form fill (`fields` array), a specific element (`selector_type` + `selector_value`), or the currently focused element (just `text`). Works with inputs, textareas, contentEditable, React controlled components, Lexical, and Slate.\n\n**Parameters:**\n- `text` (optional): Text to type (required unless using `fields`)\n- `selector_type` (optional): `\"ref\"`, `\"id\"`, `\"class\"`, `\"css\"`, `\"tag\"`, `\"text\"`\n- `selector_value` (optional): Selector value\n- `fields` (optional): Array of `{ ref | selector_type + selector_value, value, clear }` for bulk form fill\n- `submit_ref` (optional): Ref of a submit button to click after filling all fields\n- `window_label` (optional): Target window (default: `\"main\"`)\n- `delay_ms`, `initial_delay_ms` (optional): Typing delays\n\n**Returns:** Confirmation with the target element info\n\n### `mouse_action`\n\nNon-click mouse actions.\n\n**Parameters:**\n- `action` (required): `\"hover\"`, `\"scroll\"`, or `\"drag\"`\n- Hover/drag: `x`, `y`, `relative`, `end_x`, `end_y`\n- Scroll: `direction` (`\"up\"`/`\"down\"`), `amount` (pixels, `\"page\"`, `\"half\"`), `to_ref`, `to_top`, `to_bottom`\n- `window_label` (optional): Target window (default: `\"main\"`)\n\n**Returns:** Confirmation message\n\n### `navigate`\n\nControls webview navigation.\n\n**Parameters:**\n- `action` (required): `\"goto\"`, `\"back\"`, `\"forward\"`, `\"reload\"`\n- `url` (optional): URL for `\"goto\"`\n- `delta` (optional): History steps for `\"back\"`/`\"forward\"`\n- `window_label` (optional): Target window (default: `\"main\"`)\n\n**Returns:** Navigation result\n\n### `execute_js`\n\nExecutes arbitrary JavaScript in a webview. The universal escape hatch.\n\n**Parameters:**\n- `code` (required): JavaScript code to execute\n- `window_label` (optional): Target window (default: `\"main\"`)\n- `timeout_ms` (optional): Maximum execution time in milliseconds (max: 300000)\n\n**Returns:** The result of the last statement or promise resolution, serialized as a string\n\n### `manage_storage`\n\nManages browser storage (localStorage and cookies).\n\n**Parameters:**\n- `store` (required): `\"local_storage\"` or `\"cookies\"`\n- `action` (required): For `local_storage`: `\"get\"`, `\"set\"`, `\"remove\"`, `\"clear\"`, `\"keys\"`. For `cookies`: `\"get_all\"`, `\"get_for_url\"`, `\"clear_all\"` (clears ALL browsing data — cookies, cache, and localStorage — not just cookies)\n- `key`, `value` (optional): For localStorage get/set/remove\n- `url` (optional): For `\"get_for_url\"`\n- `window_label` (optional): Target window (default: `\"main\"`)\n\n**Returns:** Operation result\n\n### `manage_window`\n\nManages windows, zoom, devtools, and webview state.\n\n**Parameters:**\n- `action` (required): Window ops (`\"list\"`, `\"focus\"`, `\"minimize\"`, `\"maximize\"`, `\"unmaximize\"`, `\"close\"`, `\"show\"`, `\"hide\"`, `\"set_position\"`, `\"set_size\"`, `\"center\"`, `\"toggle_fullscreen\"`), zoom (`\"set_zoom\"`, `\"get_zoom\"`), devtools (`\"open_devtools\"`, `\"close_devtools\"`, `\"is_devtools_open\"`), webview state (`\"clear_browsing_data\"`, `\"set_background_color\"`, `\"get_bounds\"`, `\"set_auto_resize\"`)\n- `window_label` (optional): Target window (default: `\"main\"`)\n- Action-specific: `x`, `y` (set_position), `width`, `height` (set_size), `scale` (set_zoom), `r`/`g`/`b`/`a` (set_background_color), `enabled` (set_auto_resize)\n\n**Returns:** Operation result\n\n### `wait_for`\n\nWaits for a condition: text appearing/disappearing, or an element becoming visible/hidden/attached/detached. Provide exactly one of `text`, `selector`, or `ref`.\n\n**Parameters:**\n- `text` (optional): Text to wait for\n- `selector` (optional): CSS selector of the element to wait for\n- `ref` (optional): Element ref from `query_page` map mode\n- `state` (optional): `\"visible\"`, `\"hidden\"`, `\"attached\"`, `\"detached\"` (default: `\"visible\"`)\n- `timeout_ms` (optional): Maximum wait in milliseconds (default: 10000, max: 300000)\n- `window_label` (optional): Target window (default: `\"main\"`)\n\n**Returns:** Wait result\n\n### `restart_app`\n\nRestarts the Tauri application and waits for it to come back online. Force-kills the app if it is frozen (IPC mode only). Destructive — all in-memory state is lost. If `TAURI_DEV_URL` is set, the WebView is navigated there after restart.\n\n**Parameters:**\n- `delay_ms` (optional): Delay before restart, 100-5000 ms (default: 500)\n\n**Returns:** Restart confirmation\n\n### `query_logs`\n\nQueries buffered logs from the Tauri app (Rust `log!()` output and webview `console.*` calls).\n\n**Parameters:**\n- `mode` (optional): `\"summary\"` (counts + recent warnings/errors) or `\"tail\"` (matching entries; default)\n- `level` (optional): Minimum severity — `\"trace\"`, `\"debug\"`, `\"info\"`, `\"warn\"`, `\"error\"`\n- `source` (optional): `\"rust\"` or `\"js\"`\n- `contains` (optional): Case-insensitive substring filter\n- `since_id`, `since_ms` (optional): Pagination/time cursors\n- `limit` (optional): Max entries, 1-1000 (default: 100)\n- `head` (optional): Return oldest instead of most recent (default: false)\n- `format` (optional): `\"compact\"` or `\"json\"` (default: `\"compact\"`)\n- `between` (optional): Marker tag — return entries between the two most recent `log_mark` calls with this id\n- `include_markers` (optional): Include marker entries in the result (default: false)\n\n**Returns:** Formatted log entries or summary\n\n### `log_mark`\n\nInserts a marker into the log buffer. Call once before an action and once after with the same `id`, then use `query_logs` with `between` to see exactly the logs produced in between.\n\n**Parameters:**\n- `id` (required): Marker tag (reuse the same id for the begin/end pair)\n- `note` (optional): Free-form description attached to the marker\n\n**Returns:** Confirmation with the marker entry id\n\n## Setup and Usage\n\n1. Ensure the Tauri application is running with the socket server active\n2. Start this MCP server\n3. Connect your MCP client to this server\n4. Use the tools to interact with the Tauri application\n\nBy default the server connects to the Tauri socket at `/tmp/tauri-mcp.sock` (Unix) or the `tauri-mcp.sock` named pipe on Windows. Configuration via environment variables:\n\n- `TAURI_MCP_IPC_PATH` — custom Unix socket path\n- `TAURI_MCP_CONNECTION_TYPE=tcp` with `TAURI_MCP_TCP_HOST` / `TAURI_MCP_TCP_PORT` — TCP mode\n- `TAURI_MCP_AUTH_TOKEN` — auth token (otherwise read from the socket's `.token` file)\n- `TAURI_DEV_URL` — dev-server URL used by `restart_app` to reload the WebView after a restart\n\n## Error Handling\n\nAll tools follow the MCP error reporting convention:\n- If a tool succeeds, it returns a result object with `content`\n- If a tool fails, it returns an object with `isError: true` and an error message in `content`\n\n## Example\n\nUsing the `take_screenshot` tool from an MCP client:\n\n```json\n{\n  \"name\": \"take_screenshot\",\n  \"arguments\": {\n    \"window_label\": \"main\",\n    \"quality\": 90,\n    \"max_width\": 1920\n  }\n}\n```\n\nThe response will include the saved file path plus a thumbnail (or full base64 image data with `inline: true`).\n","readmeFilename":"README.md"}