passport-bridge 0.5.0

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/bridge.js ADDED
@@ -0,0 +1,223 @@
1
+ import { hostname } from "node:os";
2
+ import { createHash } from "node:crypto";
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
6
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
7
+ import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListResourceTemplatesRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from "@modelcontextprotocol/sdk/types.js";
8
+ // Must move in lockstep with bridge/package.json — the sidecar is deno-compiled
9
+ // and self-contained, so it can't read package.json at runtime to learn this.
10
+ const VERSION = "0.5.0";
11
+ /** Everything but the MCP protocol goes to stderr — stdout is the transport. */
12
+ export function log(...args) {
13
+ process.stderr.write(`[passport-bridge] ${args.join(" ")}\n`);
14
+ }
15
+ function safeHostname() {
16
+ try {
17
+ return hostname();
18
+ }
19
+ catch {
20
+ return "unknown";
21
+ }
22
+ }
23
+ /**
24
+ * Holds the long-lived refresh token and mints short-lived access tokens
25
+ * from the cloud, transparently refreshing on expiry or a 401.
26
+ */
27
+ export class TokenManager {
28
+ endpoint;
29
+ onRotate;
30
+ coordinate;
31
+ origin;
32
+ refreshToken;
33
+ access;
34
+ expiresAt = 0;
35
+ inflight;
36
+ /**
37
+ * @param onRotate persist a rotated refresh token. When provided, the bridge
38
+ * opts into single-use refresh-token rotation; without it (e.g. an env-only
39
+ * credential it can't write back), it tells the server not to rotate.
40
+ * @param coordinate cross-process coordination for a shared profile (Cursor
41
+ * runs one bridge per window): `reload` returns the freshest persisted
42
+ * refresh token, `lock` serializes the exchange across processes. Without
43
+ * them, a sibling process's rotation makes our in-memory token a replay —
44
+ * which the server treats as theft and answers by revoking the family.
45
+ */
46
+ constructor(endpoint, refreshToken, onRotate, coordinate) {
47
+ this.endpoint = endpoint;
48
+ this.onRotate = onRotate;
49
+ this.coordinate = coordinate;
50
+ this.origin = new URL(endpoint).origin;
51
+ this.refreshToken = refreshToken;
52
+ }
53
+ async accessToken(force = false) {
54
+ if (!force && this.access && Date.now() < this.expiresAt - 60_000)
55
+ return this.access;
56
+ // CRITICAL: the refresh token is single-use (it rotates on every exchange),
57
+ // so two concurrent exchanges of the same token look like token THEFT to the
58
+ // server and get the whole credential family revoked. The bridge fans out
59
+ // several requests on startup (connect + the transport's initialize/SSE),
60
+ // each calling accessToken() before the first refresh resolves — so we
61
+ // coalesce them into ONE in-flight exchange and share its result.
62
+ if (this.inflight)
63
+ return this.inflight;
64
+ // Serialize across PROCESSES too: sibling bridges share this profile, and
65
+ // two exchanges of one single-use token get the whole family revoked.
66
+ const run = () => (this.coordinate ? this.coordinate.lock(() => this.exchange()) : this.exchange());
67
+ this.inflight = run().finally(() => {
68
+ this.inflight = undefined;
69
+ });
70
+ return this.inflight;
71
+ }
72
+ async exchange() {
73
+ // Adopt a sibling's rotation before burning anything: the on-disk token is
74
+ // the live one; ours may already be a would-be replay.
75
+ const disk = this.coordinate?.reload();
76
+ if (disk && disk !== this.refreshToken)
77
+ this.refreshToken = disk;
78
+ const res = await fetch(`${this.origin}/api/token`, {
79
+ method: "POST",
80
+ headers: { "content-type": "application/json" },
81
+ // Report host + version so the device shows up in the admin inventory.
82
+ // rotate:false when we can't persist the new credential.
83
+ body: JSON.stringify({ refreshToken: this.refreshToken, host: safeHostname(), version: VERSION, rotate: Boolean(this.onRotate) })
84
+ });
85
+ if (!res.ok)
86
+ throw new Error(`token exchange failed (${res.status}); reconnect this client from the Passport app (or run \`passport-bridge login\`)`);
87
+ const data = (await res.json());
88
+ if (data.refreshToken && data.refreshToken !== this.refreshToken) {
89
+ this.refreshToken = data.refreshToken;
90
+ try {
91
+ this.onRotate?.(data.refreshToken);
92
+ }
93
+ catch {
94
+ /* persisting the rotation is best-effort; the server keeps a grace window */
95
+ }
96
+ }
97
+ this.access = data.accessToken;
98
+ this.expiresAt = Date.now() + data.expiresInSec * 1000;
99
+ return this.access;
100
+ }
101
+ /** fetch wrapper that attaches the current access token and refreshes on 401. */
102
+ authedFetch = async (input, init) => {
103
+ const apply = (token) => {
104
+ const headers = new Headers(init?.headers);
105
+ headers.set("authorization", `Bearer ${token}`);
106
+ return { ...init, headers };
107
+ };
108
+ let res = await fetch(input, apply(await this.accessToken()));
109
+ if (res.status === 401) {
110
+ res = await fetch(input, apply(await this.accessToken(true)));
111
+ }
112
+ return res;
113
+ };
114
+ }
115
+ /**
116
+ * The proxy: a stdio MCP server (what the AI client talks to) that forwards
117
+ * verbatim to the cloud gateway over Streamable HTTP. Tool definitions and
118
+ * arguments pass through unchanged; cancellation and progress are forwarded;
119
+ * a periodic re-list notifies the client when the toolset changes.
120
+ */
121
+ export async function runBridge(endpoint, tokens) {
122
+ const upstream = new Client({ name: "passport-bridge", version: VERSION });
123
+ await upstream.connect(new StreamableHTTPClientTransport(new URL(endpoint), { fetch: tokens.authedFetch }));
124
+ log(`connected to ${endpoint}`);
125
+ // Forward the gateway's own instructions to the AI client — they carry
126
+ // Passport's identity, the governance posture, and (in compact mode) how to
127
+ // use the discovery meta-tools. Without this, bridge clients (Claude Code,
128
+ // Cursor) would only see tool descriptions and miss that context.
129
+ const instructions = upstream.getInstructions();
130
+ // Mirror the gateway's advertised capabilities verbatim: the gateway only
131
+ // declares resources/prompts when a visible app exposes them, and never
132
+ // subscribe/listChanged (it's stateless per request). We copy whatever it
133
+ // said so the local stdio server advertises exactly the same surface.
134
+ const gcaps = upstream.getServerCapabilities();
135
+ const server = new Server({ name: "passport", version: VERSION }, {
136
+ capabilities: {
137
+ tools: { listChanged: true },
138
+ ...(gcaps?.resources ? { resources: gcaps.resources } : {}),
139
+ ...(gcaps?.prompts ? { prompts: gcaps.prompts } : {})
140
+ },
141
+ ...(instructions ? { instructions } : {})
142
+ });
143
+ server.setRequestHandler(ListToolsRequestSchema, async () => upstream.listTools());
144
+ server.setRequestHandler(CallToolRequestSchema, async (req, extra) => {
145
+ const progressToken = req.params._meta?.progressToken;
146
+ return upstream.callTool(req.params, undefined, {
147
+ signal: extra.signal,
148
+ onprogress: progressToken
149
+ ? (progress) => {
150
+ // Best-effort progress passthrough to the downstream client.
151
+ void extra.sendNotification?.({
152
+ method: "notifications/progress",
153
+ params: { ...progress, progressToken }
154
+ });
155
+ }
156
+ : undefined
157
+ });
158
+ });
159
+ // Resources and prompts: verbatim pass-through, zero policy (enforcement lives
160
+ // only in the cloud gateway). Registered ONLY when the gateway advertised the
161
+ // matching capability, so the local server never claims a surface upstream
162
+ // doesn't serve.
163
+ if (gcaps?.resources) {
164
+ server.setRequestHandler(ListResourcesRequestSchema, async (req) => upstream.listResources(req.params));
165
+ server.setRequestHandler(ReadResourceRequestSchema, async (req) => upstream.readResource(req.params));
166
+ server.setRequestHandler(ListResourceTemplatesRequestSchema, async (req) => upstream.listResourceTemplates(req.params));
167
+ }
168
+ if (gcaps?.prompts) {
169
+ server.setRequestHandler(ListPromptsRequestSchema, async (req) => upstream.listPrompts(req.params));
170
+ server.setRequestHandler(GetPromptRequestSchema, async (req) => upstream.getPrompt(req.params));
171
+ }
172
+ await server.connect(new StdioServerTransport());
173
+ log("ready on stdio");
174
+ // Notice toolset changes (admin edits policy, approves an app, a newly
175
+ // connected MCP) and tell the client to re-list — this is what makes new
176
+ // MCPs appear in Claude/Cursor WITHOUT an app restart. Stateless cloud HTTP
177
+ // won't push, so we poll. 15s keeps the wait short enough that a member who
178
+ // just connected an MCP sees it land mid-thought; each poll is one cheap
179
+ // tools/list (~15ms server-side), and the cadence also feeds the device-seen
180
+ // heartbeat (90s tolerance — an upper bound, so faster is strictly safer).
181
+ // The env knob exists mainly so the e2e can run in seconds.
182
+ const pollMs = Math.max(1_000, Number(process.env.PASSPORT_BRIDGE_POLL_MS) || 15_000);
183
+ let lastSignature = await toolSignature(upstream);
184
+ const timer = setInterval(() => {
185
+ void (async () => {
186
+ try {
187
+ const sig = await toolSignature(upstream);
188
+ if (sig !== lastSignature) {
189
+ lastSignature = sig;
190
+ await server.notification({ method: "notifications/tools/list_changed" });
191
+ log("tools changed; notified client");
192
+ }
193
+ }
194
+ catch {
195
+ /* transient; try again next tick */
196
+ }
197
+ })();
198
+ }, pollMs);
199
+ timer.unref?.();
200
+ const shutdown = () => {
201
+ clearInterval(timer);
202
+ void upstream.close().catch(() => { });
203
+ void server.close().catch(() => { });
204
+ process.exit(0);
205
+ };
206
+ process.on("SIGINT", shutdown);
207
+ process.on("SIGTERM", shutdown);
208
+ }
209
+ async function toolSignature(client) {
210
+ const { tools } = await client.listTools();
211
+ // Hash the full visible definitions, not just names: in `apps` discovery mode
212
+ // one meta-tool per app carries the catalog in its DESCRIPTION, so policy
213
+ // changes inside an app (a pass change, tools toggled) alter descriptions
214
+ // while the name set stays identical — a names-only signature missed them and
215
+ // the client's view went stale until an app restart.
216
+ const digest = createHash("sha256");
217
+ for (const t of [...tools].sort((a, b) => a.name.localeCompare(b.name))) {
218
+ digest.update(t.name).update("\0");
219
+ digest.update(t.description ?? "").update("\0");
220
+ digest.update(JSON.stringify(t.inputSchema ?? null)).update("\0");
221
+ }
222
+ return digest.digest("hex");
223
+ }
package/dist/cli.js ADDED
@@ -0,0 +1,182 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ import { getProfile, writeProfile, removeProfile, readCreds, credsPath, withProfileLock } from "./credentials.js";
4
+ import { TokenManager, runBridge, log } from "./bridge.js";
5
+ /**
6
+ * passport-bridge — the local tier.
7
+ *
8
+ * passport-bridge login [--cloud URL] [--client AICLIENT] [--profile NAME] [--target T]
9
+ * passport-bridge serve [--profile NAME] (what AI clients launch)
10
+ * passport-bridge status
11
+ * passport-bridge logout [--profile NAME]
12
+ *
13
+ * `serve` reads its credential from ~/.passport (or PASSPORT_REFRESH_TOKEN +
14
+ * PASSPORT_ENDPOINT), so the AI client's config holds no secret.
15
+ */
16
+ const DEFAULT_CLOUD = process.env.PASSPORT_CLOUD || "http://127.0.0.1:8790";
17
+ function arg(flag, fallback = "") {
18
+ const i = process.argv.indexOf(flag);
19
+ return i >= 0 && process.argv[i + 1] ? process.argv[i + 1] : fallback;
20
+ }
21
+ async function main() {
22
+ const command = process.argv[2] ?? "serve";
23
+ if (command === "serve")
24
+ return serve();
25
+ if (command === "login")
26
+ return login();
27
+ if (command === "logout")
28
+ return logout();
29
+ if (command === "status")
30
+ return status();
31
+ process.stderr.write(`Unknown command: ${command}\nUsage: passport-bridge <login|serve|status|logout>\n`);
32
+ process.exit(1);
33
+ }
34
+ async function serve() {
35
+ const profile = arg("--profile", "default");
36
+ let endpoint = process.env.PASSPORT_ENDPOINT ?? "";
37
+ let refreshToken = process.env.PASSPORT_REFRESH_TOKEN ?? "";
38
+ let fromProfile = false;
39
+ if (!refreshToken || !endpoint) {
40
+ const saved = getProfile(profile);
41
+ if (!saved) {
42
+ log(`no credential for profile "${profile}". Run: passport-bridge login --profile ${profile}`);
43
+ process.exit(1);
44
+ }
45
+ endpoint = saved.endpoint;
46
+ refreshToken = saved.refreshToken;
47
+ fromProfile = true;
48
+ }
49
+ // Persist rotated refresh tokens back to the profile (file-backed only). An
50
+ // env-supplied credential can't be written back, so it opts out of rotation.
51
+ const onRotate = fromProfile ? (next) => writeProfile(profile, { refreshToken: next, endpoint }) : undefined;
52
+ // File-backed profiles can be shared by several live bridges (Cursor runs
53
+ // one per window) — coordinate exchanges through the profile file + lock so
54
+ // a sibling's rotation is adopted instead of replayed.
55
+ const coordinate = fromProfile
56
+ ? {
57
+ reload: () => getProfile(profile)?.refreshToken,
58
+ lock: (fn) => withProfileLock(profile, fn)
59
+ }
60
+ : undefined;
61
+ try {
62
+ await runBridge(endpoint, new TokenManager(endpoint, refreshToken, onRotate, coordinate));
63
+ }
64
+ catch (error) {
65
+ log(error instanceof Error ? error.message : String(error));
66
+ process.exit(1);
67
+ }
68
+ }
69
+ async function login() {
70
+ const cloud = arg("--cloud", DEFAULT_CLOUD).replace(/\/$/, "");
71
+ const profile = arg("--profile", "default");
72
+ const target = arg("--target", "workspace");
73
+ // The AI client this credential is for (claude-code, cursor, …). Defaults to
74
+ // the profile name for back-compat; the install instructions always pass it
75
+ // explicitly so the gateway labels the device and applies policy correctly.
76
+ const client = arg("--client", profile);
77
+ // Which workspace to sign into. A multi-tenant cloud with the demo off can't
78
+ // resolve a tenant from a bare device/start (there's no session yet), so the
79
+ // install instructions always pass this; the whole approve chain stays in it.
80
+ const workspace = arg("--workspace", "");
81
+ const out = (s) => process.stdout.write(s + "\n");
82
+ const ws = workspace ? `?ws=${encodeURIComponent(workspace)}` : "";
83
+ const start = await fetch(`${cloud}/api/auth/device/start${ws}`, { method: "POST" });
84
+ if (start.status === 404) {
85
+ throw new Error(`Passport at ${cloud} couldn't find your workspace. Ask your admin for your workspace id and run: passport-bridge login --cloud ${cloud} --workspace <ws_id>`);
86
+ }
87
+ if (!start.ok)
88
+ throw new Error(`Couldn't reach Passport at ${cloud}`);
89
+ const { code, userCode, verifyUrl } = (await start.json());
90
+ out("");
91
+ out(" Sign in to Passport");
92
+ out(` 1. Open: ${verifyUrl}`);
93
+ out(` 2. Confirm the code: ${userCode}`);
94
+ out("");
95
+ out(" Waiting for approval…");
96
+ openBrowser(verifyUrl);
97
+ const deadline = Date.now() + 10 * 60 * 1000;
98
+ let sessionToken = "";
99
+ while (Date.now() < deadline) {
100
+ await sleep(1500);
101
+ const poll = await fetch(`${cloud}/api/auth/device/poll`, {
102
+ method: "POST",
103
+ headers: { "content-type": "application/json" },
104
+ body: JSON.stringify({ code })
105
+ });
106
+ const result = (await poll.json());
107
+ if (result.status === "approved" && result.token) {
108
+ sessionToken = result.token;
109
+ break;
110
+ }
111
+ if (result.status === "denied" || result.status === "expired") {
112
+ throw new Error(`Sign-in ${result.status}.`);
113
+ }
114
+ }
115
+ if (!sessionToken)
116
+ throw new Error("Timed out waiting for approval.");
117
+ const cred = await fetch(`${cloud}/api/my/bridge-credential`, {
118
+ method: "POST",
119
+ headers: { "content-type": "application/json", authorization: `Bearer ${sessionToken}` },
120
+ body: JSON.stringify({ client, target })
121
+ });
122
+ if (!cred.ok)
123
+ throw new Error("Couldn't get a credential. Is your account active?");
124
+ const { refreshToken, endpoint } = (await cred.json());
125
+ writeProfile(profile, { refreshToken, endpoint });
126
+ out("");
127
+ out(` ✓ Signed in. Saved profile "${profile}" to ${credsPath()}`);
128
+ out(` Now point your AI app at: passport-bridge serve --profile ${profile}`);
129
+ out("");
130
+ }
131
+ async function status() {
132
+ const creds = readCreds();
133
+ const names = Object.keys(creds);
134
+ if (names.length === 0) {
135
+ process.stdout.write("No profiles. Run: passport-bridge login\n");
136
+ return;
137
+ }
138
+ for (const name of names) {
139
+ const { endpoint, refreshToken } = creds[name];
140
+ let state = "ok";
141
+ try {
142
+ await new TokenManager(endpoint, refreshToken).accessToken(true);
143
+ }
144
+ catch {
145
+ state = "needs re-login";
146
+ }
147
+ process.stdout.write(` ${name}: ${endpoint} (${state})\n`);
148
+ }
149
+ }
150
+ async function logout() {
151
+ const profile = arg("--profile", "default");
152
+ const existing = removeProfile(profile);
153
+ if (existing) {
154
+ const origin = new URL(existing.endpoint).origin;
155
+ await fetch(`${origin}/api/token/revoke`, {
156
+ method: "POST",
157
+ headers: { "content-type": "application/json" },
158
+ body: JSON.stringify({ refreshToken: existing.refreshToken })
159
+ }).catch(() => { });
160
+ process.stdout.write(`Signed out profile "${profile}".\n`);
161
+ }
162
+ else {
163
+ process.stdout.write(`No profile "${profile}".\n`);
164
+ }
165
+ }
166
+ function openBrowser(url) {
167
+ const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
168
+ const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
169
+ try {
170
+ spawn(cmd, args, { stdio: "ignore", detached: true }).unref();
171
+ }
172
+ catch {
173
+ /* user can open it manually */
174
+ }
175
+ }
176
+ function sleep(ms) {
177
+ return new Promise((resolve) => setTimeout(resolve, ms));
178
+ }
179
+ main().catch((error) => {
180
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
181
+ process.exit(1);
182
+ });
@@ -0,0 +1,98 @@
1
+ import { homedir } from "node:os";
2
+ import { join } from "node:path";
3
+ import { mkdirSync, readFileSync, writeFileSync, existsSync, chmodSync, rmSync, statSync } from "node:fs";
4
+ function dir() {
5
+ return process.env.PASSPORT_HOME || join(homedir(), ".passport");
6
+ }
7
+ function file() {
8
+ return join(dir(), "credentials.json");
9
+ }
10
+ export function readCreds() {
11
+ try {
12
+ return JSON.parse(readFileSync(file(), "utf8"));
13
+ }
14
+ catch {
15
+ return {};
16
+ }
17
+ }
18
+ export function getProfile(name) {
19
+ return readCreds()[name];
20
+ }
21
+ export function writeProfile(name, profile) {
22
+ mkdirSync(dir(), { recursive: true });
23
+ const creds = readCreds();
24
+ creds[name] = profile;
25
+ const tmp = `${file()}.tmp`;
26
+ writeFileSync(tmp, JSON.stringify(creds, null, 2), { mode: 0o600 });
27
+ writeFileSync(file(), JSON.stringify(creds, null, 2), { mode: 0o600 });
28
+ try {
29
+ chmodSync(file(), 0o600);
30
+ }
31
+ catch {
32
+ /* best effort on platforms without chmod */
33
+ }
34
+ if (existsSync(tmp)) {
35
+ try {
36
+ // tmp was a belt-and-suspenders write; remove it
37
+ writeFileSync(tmp, "");
38
+ }
39
+ catch {
40
+ /* ignore */
41
+ }
42
+ }
43
+ }
44
+ export function removeProfile(name) {
45
+ const creds = readCreds();
46
+ const existing = creds[name];
47
+ delete creds[name];
48
+ mkdirSync(dir(), { recursive: true });
49
+ writeFileSync(file(), JSON.stringify(creds, null, 2), { mode: 0o600 });
50
+ return existing;
51
+ }
52
+ export function credsPath() {
53
+ return file();
54
+ }
55
+ /**
56
+ * Cross-process mutex for a profile's token exchange. The refresh token is
57
+ * single-use (it rotates on every exchange), and one profile can back several
58
+ * live bridge processes at once — Cursor spawns one MCP process per window —
59
+ * so exchanges must serialize ACROSS processes, not just within one. mkdir is
60
+ * atomic on every platform; a lock older than STALE_MS belongs to a dead
61
+ * process and is stolen. Waiting longer than the patience window proceeds
62
+ * anyway — a missed lock at worst recreates today's race; a deadlock would
63
+ * take the client's tools away entirely.
64
+ */
65
+ const LOCK_STALE_MS = 30_000;
66
+ const LOCK_PATIENCE_MS = 15_000;
67
+ export async function withProfileLock(name, fn) {
68
+ const lockDir = join(dir(), `${name}.lock`);
69
+ mkdirSync(dir(), { recursive: true });
70
+ const started = Date.now();
71
+ for (;;) {
72
+ try {
73
+ mkdirSync(lockDir);
74
+ break; // acquired
75
+ }
76
+ catch {
77
+ try {
78
+ const age = Date.now() - statSync(lockDir).mtimeMs;
79
+ if (age > LOCK_STALE_MS) {
80
+ rmSync(lockDir, { recursive: true, force: true });
81
+ continue;
82
+ }
83
+ }
84
+ catch {
85
+ continue; // lock vanished between attempts — retry immediately
86
+ }
87
+ if (Date.now() - started > LOCK_PATIENCE_MS)
88
+ break; // proceed unlocked
89
+ await new Promise((r) => setTimeout(r, 100 + Math.floor(Math.random() * 100)));
90
+ }
91
+ }
92
+ try {
93
+ return await fn();
94
+ }
95
+ finally {
96
+ rmSync(lockDir, { recursive: true, force: true });
97
+ }
98
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "passport-bridge",
3
+ "version": "0.5.0",
4
+ "description": "Local stdio↔cloud proxy for MCP Passport — brokers a credential so no token lands in an AI client's config.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/rsyed94/passport-releases.git"
9
+ },
10
+ "homepage": "https://passportmcp.com",
11
+ "keywords": ["mcp", "model-context-protocol", "gateway", "bridge", "stdio"],
12
+ "type": "module",
13
+ "bin": {
14
+ "passport-bridge": "./dist/cli.js"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc -p tsconfig.json",
24
+ "typecheck": "tsc --noEmit",
25
+ "dev": "tsx src/cli.ts",
26
+ "e2e": "tsx scripts/e2e.ts",
27
+ "e2e:reconnect": "tsx scripts/reconnect-bug-e2e.ts",
28
+ "prepublishOnly": "npm run build"
29
+ },
30
+ "dependencies": {
31
+ "@modelcontextprotocol/sdk": "^1.29.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^24.10.1",
35
+ "tsx": "^4.20.6",
36
+ "typescript": "^5.9.3"
37
+ }
38
+ }