deputy-mcp 0.1.1 → 0.1.2
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 +3 -2
- package/dist/deputy-mcp.js +38 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,8 +11,9 @@ codex mcp add deputy -- npx -y deputy-mcp # Codex
|
|
|
11
11
|
|
|
12
12
|
Any other MCP client: run `npx -y deputy-mcp` as a stdio server.
|
|
13
13
|
|
|
14
|
-
Deputy
|
|
15
|
-
|
|
14
|
+
Deputy is free to start: without a key your agent gets 10 tools. [Deputy Pro](https://razin.ai/deputy/)
|
|
15
|
+
adds the other 17 and hosted models; paste its license key on the extension's setup page. The
|
|
16
|
+
open-source version is at [github.com/zraisan/deputy](https://github.com/zraisan/deputy).
|
|
16
17
|
|
|
17
18
|
Several clients can use the same browser at once. The first one to start owns the connection to
|
|
18
19
|
the extension on `127.0.0.1:7331`; later ones share it, and take over if it exits. `DEPUTY_PORT`
|
package/dist/deputy-mcp.js
CHANGED
|
@@ -69306,7 +69306,7 @@ var VISUAL_QUESTION = /\b(colou?rs?|looks?\s+like|images?|pictures?|photos?|char
|
|
|
69306
69306
|
function isVisualQuestion(question) {
|
|
69307
69307
|
return VISUAL_QUESTION.test(question);
|
|
69308
69308
|
}
|
|
69309
|
-
function pixelNote(visual, hasPro) {
|
|
69309
|
+
function pixelNote(visual, hasPro, free = false) {
|
|
69310
69310
|
if (!visual)
|
|
69311
69311
|
return;
|
|
69312
69312
|
const opaque = visual.canvas + visual.unlabeled + visual.svg;
|
|
@@ -69315,7 +69315,7 @@ function pixelNote(visual, hasPro) {
|
|
|
69315
69315
|
visual.unlabeled && `${visual.unlabeled} image${visual.unlabeled > 1 ? "s" : ""} without alt text`,
|
|
69316
69316
|
visual.svg && `${visual.svg} SVG graphic${visual.svg > 1 ? "s" : ""}`
|
|
69317
69317
|
].filter(Boolean).join(", ");
|
|
69318
|
-
const see = `browser_screenshot shows them to you${hasPro ? "; browser_look describes them in text" : ""}`;
|
|
69318
|
+
const see = free ? "Deputy Pro's browser_screenshot and browser_look can see them (https://deputy.razin.ai/buy)" : `browser_screenshot shows them to you${hasPro ? "; browser_look describes them in text" : ""}`;
|
|
69319
69319
|
if (opaque > 0 && visual.textLength < 600 || opaque > 0 && visual.area >= 0.5) {
|
|
69320
69320
|
return `Most of this page is pixels with no text behind them (${parts}, largest ${visual.largest}). Text tools can't read them: ${see}.`;
|
|
69321
69321
|
}
|
|
@@ -69361,6 +69361,19 @@ function hiddenTools(off) {
|
|
|
69361
69361
|
// packages/deputyd/src/core.ts
|
|
69362
69362
|
var EMPTY = new Registry;
|
|
69363
69363
|
var current = null;
|
|
69364
|
+
var FREE_TOOLS = new Set([
|
|
69365
|
+
"browser_capabilities",
|
|
69366
|
+
"browser_invoke",
|
|
69367
|
+
"browser_fill",
|
|
69368
|
+
"browser_click",
|
|
69369
|
+
"browser_read",
|
|
69370
|
+
"browser_navigate",
|
|
69371
|
+
"browser_ask",
|
|
69372
|
+
"delegate_goal",
|
|
69373
|
+
"task_status",
|
|
69374
|
+
"answer_task"
|
|
69375
|
+
]);
|
|
69376
|
+
var onFreeTier = () => current?.free?.() != null;
|
|
69364
69377
|
var NOT_CONNECTED = "Deputy can't reach the browser: the Deputy extension isn't connected. Make sure Chrome is open with " + "the Deputy extension installed and enabled (https://razin.ai/deputy); it connects by itself within a few seconds.";
|
|
69365
69378
|
async function needBrowser() {
|
|
69366
69379
|
if (!await link.ready(1e4))
|
|
@@ -69376,7 +69389,9 @@ function setLink(next) {
|
|
|
69376
69389
|
var servers = new Set;
|
|
69377
69390
|
var toolsOf = new WeakMap;
|
|
69378
69391
|
function accessChanged() {
|
|
69379
|
-
const
|
|
69392
|
+
const off = new Set(hiddenTools(current?.off?.() ?? []));
|
|
69393
|
+
const free = onFreeTier();
|
|
69394
|
+
const hidden = (name) => off.has(name) || free && !FREE_TOOLS.has(name);
|
|
69380
69395
|
for (const ref of servers) {
|
|
69381
69396
|
const server = ref.deref();
|
|
69382
69397
|
if (!server) {
|
|
@@ -69384,9 +69399,9 @@ function accessChanged() {
|
|
|
69384
69399
|
continue;
|
|
69385
69400
|
}
|
|
69386
69401
|
for (const [name, tool] of toolsOf.get(server) ?? []) {
|
|
69387
|
-
if (hidden
|
|
69402
|
+
if (hidden(name) && tool.enabled)
|
|
69388
69403
|
tool.disable();
|
|
69389
|
-
else if (!hidden
|
|
69404
|
+
else if (!hidden(name) && !tool.enabled)
|
|
69390
69405
|
tool.enable();
|
|
69391
69406
|
}
|
|
69392
69407
|
}
|
|
@@ -69426,7 +69441,7 @@ async function activePlanner() {
|
|
|
69426
69441
|
if (!(planner instanceof HeuristicPlanner))
|
|
69427
69442
|
return planner;
|
|
69428
69443
|
const pro = await proConfig();
|
|
69429
|
-
if (!pro.licenseKey || !pro.url)
|
|
69444
|
+
if (!pro.licenseKey || !pro.url || onFreeTier())
|
|
69430
69445
|
return planner;
|
|
69431
69446
|
const id = `${pro.url}|${pro.licenseKey}`;
|
|
69432
69447
|
if (!proPlanners.has(id)) {
|
|
@@ -69592,6 +69607,8 @@ async function pageText(tab) {
|
|
|
69592
69607
|
async function pagePixels(t2) {
|
|
69593
69608
|
if (!t2?.visual)
|
|
69594
69609
|
return;
|
|
69610
|
+
if (onFreeTier())
|
|
69611
|
+
return pixelNote(t2.visual, false, true);
|
|
69595
69612
|
return pixelNote(t2.visual, !!(await proConfig()).licenseKey);
|
|
69596
69613
|
}
|
|
69597
69614
|
async function pageSummary(t2, lead = "Now on") {
|
|
@@ -69617,7 +69634,7 @@ async function pageSummary(t2, lead = "Now on") {
|
|
|
69617
69634
|
})),
|
|
69618
69635
|
actions: actions.slice(0, 25).map((a2) => ({ ref: a2.ref, label: a2.label, kind: a2.kind, ...a2.inputType ? { inputType: a2.inputType } : {} })),
|
|
69619
69636
|
...actions.length > 25 ? { moreActions: `${actions.length - 25} more; narrow with browser_capabilities actionQuery` } : {},
|
|
69620
|
-
howTo: "Page tools are not MCP tools: run one with browser_invoke({ tool, args }). Act on an action with browser_act({ ref, action })."
|
|
69637
|
+
howTo: "Page tools are not MCP tools: run one with browser_invoke({ tool, args }). " + (onFreeTier() ? "Click an action with browser_click({ ref }); set a field with browser_fill({ ref, value })." : "Act on an action with browser_act({ ref, action }).")
|
|
69621
69638
|
}, null, 1);
|
|
69622
69639
|
}
|
|
69623
69640
|
var ALWAYS_LOAD = new Set(["browser_navigate", "browser_invoke", "browser_act", "browser_find", "browser_read", "browser_ask", "browser_screenshot"]);
|
|
@@ -69653,7 +69670,7 @@ var SEARCH_HINTS = {
|
|
|
69653
69670
|
browser_capabilities: "page forms tools actions refs what can I do",
|
|
69654
69671
|
browser_downloads: "download downloaded file saved export csv pdf report"
|
|
69655
69672
|
};
|
|
69656
|
-
var INSTRUCTIONS = "Deputy drives the user's real browser. Start with browser_navigate: its result lists the page's forms as typed tools with JSON Schemas, plus clickable actions with refs. Fill a whole form with ONE " + "browser_invoke call — those page tools are not MCP tools, never search for them. For anything else use " + "browser_act with a ref; every action result says what changed on the page, so you rarely need to check. Read with browser_ask/browser_read/browser_extract; use browser_screenshot only when you must see pixels.";
|
|
69673
|
+
var INSTRUCTIONS = "Deputy drives the user's real browser. Start with browser_navigate: its result lists the page's forms as typed tools with JSON Schemas, plus clickable actions with refs. Fill a whole form with ONE " + "browser_invoke call — those page tools are not MCP tools, never search for them. For anything else use " + "browser_act with a ref; every action result says what changed on the page, so you rarely need to check. Read with browser_ask/browser_read/browser_extract; use browser_screenshot only when you must see pixels. Without Deputy Pro only the free tools are listed: act with browser_click/browser_fill. If the user needs one that is missing (screenshots, tabs, scrolling, console, network and more), Deputy Pro adds it: https://deputy.razin.ai/buy.";
|
|
69657
69674
|
var json = (v2) => text(JSON.stringify(v2, null, 2));
|
|
69658
69675
|
async function runGoal(taskId, goal, tabId) {
|
|
69659
69676
|
await needBrowser();
|
|
@@ -69681,7 +69698,7 @@ async function runGoal(taskId, goal, tabId) {
|
|
|
69681
69698
|
}
|
|
69682
69699
|
}
|
|
69683
69700
|
function buildServer() {
|
|
69684
|
-
const server = new McpServer({ name: "deputy", version: "0.1.
|
|
69701
|
+
const server = new McpServer({ name: "deputy", version: "0.1.2" }, { instructions: INSTRUCTIONS });
|
|
69685
69702
|
const register2 = server.registerTool.bind(server);
|
|
69686
69703
|
const tools = new Map;
|
|
69687
69704
|
server.registerTool = (name, config2, cb) => {
|
|
@@ -70095,7 +70112,7 @@ The tab is on ${tab.title} <${tab.url}>.` : ""}`);
|
|
|
70095
70112
|
const tab = link.registry.resolve(tabId);
|
|
70096
70113
|
const content = await pageText(tab).catch(() => "");
|
|
70097
70114
|
const notes = [
|
|
70098
|
-
isVisualQuestion(question) ?
|
|
70115
|
+
isVisualQuestion(question) ? `This asks how the page looks, which its text can't show: ${onFreeTier() ? "Deputy Pro's browser_screenshot does (https://deputy.razin.ai/buy)" : "browser_screenshot does"}.` : "",
|
|
70099
70116
|
await pagePixels(tab) ?? ""
|
|
70100
70117
|
].filter(Boolean).map((n2) => `[${n2}]`).join(`
|
|
70101
70118
|
`);
|
|
@@ -70595,6 +70612,7 @@ async function startHub() {
|
|
|
70595
70612
|
}
|
|
70596
70613
|
let tabsReported = false;
|
|
70597
70614
|
let locked = null;
|
|
70615
|
+
let free = null;
|
|
70598
70616
|
let off = [];
|
|
70599
70617
|
const readyWaiters = new Set;
|
|
70600
70618
|
const isReady = () => ext !== null && tabsReported;
|
|
@@ -70628,6 +70646,7 @@ async function startHub() {
|
|
|
70628
70646
|
activeTabId: registry2.activeTab()?.tabId ?? null,
|
|
70629
70647
|
extension: ext !== null,
|
|
70630
70648
|
locked,
|
|
70649
|
+
free,
|
|
70631
70650
|
off
|
|
70632
70651
|
});
|
|
70633
70652
|
let notifyTimer;
|
|
@@ -70697,6 +70716,7 @@ async function startHub() {
|
|
|
70697
70716
|
ext = null;
|
|
70698
70717
|
tabsReported = false;
|
|
70699
70718
|
locked = null;
|
|
70719
|
+
free = null;
|
|
70700
70720
|
off = [];
|
|
70701
70721
|
accessChanged();
|
|
70702
70722
|
for (const [id, p2] of pending) {
|
|
@@ -70734,6 +70754,8 @@ async function startHub() {
|
|
|
70734
70754
|
break;
|
|
70735
70755
|
case "license":
|
|
70736
70756
|
locked = msg.ok ? null : msg.message ?? "Deputy needs a Deputy Pro license key.";
|
|
70757
|
+
free = msg.ok && msg.pro === false ? msg.message ?? "" : null;
|
|
70758
|
+
accessChanged();
|
|
70737
70759
|
break;
|
|
70738
70760
|
case "access":
|
|
70739
70761
|
off = parseOff(msg.off);
|
|
@@ -70782,7 +70804,7 @@ async function startHub() {
|
|
|
70782
70804
|
if (!bound)
|
|
70783
70805
|
return null;
|
|
70784
70806
|
return {
|
|
70785
|
-
link: { registry: registry2, call: callExtension, ready, locked: () => locked, off: () => off },
|
|
70807
|
+
link: { registry: registry2, call: callExtension, ready, locked: () => locked, free: () => free, off: () => off },
|
|
70786
70808
|
close: () => new Promise((r2) => {
|
|
70787
70809
|
for (const p2 of peers)
|
|
70788
70810
|
p2.terminate();
|
|
@@ -70804,6 +70826,7 @@ function joinHub() {
|
|
|
70804
70826
|
let opened = false;
|
|
70805
70827
|
let extension2 = false;
|
|
70806
70828
|
let locked = null;
|
|
70829
|
+
let free = null;
|
|
70807
70830
|
let off = [];
|
|
70808
70831
|
const waiters = new Set;
|
|
70809
70832
|
let closeHub;
|
|
@@ -70815,6 +70838,7 @@ function joinHub() {
|
|
|
70815
70838
|
link: {
|
|
70816
70839
|
registry: registry2,
|
|
70817
70840
|
locked: () => locked,
|
|
70841
|
+
free: () => free,
|
|
70818
70842
|
off: () => off,
|
|
70819
70843
|
ready(timeoutMs) {
|
|
70820
70844
|
if (extension2)
|
|
@@ -70865,8 +70889,10 @@ function joinHub() {
|
|
|
70865
70889
|
registry2.reconcile(msg.tabs, msg.activeTabId);
|
|
70866
70890
|
extension2 = msg.extension;
|
|
70867
70891
|
locked = msg.locked ?? null;
|
|
70892
|
+
const nextFree = msg.free ?? null;
|
|
70868
70893
|
const nextOff = msg.off ?? [];
|
|
70869
|
-
if (nextOff.join() !== off.join()) {
|
|
70894
|
+
if (nextFree !== free || nextOff.join() !== off.join()) {
|
|
70895
|
+
free = nextFree;
|
|
70870
70896
|
off = nextOff;
|
|
70871
70897
|
accessChanged();
|
|
70872
70898
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deputy-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"mcpName": "io.github.zraisan/deputy",
|
|
5
|
-
"description": "Deputy's MCP bridge: Claude Code, Codex, Cursor and any MCP client use the pages in your browser as typed tools. Needs the Deputy Chrome extension
|
|
5
|
+
"description": "Deputy's MCP bridge: Claude Code, Codex, Cursor and any MCP client use the pages in your browser as typed tools. Needs the Deputy Chrome extension; free to start, Deputy Pro adds 17 tools and hosted models.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"deputy-mcp": "dist/deputy-mcp.js"
|