@anvailabs/agentbrowser-mcp 1.7.0 → 1.7.1
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 +17 -6
- package/dist/bin.js +78 -7
- package/dist/index.js +61 -7
- package/dist/mcp-server.d.ts +13 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +72 -7
- package/dist/mcp-server.js.map +1 -1
- package/package.json +17 -16
- package/LICENSE +0 -201
package/README.md
CHANGED
|
@@ -17,18 +17,28 @@ input — are deliberately not exposed.
|
|
|
17
17
|
|
|
18
18
|
| Tool | Purpose |
|
|
19
19
|
|---|---|
|
|
20
|
-
| `browser_create` | Create an isolated session (also creates the first page) |
|
|
20
|
+
| `browser_create` | Create an isolated session (also creates the first page; accepts seed cookies for authenticated re-entry) |
|
|
21
21
|
| `browser_close` | Close a session, invalidating its refs |
|
|
22
22
|
| `browser_navigate` | Navigate a page to an http(s) URL |
|
|
23
|
-
| `browser_observe` | Semantic
|
|
24
|
-
| `
|
|
23
|
+
| `browser_observe` | Semantic observation with stable element refs (`e<revision>_<ordinal>`) |
|
|
24
|
+
| `browser_snapshot` | Self-contained page payload (url, title, revision, mode, `fields`) — one call to plan a whole form |
|
|
25
|
+
| `browser_plan` | Execute an ordered batch of fill/click/press/scroll steps in one call; stale refs self-heal, with a role+label guard under churn |
|
|
26
|
+
| `browser_act` | click / fill / select / scroll / press / dialogs — by ref, never by selector |
|
|
27
|
+
| `browser_extract` | Structured page extraction |
|
|
25
28
|
| `browser_screenshot` | Capture optional visual evidence |
|
|
29
|
+
| `browser_pdf` | Page-to-PDF capture |
|
|
30
|
+
| `browser_cookies` | Export session cookies — persist and seed `browser_create` to re-enter an authenticated session |
|
|
31
|
+
|
|
32
|
+
The fast path for multi-field forms is `browser_snapshot` → `browser_plan`:
|
|
33
|
+
one call to read the page, one call to act on it — see the
|
|
34
|
+
[main README](../../README.md#the-fast-path-for-forms-snapshot-then-plan).
|
|
26
35
|
|
|
27
36
|
## Running it
|
|
28
37
|
|
|
29
38
|
### Release consumers: the single binary (recommended)
|
|
30
39
|
|
|
31
|
-
Download `agentbrowser-mcp-<target>` from the
|
|
40
|
+
Download `agentbrowser-mcp-<target>` from the
|
|
41
|
+
[GitHub releases](https://github.com/anvai-labs/agentbrowser/releases)
|
|
32
42
|
(verify against `sha256sums.txt`), then point any MCP client at it — no Node,
|
|
33
43
|
no pnpm, no repo checkout:
|
|
34
44
|
|
|
@@ -43,7 +53,7 @@ mcpServers:
|
|
|
43
53
|
|
|
44
54
|
The binary is **only the MCP adapter** (TD-BROWSER-5 scope boundary): it needs
|
|
45
55
|
a reachable AgentBrowser server over `AGENTBROWSER_BASE_URL` for anything
|
|
46
|
-
beyond the protocol handshake. Deploy the server once (
|
|
56
|
+
beyond the protocol handshake. Deploy the server once (release tarball, or
|
|
47
57
|
`node packages/api/dist/bin.js`); every consumer process spawns the binary.
|
|
48
58
|
|
|
49
59
|
### Development: from the workspace
|
|
@@ -58,13 +68,14 @@ node packages/mcp-server/dist/bin.js
|
|
|
58
68
|
| Variable | Meaning |
|
|
59
69
|
|---|---|
|
|
60
70
|
| `AGENTBROWSER_BASE_URL` | AgentBrowser server to proxy to (default `http://localhost:3000`) |
|
|
71
|
+
| `AGENTBROWSER_API_KEY` | Bearer key for the service, when it has `AGENTBROWSER_API_KEYS` configured |
|
|
61
72
|
| `AGENTBROWSER_MCP_VERSION` | Override the reported `serverInfo.version` (debugging; the binary is otherwise stamped at build time from `package.json`) |
|
|
62
73
|
|
|
63
74
|
## Building and gating the binary
|
|
64
75
|
|
|
65
76
|
```sh
|
|
66
77
|
pnpm --filter @anvailabs/agentbrowser-mcp compile # -> dist-bin/agentbrowser-mcp (needs bun)
|
|
67
|
-
pnpm --filter @anvailabs/agentbrowser-mcp smoke # stdio handshake +
|
|
78
|
+
pnpm --filter @anvailabs/agentbrowser-mcp smoke # stdio handshake + full tool-catalog gate
|
|
68
79
|
```
|
|
69
80
|
|
|
70
81
|
Cross-compile with `node scripts/compile.mjs --target=bun-linux-arm64 --outfile=...`.
|
package/dist/bin.js
CHANGED
|
@@ -93,6 +93,23 @@ var SessionsClient = class {
|
|
|
93
93
|
const body = await this.handleResponse(response);
|
|
94
94
|
return body.cookies;
|
|
95
95
|
}
|
|
96
|
+
/** TD-BROWSER-8: execute a batched action plan; returns per-step results. */
|
|
97
|
+
async plan(sessionId, pageId, actions) {
|
|
98
|
+
const response = await this.requestFn(`${this.baseUrl}/v1/sessions/${sessionId}/pages/${pageId}/plan`, {
|
|
99
|
+
method: "POST",
|
|
100
|
+
headers: {
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
...this.headers
|
|
103
|
+
},
|
|
104
|
+
body: JSON.stringify({ actions })
|
|
105
|
+
});
|
|
106
|
+
return this.handleResponse(response);
|
|
107
|
+
}
|
|
108
|
+
/** TD-BROWSER-8: self-contained snapshot payload for one-shot LLM reasoning. */
|
|
109
|
+
async snapshot(sessionId, pageId) {
|
|
110
|
+
const response = await this.requestFn(`${this.baseUrl}/v1/sessions/${sessionId}/pages/${pageId}/snapshot`, { headers: this.headers });
|
|
111
|
+
return this.handleResponse(response);
|
|
112
|
+
}
|
|
96
113
|
async navigate(sessionId, pageId, request) {
|
|
97
114
|
const response = await this.requestFn(`${this.baseUrl}/v1/sessions/${sessionId}/pages/${pageId}/navigate`, {
|
|
98
115
|
method: "POST",
|
|
@@ -2959,7 +2976,13 @@ function buildMcpServer(deps) {
|
|
|
2959
2976
|
const client = deps.createClient({ baseUrl: deps.baseUrl ?? "http://localhost:3000" });
|
|
2960
2977
|
const serverInfo = deps.serverInfo ?? { name: "agentbrowser", version: "1.0.0" };
|
|
2961
2978
|
const sessionAndPage = (args) => {
|
|
2962
|
-
|
|
2979
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
2980
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
2981
|
+
}
|
|
2982
|
+
if (typeof args.pageId !== "string" || args.pageId.length === 0) {
|
|
2983
|
+
throw new UsageError("pageId is required and must be a non-empty string.");
|
|
2984
|
+
}
|
|
2985
|
+
return [args.sessionId, args.pageId];
|
|
2963
2986
|
};
|
|
2964
2987
|
const tools = [
|
|
2965
2988
|
{
|
|
@@ -2994,7 +3017,10 @@ function buildMcpServer(deps) {
|
|
|
2994
3017
|
required: ["tenantId"]
|
|
2995
3018
|
},
|
|
2996
3019
|
handler: async (args) => {
|
|
2997
|
-
|
|
3020
|
+
if (typeof args.tenantId !== "string" || args.tenantId.length === 0) {
|
|
3021
|
+
throw new UsageError("tenantId is required and must be a non-empty string.");
|
|
3022
|
+
}
|
|
3023
|
+
const request = { tenantId: args.tenantId };
|
|
2998
3024
|
if (typeof args.engine === "string")
|
|
2999
3025
|
request.engine = args.engine;
|
|
3000
3026
|
if (typeof args.headless === "boolean")
|
|
@@ -3017,9 +3043,51 @@ function buildMcpServer(deps) {
|
|
|
3017
3043
|
required: ["sessionId"]
|
|
3018
3044
|
},
|
|
3019
3045
|
handler: async (args) => {
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3046
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
3047
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
3048
|
+
}
|
|
3049
|
+
const cookies = await client.sessions.cookies(args.sessionId);
|
|
3050
|
+
return { sessionId: args.sessionId, cookies };
|
|
3051
|
+
}
|
|
3052
|
+
},
|
|
3053
|
+
{
|
|
3054
|
+
name: "browser_snapshot",
|
|
3055
|
+
description: "Get a self-contained page snapshot for one-shot plan construction (TD-BROWSER-8): url, title, revision, an adaptive `mode` (stable|verified - verified means recent ref churn was detected and browser_plan will require a stricter role+label match before self-healing a stale ref), and fields ({ref, role, label}) to address in a browser_plan call. Prefer browser_snapshot + browser_plan over repeated browser_observe/browser_act round-trips when filling multi-field forms.",
|
|
3056
|
+
inputSchema: {
|
|
3057
|
+
type: "object",
|
|
3058
|
+
properties: {
|
|
3059
|
+
sessionId: { type: "string" },
|
|
3060
|
+
pageId: { type: "string" }
|
|
3061
|
+
},
|
|
3062
|
+
required: ["sessionId", "pageId"]
|
|
3063
|
+
},
|
|
3064
|
+
handler: async (args) => {
|
|
3065
|
+
const [sessionId, pageId] = sessionAndPage(args);
|
|
3066
|
+
return await client.sessions.snapshot(sessionId, pageId);
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
{
|
|
3070
|
+
name: "browser_plan",
|
|
3071
|
+
description: "Execute a batched action plan in one call (TD-BROWSER-8). Each action: {action: fill|click|press|scroll, target?: {ref}, value?, key?}. Steps run sequentially; the first hard failure aborts with per-step results. Best paired with browser_snapshot: address refs from its `fields` in one round trip.",
|
|
3072
|
+
inputSchema: {
|
|
3073
|
+
type: "object",
|
|
3074
|
+
properties: {
|
|
3075
|
+
sessionId: { type: "string" },
|
|
3076
|
+
pageId: { type: "string" },
|
|
3077
|
+
actions: {
|
|
3078
|
+
type: "array",
|
|
3079
|
+
description: "Ordered plan steps: {action, target?: {ref}, value?, key?}",
|
|
3080
|
+
items: { type: "object" }
|
|
3081
|
+
}
|
|
3082
|
+
},
|
|
3083
|
+
required: ["sessionId", "pageId", "actions"]
|
|
3084
|
+
},
|
|
3085
|
+
handler: async (args) => {
|
|
3086
|
+
const [sessionId, pageId] = sessionAndPage(args);
|
|
3087
|
+
if (!Array.isArray(args.actions)) {
|
|
3088
|
+
throw new UsageError("actions is required and must be an array of plan steps.");
|
|
3089
|
+
}
|
|
3090
|
+
return await client.sessions.plan(sessionId, pageId, args.actions);
|
|
3023
3091
|
}
|
|
3024
3092
|
},
|
|
3025
3093
|
{
|
|
@@ -3031,8 +3099,11 @@ function buildMcpServer(deps) {
|
|
|
3031
3099
|
required: ["sessionId"]
|
|
3032
3100
|
},
|
|
3033
3101
|
handler: async (args) => {
|
|
3034
|
-
|
|
3035
|
-
|
|
3102
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
3103
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
3104
|
+
}
|
|
3105
|
+
await client.sessions.close(args.sessionId);
|
|
3106
|
+
return { sessionId: args.sessionId, closed: true };
|
|
3036
3107
|
}
|
|
3037
3108
|
},
|
|
3038
3109
|
{
|
package/dist/index.js
CHANGED
|
@@ -2743,7 +2743,13 @@ function buildMcpServer(deps) {
|
|
|
2743
2743
|
const client = deps.createClient({ baseUrl: deps.baseUrl ?? "http://localhost:3000" });
|
|
2744
2744
|
const serverInfo = deps.serverInfo ?? { name: "agentbrowser", version: "1.0.0" };
|
|
2745
2745
|
const sessionAndPage = (args) => {
|
|
2746
|
-
|
|
2746
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
2747
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
2748
|
+
}
|
|
2749
|
+
if (typeof args.pageId !== "string" || args.pageId.length === 0) {
|
|
2750
|
+
throw new UsageError("pageId is required and must be a non-empty string.");
|
|
2751
|
+
}
|
|
2752
|
+
return [args.sessionId, args.pageId];
|
|
2747
2753
|
};
|
|
2748
2754
|
const tools = [
|
|
2749
2755
|
{
|
|
@@ -2778,7 +2784,10 @@ function buildMcpServer(deps) {
|
|
|
2778
2784
|
required: ["tenantId"]
|
|
2779
2785
|
},
|
|
2780
2786
|
handler: async (args) => {
|
|
2781
|
-
|
|
2787
|
+
if (typeof args.tenantId !== "string" || args.tenantId.length === 0) {
|
|
2788
|
+
throw new UsageError("tenantId is required and must be a non-empty string.");
|
|
2789
|
+
}
|
|
2790
|
+
const request = { tenantId: args.tenantId };
|
|
2782
2791
|
if (typeof args.engine === "string")
|
|
2783
2792
|
request.engine = args.engine;
|
|
2784
2793
|
if (typeof args.headless === "boolean")
|
|
@@ -2801,9 +2810,51 @@ function buildMcpServer(deps) {
|
|
|
2801
2810
|
required: ["sessionId"]
|
|
2802
2811
|
},
|
|
2803
2812
|
handler: async (args) => {
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2813
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
2814
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
2815
|
+
}
|
|
2816
|
+
const cookies = await client.sessions.cookies(args.sessionId);
|
|
2817
|
+
return { sessionId: args.sessionId, cookies };
|
|
2818
|
+
}
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
name: "browser_snapshot",
|
|
2822
|
+
description: "Get a self-contained page snapshot for one-shot plan construction (TD-BROWSER-8): url, title, revision, an adaptive `mode` (stable|verified - verified means recent ref churn was detected and browser_plan will require a stricter role+label match before self-healing a stale ref), and fields ({ref, role, label}) to address in a browser_plan call. Prefer browser_snapshot + browser_plan over repeated browser_observe/browser_act round-trips when filling multi-field forms.",
|
|
2823
|
+
inputSchema: {
|
|
2824
|
+
type: "object",
|
|
2825
|
+
properties: {
|
|
2826
|
+
sessionId: { type: "string" },
|
|
2827
|
+
pageId: { type: "string" }
|
|
2828
|
+
},
|
|
2829
|
+
required: ["sessionId", "pageId"]
|
|
2830
|
+
},
|
|
2831
|
+
handler: async (args) => {
|
|
2832
|
+
const [sessionId, pageId] = sessionAndPage(args);
|
|
2833
|
+
return await client.sessions.snapshot(sessionId, pageId);
|
|
2834
|
+
}
|
|
2835
|
+
},
|
|
2836
|
+
{
|
|
2837
|
+
name: "browser_plan",
|
|
2838
|
+
description: "Execute a batched action plan in one call (TD-BROWSER-8). Each action: {action: fill|click|press|scroll, target?: {ref}, value?, key?}. Steps run sequentially; the first hard failure aborts with per-step results. Best paired with browser_snapshot: address refs from its `fields` in one round trip.",
|
|
2839
|
+
inputSchema: {
|
|
2840
|
+
type: "object",
|
|
2841
|
+
properties: {
|
|
2842
|
+
sessionId: { type: "string" },
|
|
2843
|
+
pageId: { type: "string" },
|
|
2844
|
+
actions: {
|
|
2845
|
+
type: "array",
|
|
2846
|
+
description: "Ordered plan steps: {action, target?: {ref}, value?, key?}",
|
|
2847
|
+
items: { type: "object" }
|
|
2848
|
+
}
|
|
2849
|
+
},
|
|
2850
|
+
required: ["sessionId", "pageId", "actions"]
|
|
2851
|
+
},
|
|
2852
|
+
handler: async (args) => {
|
|
2853
|
+
const [sessionId, pageId] = sessionAndPage(args);
|
|
2854
|
+
if (!Array.isArray(args.actions)) {
|
|
2855
|
+
throw new UsageError("actions is required and must be an array of plan steps.");
|
|
2856
|
+
}
|
|
2857
|
+
return await client.sessions.plan(sessionId, pageId, args.actions);
|
|
2807
2858
|
}
|
|
2808
2859
|
},
|
|
2809
2860
|
{
|
|
@@ -2815,8 +2866,11 @@ function buildMcpServer(deps) {
|
|
|
2815
2866
|
required: ["sessionId"]
|
|
2816
2867
|
},
|
|
2817
2868
|
handler: async (args) => {
|
|
2818
|
-
|
|
2819
|
-
|
|
2869
|
+
if (typeof args.sessionId !== "string" || args.sessionId.length === 0) {
|
|
2870
|
+
throw new UsageError("sessionId is required and must be a non-empty string.");
|
|
2871
|
+
}
|
|
2872
|
+
await client.sessions.close(args.sessionId);
|
|
2873
|
+
return { sessionId: args.sessionId, closed: true };
|
|
2820
2874
|
}
|
|
2821
2875
|
},
|
|
2822
2876
|
{
|
package/dist/mcp-server.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* The message handler is pure: it takes a JSON-RPC line and returns a
|
|
9
9
|
* JSON-RPC line (or null for notifications), so any transport can drive it.
|
|
10
10
|
*/
|
|
11
|
-
import type { ActionRequest, ActionResult, ArtifactRef, ClientOptions, ExportedCookie, ExtractRequest, ExtractResult, NavigationRequest, NavigationResponse, ObservationRequest, ObservationResponse, PageResponse, PdfRequest, ScreenshotRequest, SessionRequest, SessionResponse } from '@agentbrowser/sdk-typescript';
|
|
11
|
+
import type { ActionRequest, ActionResult, ArtifactRef, ClientOptions, ExportedCookie, ExtractRequest, ExtractResult, NavigationRequest, NavigationResponse, ObservationRequest, ObservationResponse, PageResponse, PageSnapshot, PdfRequest, ScreenshotRequest, SessionRequest, SessionResponse } from '@agentbrowser/sdk-typescript';
|
|
12
12
|
export type { ClientOptions, ExportedCookie };
|
|
13
13
|
/** The slice of the SDK the MCP server depends on. */
|
|
14
14
|
export interface McpClient {
|
|
@@ -17,6 +17,18 @@ export interface McpClient {
|
|
|
17
17
|
close(sessionId: string): Promise<void>;
|
|
18
18
|
/** TD-BROWSER-6: scoped cookie export for the credential handoff loop. */
|
|
19
19
|
cookies(sessionId: string): Promise<ExportedCookie[]>;
|
|
20
|
+
plan(sessionId: string, pageId: string, actions: Array<Record<string, unknown>>): Promise<{
|
|
21
|
+
ok: boolean;
|
|
22
|
+
completed: number;
|
|
23
|
+
results: Array<{
|
|
24
|
+
step: number;
|
|
25
|
+
ok: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
}>;
|
|
28
|
+
mode?: string;
|
|
29
|
+
}>;
|
|
30
|
+
/** TD-BROWSER-8: self-contained snapshot payload for one-shot LLM reasoning. */
|
|
31
|
+
snapshot(sessionId: string, pageId: string): Promise<PageSnapshot>;
|
|
20
32
|
createPage(sessionId: string): Promise<PageResponse>;
|
|
21
33
|
navigate(sessionId: string, pageId: string, request: NavigationRequest): Promise<NavigationResponse>;
|
|
22
34
|
observe(sessionId: string, pageId: string, request: ObservationRequest): Promise<ObservationResponse>;
|
package/dist/mcp-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAE9C,sDAAsD;AACtD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AI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,mEAAmE;IACnE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC9C;AAcD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAgd/D"}
|
package/dist/mcp-server.js
CHANGED
|
@@ -19,7 +19,13 @@ export function buildMcpServer(deps) {
|
|
|
19
19
|
const client = deps.createClient({ baseUrl: deps.baseUrl ?? 'http://localhost:3000' });
|
|
20
20
|
const serverInfo = deps.serverInfo ?? { name: 'agentbrowser', version: '1.0.0' };
|
|
21
21
|
const sessionAndPage = (args) => {
|
|
22
|
-
|
|
22
|
+
if (typeof args.sessionId !== 'string' || args.sessionId.length === 0) {
|
|
23
|
+
throw new UsageError('sessionId is required and must be a non-empty string.');
|
|
24
|
+
}
|
|
25
|
+
if (typeof args.pageId !== 'string' || args.pageId.length === 0) {
|
|
26
|
+
throw new UsageError('pageId is required and must be a non-empty string.');
|
|
27
|
+
}
|
|
28
|
+
return [args.sessionId, args.pageId];
|
|
23
29
|
};
|
|
24
30
|
const tools = [
|
|
25
31
|
{
|
|
@@ -57,7 +63,10 @@ export function buildMcpServer(deps) {
|
|
|
57
63
|
required: ['tenantId'],
|
|
58
64
|
},
|
|
59
65
|
handler: async (args) => {
|
|
60
|
-
|
|
66
|
+
if (typeof args.tenantId !== 'string' || args.tenantId.length === 0) {
|
|
67
|
+
throw new UsageError('tenantId is required and must be a non-empty string.');
|
|
68
|
+
}
|
|
69
|
+
const request = { tenantId: args.tenantId };
|
|
61
70
|
if (typeof args.engine === 'string')
|
|
62
71
|
request.engine = args.engine;
|
|
63
72
|
if (typeof args.headless === 'boolean')
|
|
@@ -83,9 +92,62 @@ export function buildMcpServer(deps) {
|
|
|
83
92
|
required: ['sessionId'],
|
|
84
93
|
},
|
|
85
94
|
handler: async (args) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
if (typeof args.sessionId !== 'string' || args.sessionId.length === 0) {
|
|
96
|
+
throw new UsageError('sessionId is required and must be a non-empty string.');
|
|
97
|
+
}
|
|
98
|
+
const cookies = await client.sessions.cookies(args.sessionId);
|
|
99
|
+
return { sessionId: args.sessionId, cookies };
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'browser_snapshot',
|
|
104
|
+
description: 'Get a self-contained page snapshot for one-shot plan construction (TD-BROWSER-8): ' +
|
|
105
|
+
'url, title, revision, an adaptive `mode` (stable|verified - verified means recent ' +
|
|
106
|
+
'ref churn was detected and browser_plan will require a stricter role+label match ' +
|
|
107
|
+
'before self-healing a stale ref), and fields ({ref, role, label}) to address in a ' +
|
|
108
|
+
'browser_plan call. Prefer browser_snapshot + browser_plan over repeated ' +
|
|
109
|
+
'browser_observe/browser_act round-trips when filling multi-field forms.',
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
sessionId: { type: 'string' },
|
|
114
|
+
pageId: { type: 'string' },
|
|
115
|
+
},
|
|
116
|
+
required: ['sessionId', 'pageId'],
|
|
117
|
+
},
|
|
118
|
+
handler: async (args) => {
|
|
119
|
+
const [sessionId, pageId] = sessionAndPage(args);
|
|
120
|
+
return await client.sessions.snapshot(sessionId, pageId);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'browser_plan',
|
|
125
|
+
description: 'Execute a batched action plan in one call (TD-BROWSER-8). Each action: ' +
|
|
126
|
+
'{action: fill|click|press|scroll, target?: {ref}, value?, key?}. Steps run ' +
|
|
127
|
+
'sequentially; the first hard failure aborts with per-step results. Best paired ' +
|
|
128
|
+
'with browser_snapshot: address refs from its `fields` in one round trip.',
|
|
129
|
+
inputSchema: {
|
|
130
|
+
type: 'object',
|
|
131
|
+
properties: {
|
|
132
|
+
sessionId: { type: 'string' },
|
|
133
|
+
pageId: { type: 'string' },
|
|
134
|
+
actions: {
|
|
135
|
+
type: 'array',
|
|
136
|
+
description: 'Ordered plan steps: {action, target?: {ref}, value?, key?}',
|
|
137
|
+
items: { type: 'object' },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
required: ['sessionId', 'pageId', 'actions'],
|
|
141
|
+
},
|
|
142
|
+
handler: async (args) => {
|
|
143
|
+
const [sessionId, pageId] = sessionAndPage(args);
|
|
144
|
+
// Schema-only validation is not enforcement: a client that ignores
|
|
145
|
+
// inputSchema must still get a usage error, not a silently empty
|
|
146
|
+
// plan that reports ok with zero steps executed.
|
|
147
|
+
if (!Array.isArray(args.actions)) {
|
|
148
|
+
throw new UsageError('actions is required and must be an array of plan steps.');
|
|
149
|
+
}
|
|
150
|
+
return await client.sessions.plan(sessionId, pageId, args.actions);
|
|
89
151
|
},
|
|
90
152
|
},
|
|
91
153
|
{
|
|
@@ -97,8 +159,11 @@ export function buildMcpServer(deps) {
|
|
|
97
159
|
required: ['sessionId'],
|
|
98
160
|
},
|
|
99
161
|
handler: async (args) => {
|
|
100
|
-
|
|
101
|
-
|
|
162
|
+
if (typeof args.sessionId !== 'string' || args.sessionId.length === 0) {
|
|
163
|
+
throw new UsageError('sessionId is required and must be a non-empty string.');
|
|
164
|
+
}
|
|
165
|
+
await client.sessions.close(args.sessionId);
|
|
166
|
+
return { sessionId: args.sessionId, closed: true };
|
|
102
167
|
},
|
|
103
168
|
},
|
|
104
169
|
{
|
package/dist/mcp-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AA2Dh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AED,SAAS,KAAK,CAAC,EAA0B,EAAE,IAAY,EAAE,OAAe;IACtE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvailabs/agentbrowser-mcp",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server exposing AgentBrowser as high-level, safe, composable tools (talks to an AgentBrowser service via AGENTBROWSER_BASE_URL)",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"agentbrowser-mcp": "dist/bin.js"
|
|
10
10
|
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc && esbuild dist/bin.js --bundle --platform=node --format=esm --outfile=dist/bin.bundled.js && mv dist/bin.bundled.js dist/bin.js && esbuild dist/index.js --bundle --platform=node --format=esm --outfile=dist/index.bundled.js && mv dist/index.bundled.js dist/index.js",
|
|
13
|
+
"type-check": "tsc --noEmit",
|
|
14
|
+
"compile": "node scripts/compile.mjs",
|
|
15
|
+
"smoke": "node scripts/smoke.mjs dist-bin/agentbrowser-mcp",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"lint": "biome check src/",
|
|
19
|
+
"format": "biome format --write src/",
|
|
20
|
+
"clean": "rm -rf dist dist-bin *.tsbuildinfo",
|
|
21
|
+
"prepublishOnly": "pnpm build"
|
|
22
|
+
},
|
|
11
23
|
"dependencies": {},
|
|
12
24
|
"devDependencies": {
|
|
13
25
|
"@biomejs/biome": "^1.9.4",
|
|
@@ -15,8 +27,8 @@
|
|
|
15
27
|
"esbuild": "^0.28.2",
|
|
16
28
|
"typescript": "^5.7.2",
|
|
17
29
|
"vitest": "^2.1.9",
|
|
18
|
-
"@agentbrowser/protocol": "
|
|
19
|
-
"@agentbrowser/sdk-typescript": "
|
|
30
|
+
"@agentbrowser/protocol": "workspace:*",
|
|
31
|
+
"@agentbrowser/sdk-typescript": "workspace:*"
|
|
20
32
|
},
|
|
21
33
|
"files": [
|
|
22
34
|
"dist"
|
|
@@ -32,16 +44,5 @@
|
|
|
32
44
|
"url": "git+https://github.com/anvai-labs/agentbrowser.git",
|
|
33
45
|
"directory": "packages/mcp-server"
|
|
34
46
|
},
|
|
35
|
-
"license": "Apache-2.0"
|
|
36
|
-
|
|
37
|
-
"build": "tsc && esbuild dist/bin.js --bundle --platform=node --format=esm --outfile=dist/bin.bundled.js && mv dist/bin.bundled.js dist/bin.js && esbuild dist/index.js --bundle --platform=node --format=esm --outfile=dist/index.bundled.js && mv dist/index.bundled.js dist/index.js",
|
|
38
|
-
"type-check": "tsc --noEmit",
|
|
39
|
-
"compile": "node scripts/compile.mjs",
|
|
40
|
-
"smoke": "node scripts/smoke.mjs dist-bin/agentbrowser-mcp",
|
|
41
|
-
"test": "vitest run",
|
|
42
|
-
"test:watch": "vitest",
|
|
43
|
-
"lint": "biome check src/",
|
|
44
|
-
"format": "biome format --write src/",
|
|
45
|
-
"clean": "rm -rf dist dist-bin *.tsbuildinfo"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
47
|
+
"license": "Apache-2.0"
|
|
48
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|