@rebind.gg/mcp-server 0.1.1 → 0.1.3

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 CHANGED
@@ -3,13 +3,33 @@
3
3
  Stdio MCP server that exposes Rebind as computer-use tools: `screenshot`,
4
4
  `screenshot_window`, `zoom`, `click` (verified), `move_mouse`, `type`, `key`,
5
5
  `scroll`, `run_lua`, `wait`, window control, and `calibrate`. Wraps
6
- `@rebind.gg/client-ts`; requires a remote-control
7
- server running in Rebind — `remote.luau` (recommended) or `remote_access.lua`
8
- (protocol >= 1.1.0). The `click` tool clicks via `hid.press`, which is
6
+ `@rebind.gg/client-ts`; requires the **Rebind** app
7
+ (https://rebind.gg/download) running its Remote Access relay — `remote.luau`
8
+ (recommended) or `remote_access.lua` (protocol >= 1.1.0). The `click` tool clicks via `hid.press`, which is
9
9
  coroutine-only; use `remote.luau` or a current `remote_access.lua` (older copies
10
10
  called it outside a coroutine, so clicks silently failed).
11
11
 
12
- ## Use
12
+ ## Install
13
+
14
+ One command writes the correct config for whichever clients you name — Claude
15
+ Code, Cursor, Codex, OpenCode, VS Code, Windsurf, Zed, and more — each in its
16
+ native format, via [`add-mcp`](https://github.com/neondatabase/add-mcp):
17
+
18
+ ```sh
19
+ npx add-mcp "bunx @rebind.gg/mcp-server" --name rebind \
20
+ --env REBIND_URL=ws://127.0.0.1:19561 \
21
+ -g -a claude-code -a cursor -a codex -a opencode
22
+ ```
23
+
24
+ Drop `-a <agent>` for the clients you want, or pass `--all`. `-g` installs
25
+ globally; omit it for project-local config. Restart the client afterward.
26
+
27
+ Requires **Bun** (the server runs via `bunx`) and the **Rebind** app
28
+ (https://rebind.gg/download) running its Remote Access relay.
29
+
30
+ ## Configure manually
31
+
32
+ Any MCP client takes the stdio block directly:
13
33
 
14
34
  ```json
15
35
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebind.gg/mcp-server",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "MCP server exposing Rebind as computer-use tools: screenshot, verified click, type, key, scroll, and window control over the Remote Access protocol.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -51,13 +51,8 @@ async function main() {
51
51
  await client.connect();
52
52
 
53
53
  const session = new Session(client);
54
- try {
55
- await session.calibrate();
56
- } catch (e) {
57
- session.calibration = { calibrated: false, reason: String(e) };
58
- }
59
54
 
60
- const server = new McpServer({ name: "rebind", version: "0.1.1" });
55
+ const server = new McpServer({ name: "rebind", version: "0.1.2" });
61
56
 
62
57
  // REBIND_AGENT_LOG=<path>: opt-in telemetry — one JSONL line per tool call
63
58
  // ({ts, tool, ok, latency_ms, note}). No screenshot bytes, no user content.
@@ -413,7 +408,8 @@ async function main() {
413
408
  "calibrate",
414
409
  {
415
410
  description:
416
- "Re-run the mouse scale probe (auto-runs at startup). Verifies relative mouse counts map 1:1 to pixels; reports pointer-ballistics misconfiguration.",
411
+ "Run the mouse scale probe. Verifies relative mouse counts map 1:1 to pixels; reports pointer-ballistics misconfiguration. " +
412
+ "Auto-runs on first click/move_mouse if not already calibrated; call this tool explicitly to re-run.",
417
413
  },
418
414
  async () => text(JSON.stringify(await session.calibrate())),
419
415
  );
package/src/session.ts CHANGED
@@ -54,9 +54,20 @@ export interface CalibrationResult {
54
54
  export class Session {
55
55
  lastShot: ShotMapping | null = null;
56
56
  calibration: CalibrationResult | null = null;
57
+ private _calibrating = false;
57
58
 
58
59
  constructor(readonly client: RebindRemote) {}
59
60
 
61
+ async ensureCalibrated(): Promise<void> {
62
+ if (this.calibration !== null || this._calibrating) return;
63
+ this._calibrating = true;
64
+ try {
65
+ await this.calibrate();
66
+ } finally {
67
+ this._calibrating = false;
68
+ }
69
+ }
70
+
60
71
  /** map a point in the last screenshot's image space to screen coords. */
61
72
  mapImagePoint(ix: number, iy: number): Point {
62
73
  if (!this.lastShot) {
@@ -83,6 +94,7 @@ export class Session {
83
94
  * the true cursor. Converges to the exact pixel, usually in a single pass.
84
95
  */
85
96
  async moveTo(x: number, y: number): Promise<Point & { passes: number }> {
97
+ await this.ensureCalibrated();
86
98
  let at = await this.client.systemMouse();
87
99
  let passes = 0;
88
100
  while (passes < MOVE_MAX_PASSES) {