@paigy/mcp 0.10.2 → 0.10.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/index.js +7 -2
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
31
31
|
import { execSync } from "child_process";
|
|
32
32
|
import { z } from "zod";
|
|
33
|
+
import qrcode from "qrcode-generator";
|
|
33
34
|
|
|
34
35
|
// src/schema.ts
|
|
35
36
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
@@ -99,7 +100,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
99
100
|
tools: [
|
|
100
101
|
{
|
|
101
102
|
name: "pair",
|
|
102
|
-
description: "Pair this agent with the user's Paigy account (one-time) \u2014 required before notify_user/await_reply work. Two steps: (1) call with NO args to start; it attempts to open the user's browser and returns { verification_uri_complete, user_code, device_code }. That attempt can silently fail in headless/remote environments (no browser to open) \u2014 always show the user verification_uri_complete AND user_code regardless of whether it opened, so they can go there manually and enter the code themselves if needed; ask them to approve. (2) call again passing that device_code to finish; it waits for approval and saves the token. If it returns { status:'pending' }, the user hasn't approved yet \u2014 call again with the same device_code to keep waiting.",
|
|
103
|
+
description: "Pair this agent with the user's Paigy account (one-time) \u2014 required before notify_user/await_reply work. Two steps: (1) call with NO args to start; it attempts to open the user's browser and returns { verification_uri_complete, user_code, device_code, qr }. That open attempt can silently fail in headless/remote environments (no browser to open) \u2014 always show the user verification_uri_complete AND user_code regardless of whether it opened, so they can go there manually and enter the code themselves if needed; ask them to approve. `qr` is a terminal-renderable ASCII QR code of the same link \u2014 a scan-to-pair alternative to opening a browser at all, handy when the user's phone is right there; print it verbatim in a fenced code block. (2) call again passing that device_code to finish; it waits for approval and saves the token. If it returns { status:'pending' }, the user hasn't approved yet \u2014 call again with the same device_code to keep waiting.",
|
|
103
104
|
inputSchema: json(PairSchema)
|
|
104
105
|
},
|
|
105
106
|
{
|
|
@@ -141,6 +142,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
141
142
|
if (!device_code) {
|
|
142
143
|
const code = await requestCode();
|
|
143
144
|
openBrowser(code.verification_uri_complete);
|
|
145
|
+
const qr = qrcode(0, "M");
|
|
146
|
+
qr.addData(code.verification_uri_complete);
|
|
147
|
+
qr.make();
|
|
144
148
|
return {
|
|
145
149
|
content: [{
|
|
146
150
|
type: "text",
|
|
@@ -150,7 +154,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
150
154
|
user_code: code.user_code,
|
|
151
155
|
device_code: code.device_code,
|
|
152
156
|
expires_in: code.expires_in,
|
|
153
|
-
|
|
157
|
+
qr: qr.createASCII(1, 2),
|
|
158
|
+
message: "Show the user verification_uri_complete and user_code (their browser should have opened). If they'd rather scan than switch to a browser themselves, print `qr` verbatim in a fenced code block (monospace, no extra indentation) \u2014 it's a scannable QR code for the same link. After they approve, call pair again with this device_code to finish."
|
|
154
159
|
})
|
|
155
160
|
}]
|
|
156
161
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paigy/mcp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Paigy MCP server — a voice inbox for your AI agents. Lets an agent notify a user and await their reply.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
27
27
|
"@supabase/supabase-js": "^2.47.10",
|
|
28
|
+
"qrcode-generator": "^2.0.4",
|
|
28
29
|
"zod": "^3.24.1",
|
|
29
30
|
"zod-to-json-schema": "^3.24.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/node": "^22.0.0",
|
|
34
|
+
"@types/qrcode-generator": "^1.0.6",
|
|
33
35
|
"tsup": "^8.3.5",
|
|
34
36
|
"typescript": "^5.7.2",
|
|
35
37
|
"vitest": "^2.1.8",
|