tauri-mcp
by agnanp
README.md
# tauri-ai-tools
> Unofficial community MCP server, CLI, and editor plugin suite for **Tauri v2**. Not affiliated with or endorsed by The Tauri Programme.
`tauri-ai-tools` indexes live Tauri v2 documentation from [`https://v2.tauri.app/llms-full.txt`](https://v2.tauri.app/llms-full.txt) (with 24-hour memory + atomic disk caching) and validates Tauri v2 configs, capabilities, frontend API calls, and Rust commands.
## Features
- **MCP Tools**:
- `list-sections`: Lists top-level Tauri v2 documentation sections with `title`, `use_cases`, and `path`.
- `search-docs`: Searches across section titles, `use_cases`, subheadings, and body/table lines (`category` and `limit` filters).
- `get-documentation`: Fetches full sections, `path#Subheading` slices, or `query`-filtered reference tables (pages over 40 KB return a lean guide summary + outline by default).
- `tauri-autofixer`: Static checker and migration helper for `tauri.conf.json`, `capabilities/*.json` (validated against live official permission tables), frontend `@tauri-apps/*` imports, and Rust `#[tauri::command]` code.
- **MCP Resource & Prompt**:
- `Tauri-Doc-Section` (`tauri://{/slug*}.md`) resource template with slug completion.
- `tauri-task` prompt with section catalog and retrieval/autofixer workflow instructions.
- **Transports**: Streamable HTTP (`tauri-mcp serve` + Docker) and local stdio (`tauri-mcp`).
- **Editor Packaging**: Synced skills, subagent (`tauri-file-editor`), and instructions for Claude Code, Cursor, OpenCode, and `skills.sh`.
## Quick Start
### 1. Remote MCP with Docker (Streamable HTTP)
```bash
docker compose up -d --build
```
- **MCP endpoint**: `http://localhost:3000/mcp`
- **Healthcheck**: `curl http://localhost:3000/healthz` (`{"ok":true}`)
- **Persistent cache**: Named volume mounted at `/data/cache` (runs as non-root `node` user)
Point any Streamable HTTP MCP client (such as Antigravity, Cursor, or OpenCode) to your container:
```json
{
"mcpServers": {
"tauri-docs": {
"url": "http://localhost:3000/mcp"
}
}
}
```
#### HTTP Environment Variables
| Variable | Default | Description |
| :--- | :--- | :--- |
| `HOST` | `0.0.0.0` | Bind address for `tauri-mcp serve` |
| `PORT` | `3000` | TCP port (`0..65535`) |
| `TAURI_MCP_CACHE_DIR` | `/data/cache` (Docker) / OS cache | Directory storing `llms-full-cache.json` |
| `ALLOWED_ORIGINS` | *(empty — cross-origin denied)* | Comma-separated origins allowed for browser CORS requests |
| `MAX_BODY_BYTES` | `1048576` (1 MiB) | Maximum POST body size before returning `413` |
> **Note:** In remote HTTP mode (`stdio: false`), `tauri-autofixer` validates inline code/JSON snippets only and never reads files from the server's disk. Cross-origin browser requests are blocked (`403`) unless `ALLOWED_ORIGINS` is configured. Put a reverse proxy (HTTPS + auth) in front before exposing beyond localhost/LAN.
### 2. Local Stdio MCP
Requirements: Node.js 24+ and `pnpm` (`12.16.1`).
```bash
pnpm install
pnpm build
```
Configure your MCP host to run the built binary (or `npx -y @tauri-ai-tools/mcp` once published):
```json
{
"mcpServers": {
"tauri-docs": {
"command": "node",
"args": ["/path/to/tauri-ai-tools/packages/mcp-stdio/dist/index.mjs"]
}
}
}
```
In stdio mode (`stdio: true`), `tauri-autofixer` accepts either inline code or a local file path.
### 3. CLI Usage
```bash
node packages/mcp-stdio/dist/index.mjs list-sections
node packages/mcp-stdio/dist/index.mjs search-docs "TrayIconBuilder" --category learn --limit 5
node packages/mcp-stdio/dist/index.mjs get-documentation "plugin/file-system#Permission Table" --query write-text-file
node packages/mcp-stdio/dist/index.mjs tauri-autofixer ./src-tauri/capabilities/default.json
node packages/mcp-stdio/dist/index.mjs serve --host 0.0.0.0 --port 3000 --path /mcp
```
## Editor Plugins & Skills
Canonical skills, agent definitions, and instructions live under `tools/` and are synced to editor targets via `pnpm sync-plugins`:
- **Claude Code**: `.claude-plugin/marketplace.json` + `plugins/claude/tauri/`
- **Cursor**: `.cursor-plugin/marketplace.json` + `plugins/cursor/tauri/`
- **OpenCode**: `packages/opencode/` (`@tauri-ai-tools/opencode`) — injects MCP, skills, instructions, and `tauri-file-editor` subagent via `tauri.json`, while preserving any existing `tauri-docs` entry (including remote HTTP configs)
- **skills.sh**: `skills.sh.json`
## Project Structure
- `packages/mcp-server`: Docs fetcher/parser/cache, MCP tools/resources/prompts, and Tauri v2 autofixer rules
- `packages/mcp-stdio`: `tauri-mcp` CLI binary, stdio transport, and Streamable HTTP server (`serve`)
- `packages/opencode`: OpenCode plugin and config schema
- `tools/`: Canonical skills (`tauri-code-writer`, `tauri-v2-bestpractices`), agent (`tauri-file-editor`), and instructions
- `scripts/`: Sync scripts for Claude, Cursor, and OpenCode plugins
- `Dockerfile` & `compose.yaml`: Multi-stage non-root Docker setup
## Development
```bash
pnpm install
pnpm check # Type-check all packages
pnpm test # Run Vitest suite
pnpm build # Build packages & run publint
pnpm sync-plugins # Sync tools/ to Claude, Cursor, and OpenCode
```
## Credits & License
- Architecture inspired by [`sveltejs/ai-tools`](https://github.com/sveltejs/ai-tools) (MIT).
- Documentation fetched at runtime from [`v2.tauri.app`](https://v2.tauri.app).
- Licensed under the [MIT License](./LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues