@tarve/mcp 0.0.0-stage → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -3
- package/dist/cli.js +913 -0
- package/dist/index.js +914 -0
- package/package.json +55 -4
- package/src/cli-args.ts +137 -0
- package/src/cli.ts +9 -0
- package/src/index.ts +4 -0
- package/src/server.ts +156 -0
- package/src/session.ts +295 -0
- package/src/tools.ts +406 -0
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @tarve/mcp
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol](https://modelcontextprotocol.io) server for Tarve apps in development. It starts your
|
|
4
|
+
app with `tarve dev` (hot reload) and lets an AI agent see and drive the real native window: the node tree,
|
|
5
|
+
screenshots, clicks and typing through native hit testing, logs, events, metrics and restarts.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
bun add -d @tarve/mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
MCP client config (Claude Desktop, Claude Code, Cursor, VS Code…):
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{ "mcpServers": { "tarve": { "command": "bunx", "args": ["tarve-mcp", "src/app.tsx"] } } }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
With Node.js: `"command": "npx", "args": ["tarve-mcp", "src/app.tsx", "--runtime", "node"]`. A built app
|
|
18
|
+
(`tarve build`, txiki.js executables included) runs as it is: `"args": ["tarve-mcp", "dist/App.exe"]`.
|
|
19
|
+
|
|
20
|
+
`bun scripts/smoke-mcp.ts [--node | --txiki]` checks it against a real window on each runtime.
|
|
21
|
+
|
|
22
|
+
| Options | |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `--run` | `tarve run` instead of `tarve dev` (no hot reload) |
|
|
25
|
+
| `--runtime bun\|node` | passed to the tarve CLI |
|
|
26
|
+
| `--inspect` | also opens the visual inspector window |
|
|
27
|
+
| `--cwd <dir>` | the app's working directory |
|
|
28
|
+
| `--exec <command…>` | start the app with your own command (`tarve-mcp --exec bun --hot app.tsx`); `--` works too where the runtime keeps it (Bun drops it) |
|
|
29
|
+
|
|
30
|
+
## Tools
|
|
31
|
+
|
|
32
|
+
- **Read**: `app_status`, `inspect_tree` (outline `kind#id "text" [x,y wxh]`), `query_nodes`, `screenshot` (PNG), `wait_for`.
|
|
33
|
+
- **Drive**: `click`, `hover`, `type_text`, `press_key`, `scroll`, `drag`, `focus`. Target a node by visible text or label, by id, or by a window point (logical px). Each tool waits for the next frame.
|
|
34
|
+
- **Develop**: `reload` (restarts the process), `get_metrics` (JS and native phase percentiles, memory, fps), `get_events`, `get_logs` (the app's stdout and stderr).
|
|
35
|
+
|
|
36
|
+
There is no `eval`: tools only read the app and send it input.
|
|
37
|
+
|
|
38
|
+
## How it connects
|
|
39
|
+
|
|
40
|
+
The server makes a private socket (a named pipe on Windows, a Unix socket in a 0700 temporary directory
|
|
41
|
+
elsewhere) and starts the app with `TARVE_CONTROL` (that address) and `TARVE_CONTROL_TOKEN` (a random token).
|
|
42
|
+
`createApp` sees the variable, turns on debug, connects out and presents the token
|
|
43
|
+
(`packages/core/src/devtools/control.ts`). The app listens on nothing, and a normal launch, or one with
|
|
44
|
+
`dev: false`, never connects. stdout carries only MCP messages; the app's output is kept for `get_logs`.
|