@zhihand/mcp 0.12.1 → 0.12.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/dist/core/pair.js CHANGED
@@ -70,7 +70,7 @@ export async function waitForPairingClaim(endpoint, sessionId, timeoutMs = 600_0
70
70
  throw new Error("Pairing timeout.");
71
71
  }
72
72
  export async function renderPairingQRCode(url) {
73
- return QRCode.toString(url, { type: "utf8", margin: 1 });
73
+ return QRCode.toString(url, { type: "utf8", margin: 2 });
74
74
  }
75
75
  export async function executePairing(endpoint, edgeId, deviceName) {
76
76
  // Step 0: Register plugin first — server requires a known edge_id before pairing.
@@ -90,6 +90,12 @@ export async function executePairing(endpoint, edgeId, deviceName) {
90
90
  status: "pending",
91
91
  expiresAt: session.expires_at,
92
92
  });
93
+ // Display QR code and pairing URL
94
+ const qr = await renderPairingQRCode(session.pair_url);
95
+ console.log(qr);
96
+ console.log(`Open this URL on your phone to pair:\n ${session.pair_url}\n`);
97
+ console.log(`Expires at: ${session.expires_at}`);
98
+ console.log("Waiting for phone to scan...\n");
93
99
  // Wait for phone to scan
94
100
  const claimed = await waitForPairingClaim(endpoint, session.id);
95
101
  const credential = {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { controlSchema, screenshotSchema, pairSchema } from "./tools/schemas.js"
5
5
  import { executeControl } from "./tools/control.js";
6
6
  import { handleScreenshot } from "./tools/screenshot.js";
7
7
  import { handlePair } from "./tools/pair.js";
8
- const PACKAGE_VERSION = "0.12.1";
8
+ const PACKAGE_VERSION = "0.12.3";
9
9
  export function createServer(deviceName) {
10
10
  const server = new McpServer({
11
11
  name: "zhihand",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhihand/mcp",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "ZhiHand MCP Server — phone control tools for Claude Code, Codex, Gemini CLI, and OpenClaw",