auto-chrome-mcp-shared 1.4.2 → 1.6.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/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +198 -3
- package/dist/index.mjs +198 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -201,6 +201,10 @@ declare const TOOL_NAMES: {
|
|
|
201
201
|
SET_WORK_TAB: string;
|
|
202
202
|
WAIT_FOR: string;
|
|
203
203
|
SCROLL_COLLECT: string;
|
|
204
|
+
STORAGE: string;
|
|
205
|
+
SAVE_PDF: string;
|
|
206
|
+
EMULATE: string;
|
|
207
|
+
NETWORK_RULES: string;
|
|
204
208
|
EXTRACT: string;
|
|
205
209
|
FIND: string;
|
|
206
210
|
SHORTCUT: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -201,6 +201,10 @@ declare const TOOL_NAMES: {
|
|
|
201
201
|
SET_WORK_TAB: string;
|
|
202
202
|
WAIT_FOR: string;
|
|
203
203
|
SCROLL_COLLECT: string;
|
|
204
|
+
STORAGE: string;
|
|
205
|
+
SAVE_PDF: string;
|
|
206
|
+
EMULATE: string;
|
|
207
|
+
NETWORK_RULES: string;
|
|
204
208
|
EXTRACT: string;
|
|
205
209
|
FIND: string;
|
|
206
210
|
SHORTCUT: string;
|
package/dist/index.js
CHANGED
|
@@ -116,6 +116,11 @@ var TOOL_NAMES = {
|
|
|
116
116
|
SET_WORK_TAB: "chrome_set_work_tab",
|
|
117
117
|
WAIT_FOR: "chrome_wait_for",
|
|
118
118
|
SCROLL_COLLECT: "chrome_scroll_collect",
|
|
119
|
+
// auto-chrome-mcp fork(B1~B4)
|
|
120
|
+
STORAGE: "chrome_storage",
|
|
121
|
+
SAVE_PDF: "chrome_save_pdf",
|
|
122
|
+
EMULATE: "chrome_emulate",
|
|
123
|
+
NETWORK_RULES: "chrome_network_rules",
|
|
119
124
|
EXTRACT: "chrome_extract",
|
|
120
125
|
FIND: "chrome_find",
|
|
121
126
|
SHORTCUT: "chrome_shortcut",
|
|
@@ -289,7 +294,12 @@ var TOOL_SCHEMAS = [
|
|
|
289
294
|
enum: ["text", "links"],
|
|
290
295
|
description: "What to return (default 'text'). 'links' = deduped [{text, href}]"
|
|
291
296
|
},
|
|
292
|
-
maxChars: { type: "number", description: "Output cap (default 100000, max 300000)" }
|
|
297
|
+
maxChars: { type: "number", description: "Output cap (default 100000, max 300000)" },
|
|
298
|
+
renderMode: {
|
|
299
|
+
type: "string",
|
|
300
|
+
enum: ["auto", "force", "off"],
|
|
301
|
+
description: "Keep a background tab rendering so lazy loading actually fires (Chrome stops producing frames in inactive tabs, so IntersectionObserver never triggers). 'auto' (default) = enable only when the tab is not visible, 'force' = always, 'off' = never. Uses CDP, which shows a debugging infobar on that tab."
|
|
302
|
+
}
|
|
293
303
|
},
|
|
294
304
|
required: []
|
|
295
305
|
}
|
|
@@ -682,6 +692,15 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
682
692
|
type: "boolean",
|
|
683
693
|
description: "Create a new window to navigate to the URL or not. Defaults to false"
|
|
684
694
|
},
|
|
695
|
+
waitUntil: {
|
|
696
|
+
type: "string",
|
|
697
|
+
enum: ["none", "domcontentloaded", "load", "networkidle"],
|
|
698
|
+
description: 'How far to wait for the page to load before returning. Default "domcontentloaded" \u2014 prevents reading/clicking an empty page right after navigating. Use "networkidle" for data-heavy SPAs, "none" to return immediately. The observed load state is reported back in the result as "load" (a timeout is reported, not an error).'
|
|
699
|
+
},
|
|
700
|
+
waitTimeoutMs: {
|
|
701
|
+
type: "number",
|
|
702
|
+
description: "Max time (ms) to wait for waitUntil. Default 15000, max 60000."
|
|
703
|
+
},
|
|
685
704
|
tabId: {
|
|
686
705
|
type: "number",
|
|
687
706
|
description: "Target an existing tab by ID (if provided, navigate/refresh/back/forward that tab instead of the active tab)."
|
|
@@ -694,6 +713,10 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
694
713
|
type: "boolean",
|
|
695
714
|
description: "Perform the operation without stealing focus (do not activate the tab or focus the window). Default: false"
|
|
696
715
|
},
|
|
716
|
+
newTab: {
|
|
717
|
+
type: "boolean",
|
|
718
|
+
description: "Force a brand-new tab. By default this session keeps working in ONE tab: if it already has an MCP-created work tab, that tab is navigated instead of piling up new tabs. Tabs you assigned yourself via chrome_set_work_tab are never reused this way."
|
|
719
|
+
},
|
|
697
720
|
width: {
|
|
698
721
|
type: "number",
|
|
699
722
|
description: "Window width in pixels (default: 1280). When width or height is provided, a new window will be created."
|
|
@@ -1164,7 +1187,7 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1164
1187
|
},
|
|
1165
1188
|
{
|
|
1166
1189
|
name: TOOL_NAMES.BROWSER.CLICK,
|
|
1167
|
-
description:
|
|
1190
|
+
description: 'Click on an element in a web page. Supports multiple targeting methods: CSS selector, XPath, element ref (from chrome_read_page), or viewport coordinates. More focused than chrome_computer for simple click operations. Waits briefly for the element by default (waitForElementMs). When the click is blocked or the element is covered, the result carries an "obstruction" object naming the element/overlay on top of the target \u2014 read it instead of retrying the same click.',
|
|
1168
1191
|
inputSchema: {
|
|
1169
1192
|
type: "object",
|
|
1170
1193
|
properties: {
|
|
@@ -1172,6 +1195,10 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1172
1195
|
type: "string",
|
|
1173
1196
|
description: "CSS selector or XPath for the element to click."
|
|
1174
1197
|
},
|
|
1198
|
+
waitForElementMs: {
|
|
1199
|
+
type: "number",
|
|
1200
|
+
description: 'How long (ms) to wait for the target element to appear and become visible before failing. Default 2000; set 0 to fail immediately. Removes the usual "click failed -> chrome_wait_for -> click again" round-trip on SPA/lazy-rendered pages.'
|
|
1201
|
+
},
|
|
1175
1202
|
selectorType: {
|
|
1176
1203
|
type: "string",
|
|
1177
1204
|
enum: ["css", "xpath"],
|
|
@@ -1235,7 +1262,7 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1235
1262
|
},
|
|
1236
1263
|
{
|
|
1237
1264
|
name: TOOL_NAMES.BROWSER.FILL,
|
|
1238
|
-
description: "Fill or select a form element on a web page. Supports input, textarea, select, checkbox, and
|
|
1265
|
+
description: "Fill or select a form element on a web page. Supports input, textarea, select, checkbox, radio, and contenteditable elements (the prompt boxes used by modern editors such as Google Flow, Gemini, ChatGPT and Notion). Use CSS selector, XPath, or element ref to target the element.",
|
|
1239
1266
|
inputSchema: {
|
|
1240
1267
|
type: "object",
|
|
1241
1268
|
properties: {
|
|
@@ -1243,6 +1270,10 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1243
1270
|
type: "string",
|
|
1244
1271
|
description: "CSS selector or XPath for the form element."
|
|
1245
1272
|
},
|
|
1273
|
+
waitForElementMs: {
|
|
1274
|
+
type: "number",
|
|
1275
|
+
description: 'How long (ms) to wait for the target element to appear and become visible before failing. Default 2000; set 0 to fail immediately. Removes the usual "click failed -> chrome_wait_for -> click again" round-trip on SPA/lazy-rendered pages.'
|
|
1276
|
+
},
|
|
1246
1277
|
selectorType: {
|
|
1247
1278
|
type: "string",
|
|
1248
1279
|
enum: ["css", "xpath"],
|
|
@@ -1688,6 +1719,170 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1688
1719
|
},
|
|
1689
1720
|
required: ["action"]
|
|
1690
1721
|
}
|
|
1722
|
+
},
|
|
1723
|
+
// ===== auto-chrome-mcp fork (B1~B4) =====
|
|
1724
|
+
{
|
|
1725
|
+
name: TOOL_NAMES.BROWSER.STORAGE,
|
|
1726
|
+
description: "Read or modify cookies, localStorage, or sessionStorage. Use it to save/restore a login session, test the logged-out state, pre-seed a consent cookie so the banner never appears, or inspect front-end state. Cookie/storage VALUES are hidden by default (names, domains and expiry are still returned) - pass includeValues:true only when you actually need the secrets.",
|
|
1727
|
+
inputSchema: {
|
|
1728
|
+
type: "object",
|
|
1729
|
+
properties: {
|
|
1730
|
+
kind: {
|
|
1731
|
+
type: "string",
|
|
1732
|
+
enum: ["cookies", "local", "session"],
|
|
1733
|
+
description: 'What to operate on: browser cookies, localStorage, or sessionStorage. Default "cookies".'
|
|
1734
|
+
},
|
|
1735
|
+
action: {
|
|
1736
|
+
type: "string",
|
|
1737
|
+
enum: ["get", "set", "remove", "clear"],
|
|
1738
|
+
description: 'Default "get". "clear" requires a scope (url or domain for cookies).'
|
|
1739
|
+
},
|
|
1740
|
+
url: {
|
|
1741
|
+
type: "string",
|
|
1742
|
+
description: "Cookies: target URL. Required for set/remove. Defaults to the work tab URL."
|
|
1743
|
+
},
|
|
1744
|
+
domain: { type: "string", description: "Cookies: filter/scope by domain (get, clear)." },
|
|
1745
|
+
name: { type: "string", description: "Cookie name." },
|
|
1746
|
+
key: {
|
|
1747
|
+
type: "string",
|
|
1748
|
+
description: "localStorage/sessionStorage key (omit on get to list all)."
|
|
1749
|
+
},
|
|
1750
|
+
value: { type: "string", description: "Value to write (set)." },
|
|
1751
|
+
path: { type: "string", description: "Cookie path (set)." },
|
|
1752
|
+
secure: { type: "boolean", description: "Cookie Secure flag (set)." },
|
|
1753
|
+
httpOnly: { type: "boolean", description: "Cookie HttpOnly flag (set)." },
|
|
1754
|
+
sameSite: {
|
|
1755
|
+
type: "string",
|
|
1756
|
+
enum: ["no_restriction", "lax", "strict"],
|
|
1757
|
+
description: "Cookie SameSite (set)."
|
|
1758
|
+
},
|
|
1759
|
+
expirationDate: {
|
|
1760
|
+
type: "number",
|
|
1761
|
+
description: "Cookie expiry, unix seconds (set). Omit for a session cookie."
|
|
1762
|
+
},
|
|
1763
|
+
includeValues: {
|
|
1764
|
+
type: "boolean",
|
|
1765
|
+
description: "Return real values instead of masked placeholders. Default false - these are usually auth tokens."
|
|
1766
|
+
},
|
|
1767
|
+
tabId: { type: "number", description: "Target tab. Defaults to the session work tab." },
|
|
1768
|
+
windowId: {
|
|
1769
|
+
type: "number",
|
|
1770
|
+
description: "Window to pick the active tab from (when tabId is omitted)."
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
name: TOOL_NAMES.BROWSER.SAVE_PDF,
|
|
1777
|
+
description: "Save the page as a PDF into the Downloads folder (via Page.printToPDF). Unlike a screenshot the text stays selectable and multi-page documents are captured in full - use it to archive notices, contracts, invoices and reports. The PDF bytes are NOT returned (that would be enormous); the result carries the saved filename.",
|
|
1778
|
+
inputSchema: {
|
|
1779
|
+
type: "object",
|
|
1780
|
+
properties: {
|
|
1781
|
+
tabId: { type: "number", description: "Target tab. Defaults to the session work tab." },
|
|
1782
|
+
windowId: {
|
|
1783
|
+
type: "number",
|
|
1784
|
+
description: "Window to pick the active tab from (when tabId is omitted)."
|
|
1785
|
+
},
|
|
1786
|
+
filename: {
|
|
1787
|
+
type: "string",
|
|
1788
|
+
description: 'File name (".pdf" added automatically). Saved under Downloads/mcp-pdf/.'
|
|
1789
|
+
},
|
|
1790
|
+
paperFormat: {
|
|
1791
|
+
type: "string",
|
|
1792
|
+
enum: ["a4", "a3", "letter", "legal"],
|
|
1793
|
+
description: "Paper size (default a4)."
|
|
1794
|
+
},
|
|
1795
|
+
landscape: { type: "boolean", description: "Landscape orientation (default false)." },
|
|
1796
|
+
printBackground: {
|
|
1797
|
+
type: "boolean",
|
|
1798
|
+
description: "Include background colors/images (default true)."
|
|
1799
|
+
},
|
|
1800
|
+
scale: { type: "number", description: "Render scale 0.1-2 (default 1)." },
|
|
1801
|
+
pageRanges: {
|
|
1802
|
+
type: "string",
|
|
1803
|
+
description: 'Pages to include, e.g. "1-3" or "2". Default all.'
|
|
1804
|
+
},
|
|
1805
|
+
displayHeaderFooter: {
|
|
1806
|
+
type: "boolean",
|
|
1807
|
+
description: "Print URL/page numbers in header and footer (default false)."
|
|
1808
|
+
},
|
|
1809
|
+
marginInches: {
|
|
1810
|
+
type: "number",
|
|
1811
|
+
description: "Margin on all sides in inches, 0-3 (default 0.4)."
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
name: TOOL_NAMES.BROWSER.EMULATE,
|
|
1818
|
+
description: 'Emulate a device viewport (size, pixel density, touch, User-Agent) on a tab for responsive/mobile checking. The real window is never resized, so this works on background work tabs. Emulation persists until action="reset" - always reset when finished, since Chrome shows an automation notice on an emulated tab.',
|
|
1819
|
+
inputSchema: {
|
|
1820
|
+
type: "object",
|
|
1821
|
+
properties: {
|
|
1822
|
+
action: {
|
|
1823
|
+
type: "string",
|
|
1824
|
+
enum: ["set", "reset", "status"],
|
|
1825
|
+
description: 'Default "set". "status" also lists available device presets.'
|
|
1826
|
+
},
|
|
1827
|
+
device: {
|
|
1828
|
+
type: "string",
|
|
1829
|
+
description: "Preset: iphone-se, iphone-15, pixel-8, galaxy-s23, ipad, desktop-1280, desktop-1080p."
|
|
1830
|
+
},
|
|
1831
|
+
width: {
|
|
1832
|
+
type: "number",
|
|
1833
|
+
description: "Custom viewport width in CSS px (overrides preset)."
|
|
1834
|
+
},
|
|
1835
|
+
height: {
|
|
1836
|
+
type: "number",
|
|
1837
|
+
description: "Custom viewport height in CSS px (overrides preset)."
|
|
1838
|
+
},
|
|
1839
|
+
deviceScaleFactor: { type: "number", description: "Device pixel ratio, 0-5." },
|
|
1840
|
+
mobile: {
|
|
1841
|
+
type: "boolean",
|
|
1842
|
+
description: "Emulate a mobile device (affects viewport meta handling)."
|
|
1843
|
+
},
|
|
1844
|
+
hasTouch: { type: "boolean", description: "Enable touch event emulation." },
|
|
1845
|
+
userAgent: { type: "string", description: "Override the User-Agent string." },
|
|
1846
|
+
tabId: { type: "number", description: "Target tab. Defaults to the session work tab." },
|
|
1847
|
+
windowId: {
|
|
1848
|
+
type: "number",
|
|
1849
|
+
description: "Window to pick the active tab from (when tabId is omitted)."
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
name: TOOL_NAMES.BROWSER.NETWORK_RULES,
|
|
1856
|
+
description: "Block network requests with declarativeNetRequest session rules. Blocking ads/trackers or heavy images makes pages load noticeably faster and cuts the boilerplate that read_page/get_web_content would otherwise return (fewer tokens). Rules are session-scoped (gone on Chrome restart) and can be limited to one tab. Beware: some sites depend on tracker domains for login.",
|
|
1857
|
+
inputSchema: {
|
|
1858
|
+
type: "object",
|
|
1859
|
+
properties: {
|
|
1860
|
+
action: {
|
|
1861
|
+
type: "string",
|
|
1862
|
+
enum: ["block", "unblock", "list", "clear"],
|
|
1863
|
+
description: 'Default "block". "list" shows active rules with their ids, "clear" removes all of them.'
|
|
1864
|
+
},
|
|
1865
|
+
preset: {
|
|
1866
|
+
type: "string",
|
|
1867
|
+
enum: ["ads", "trackers", "images", "media", "fonts"],
|
|
1868
|
+
description: "Built-in rule set. ads/trackers block known domains; images/media/fonts block those resource types entirely."
|
|
1869
|
+
},
|
|
1870
|
+
patterns: {
|
|
1871
|
+
type: "array",
|
|
1872
|
+
items: { type: "string" },
|
|
1873
|
+
description: 'Custom urlFilter patterns, e.g. ["||doubleclick.net^", "/ads/"]. Max 100.'
|
|
1874
|
+
},
|
|
1875
|
+
tabId: {
|
|
1876
|
+
type: "number",
|
|
1877
|
+
description: "Apply only to this tab. Omit to apply to all tabs."
|
|
1878
|
+
},
|
|
1879
|
+
ruleIds: {
|
|
1880
|
+
type: "array",
|
|
1881
|
+
items: { type: "number" },
|
|
1882
|
+
description: 'For action="unblock": rule ids to remove (get them from action="list").'
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1691
1886
|
}
|
|
1692
1887
|
];
|
|
1693
1888
|
|
package/dist/index.mjs
CHANGED
|
@@ -71,6 +71,11 @@ var TOOL_NAMES = {
|
|
|
71
71
|
SET_WORK_TAB: "chrome_set_work_tab",
|
|
72
72
|
WAIT_FOR: "chrome_wait_for",
|
|
73
73
|
SCROLL_COLLECT: "chrome_scroll_collect",
|
|
74
|
+
// auto-chrome-mcp fork(B1~B4)
|
|
75
|
+
STORAGE: "chrome_storage",
|
|
76
|
+
SAVE_PDF: "chrome_save_pdf",
|
|
77
|
+
EMULATE: "chrome_emulate",
|
|
78
|
+
NETWORK_RULES: "chrome_network_rules",
|
|
74
79
|
EXTRACT: "chrome_extract",
|
|
75
80
|
FIND: "chrome_find",
|
|
76
81
|
SHORTCUT: "chrome_shortcut",
|
|
@@ -244,7 +249,12 @@ var TOOL_SCHEMAS = [
|
|
|
244
249
|
enum: ["text", "links"],
|
|
245
250
|
description: "What to return (default 'text'). 'links' = deduped [{text, href}]"
|
|
246
251
|
},
|
|
247
|
-
maxChars: { type: "number", description: "Output cap (default 100000, max 300000)" }
|
|
252
|
+
maxChars: { type: "number", description: "Output cap (default 100000, max 300000)" },
|
|
253
|
+
renderMode: {
|
|
254
|
+
type: "string",
|
|
255
|
+
enum: ["auto", "force", "off"],
|
|
256
|
+
description: "Keep a background tab rendering so lazy loading actually fires (Chrome stops producing frames in inactive tabs, so IntersectionObserver never triggers). 'auto' (default) = enable only when the tab is not visible, 'force' = always, 'off' = never. Uses CDP, which shows a debugging infobar on that tab."
|
|
257
|
+
}
|
|
248
258
|
},
|
|
249
259
|
required: []
|
|
250
260
|
}
|
|
@@ -637,6 +647,15 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
637
647
|
type: "boolean",
|
|
638
648
|
description: "Create a new window to navigate to the URL or not. Defaults to false"
|
|
639
649
|
},
|
|
650
|
+
waitUntil: {
|
|
651
|
+
type: "string",
|
|
652
|
+
enum: ["none", "domcontentloaded", "load", "networkidle"],
|
|
653
|
+
description: 'How far to wait for the page to load before returning. Default "domcontentloaded" \u2014 prevents reading/clicking an empty page right after navigating. Use "networkidle" for data-heavy SPAs, "none" to return immediately. The observed load state is reported back in the result as "load" (a timeout is reported, not an error).'
|
|
654
|
+
},
|
|
655
|
+
waitTimeoutMs: {
|
|
656
|
+
type: "number",
|
|
657
|
+
description: "Max time (ms) to wait for waitUntil. Default 15000, max 60000."
|
|
658
|
+
},
|
|
640
659
|
tabId: {
|
|
641
660
|
type: "number",
|
|
642
661
|
description: "Target an existing tab by ID (if provided, navigate/refresh/back/forward that tab instead of the active tab)."
|
|
@@ -649,6 +668,10 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
649
668
|
type: "boolean",
|
|
650
669
|
description: "Perform the operation without stealing focus (do not activate the tab or focus the window). Default: false"
|
|
651
670
|
},
|
|
671
|
+
newTab: {
|
|
672
|
+
type: "boolean",
|
|
673
|
+
description: "Force a brand-new tab. By default this session keeps working in ONE tab: if it already has an MCP-created work tab, that tab is navigated instead of piling up new tabs. Tabs you assigned yourself via chrome_set_work_tab are never reused this way."
|
|
674
|
+
},
|
|
652
675
|
width: {
|
|
653
676
|
type: "number",
|
|
654
677
|
description: "Window width in pixels (default: 1280). When width or height is provided, a new window will be created."
|
|
@@ -1119,7 +1142,7 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1119
1142
|
},
|
|
1120
1143
|
{
|
|
1121
1144
|
name: TOOL_NAMES.BROWSER.CLICK,
|
|
1122
|
-
description:
|
|
1145
|
+
description: 'Click on an element in a web page. Supports multiple targeting methods: CSS selector, XPath, element ref (from chrome_read_page), or viewport coordinates. More focused than chrome_computer for simple click operations. Waits briefly for the element by default (waitForElementMs). When the click is blocked or the element is covered, the result carries an "obstruction" object naming the element/overlay on top of the target \u2014 read it instead of retrying the same click.',
|
|
1123
1146
|
inputSchema: {
|
|
1124
1147
|
type: "object",
|
|
1125
1148
|
properties: {
|
|
@@ -1127,6 +1150,10 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1127
1150
|
type: "string",
|
|
1128
1151
|
description: "CSS selector or XPath for the element to click."
|
|
1129
1152
|
},
|
|
1153
|
+
waitForElementMs: {
|
|
1154
|
+
type: "number",
|
|
1155
|
+
description: 'How long (ms) to wait for the target element to appear and become visible before failing. Default 2000; set 0 to fail immediately. Removes the usual "click failed -> chrome_wait_for -> click again" round-trip on SPA/lazy-rendered pages.'
|
|
1156
|
+
},
|
|
1130
1157
|
selectorType: {
|
|
1131
1158
|
type: "string",
|
|
1132
1159
|
enum: ["css", "xpath"],
|
|
@@ -1190,7 +1217,7 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1190
1217
|
},
|
|
1191
1218
|
{
|
|
1192
1219
|
name: TOOL_NAMES.BROWSER.FILL,
|
|
1193
|
-
description: "Fill or select a form element on a web page. Supports input, textarea, select, checkbox, and
|
|
1220
|
+
description: "Fill or select a form element on a web page. Supports input, textarea, select, checkbox, radio, and contenteditable elements (the prompt boxes used by modern editors such as Google Flow, Gemini, ChatGPT and Notion). Use CSS selector, XPath, or element ref to target the element.",
|
|
1194
1221
|
inputSchema: {
|
|
1195
1222
|
type: "object",
|
|
1196
1223
|
properties: {
|
|
@@ -1198,6 +1225,10 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1198
1225
|
type: "string",
|
|
1199
1226
|
description: "CSS selector or XPath for the form element."
|
|
1200
1227
|
},
|
|
1228
|
+
waitForElementMs: {
|
|
1229
|
+
type: "number",
|
|
1230
|
+
description: 'How long (ms) to wait for the target element to appear and become visible before failing. Default 2000; set 0 to fail immediately. Removes the usual "click failed -> chrome_wait_for -> click again" round-trip on SPA/lazy-rendered pages.'
|
|
1231
|
+
},
|
|
1201
1232
|
selectorType: {
|
|
1202
1233
|
type: "string",
|
|
1203
1234
|
enum: ["css", "xpath"],
|
|
@@ -1643,6 +1674,170 @@ Tip: If the returned elements do not include the specific element you need, use
|
|
|
1643
1674
|
},
|
|
1644
1675
|
required: ["action"]
|
|
1645
1676
|
}
|
|
1677
|
+
},
|
|
1678
|
+
// ===== auto-chrome-mcp fork (B1~B4) =====
|
|
1679
|
+
{
|
|
1680
|
+
name: TOOL_NAMES.BROWSER.STORAGE,
|
|
1681
|
+
description: "Read or modify cookies, localStorage, or sessionStorage. Use it to save/restore a login session, test the logged-out state, pre-seed a consent cookie so the banner never appears, or inspect front-end state. Cookie/storage VALUES are hidden by default (names, domains and expiry are still returned) - pass includeValues:true only when you actually need the secrets.",
|
|
1682
|
+
inputSchema: {
|
|
1683
|
+
type: "object",
|
|
1684
|
+
properties: {
|
|
1685
|
+
kind: {
|
|
1686
|
+
type: "string",
|
|
1687
|
+
enum: ["cookies", "local", "session"],
|
|
1688
|
+
description: 'What to operate on: browser cookies, localStorage, or sessionStorage. Default "cookies".'
|
|
1689
|
+
},
|
|
1690
|
+
action: {
|
|
1691
|
+
type: "string",
|
|
1692
|
+
enum: ["get", "set", "remove", "clear"],
|
|
1693
|
+
description: 'Default "get". "clear" requires a scope (url or domain for cookies).'
|
|
1694
|
+
},
|
|
1695
|
+
url: {
|
|
1696
|
+
type: "string",
|
|
1697
|
+
description: "Cookies: target URL. Required for set/remove. Defaults to the work tab URL."
|
|
1698
|
+
},
|
|
1699
|
+
domain: { type: "string", description: "Cookies: filter/scope by domain (get, clear)." },
|
|
1700
|
+
name: { type: "string", description: "Cookie name." },
|
|
1701
|
+
key: {
|
|
1702
|
+
type: "string",
|
|
1703
|
+
description: "localStorage/sessionStorage key (omit on get to list all)."
|
|
1704
|
+
},
|
|
1705
|
+
value: { type: "string", description: "Value to write (set)." },
|
|
1706
|
+
path: { type: "string", description: "Cookie path (set)." },
|
|
1707
|
+
secure: { type: "boolean", description: "Cookie Secure flag (set)." },
|
|
1708
|
+
httpOnly: { type: "boolean", description: "Cookie HttpOnly flag (set)." },
|
|
1709
|
+
sameSite: {
|
|
1710
|
+
type: "string",
|
|
1711
|
+
enum: ["no_restriction", "lax", "strict"],
|
|
1712
|
+
description: "Cookie SameSite (set)."
|
|
1713
|
+
},
|
|
1714
|
+
expirationDate: {
|
|
1715
|
+
type: "number",
|
|
1716
|
+
description: "Cookie expiry, unix seconds (set). Omit for a session cookie."
|
|
1717
|
+
},
|
|
1718
|
+
includeValues: {
|
|
1719
|
+
type: "boolean",
|
|
1720
|
+
description: "Return real values instead of masked placeholders. Default false - these are usually auth tokens."
|
|
1721
|
+
},
|
|
1722
|
+
tabId: { type: "number", description: "Target tab. Defaults to the session work tab." },
|
|
1723
|
+
windowId: {
|
|
1724
|
+
type: "number",
|
|
1725
|
+
description: "Window to pick the active tab from (when tabId is omitted)."
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
name: TOOL_NAMES.BROWSER.SAVE_PDF,
|
|
1732
|
+
description: "Save the page as a PDF into the Downloads folder (via Page.printToPDF). Unlike a screenshot the text stays selectable and multi-page documents are captured in full - use it to archive notices, contracts, invoices and reports. The PDF bytes are NOT returned (that would be enormous); the result carries the saved filename.",
|
|
1733
|
+
inputSchema: {
|
|
1734
|
+
type: "object",
|
|
1735
|
+
properties: {
|
|
1736
|
+
tabId: { type: "number", description: "Target tab. Defaults to the session work tab." },
|
|
1737
|
+
windowId: {
|
|
1738
|
+
type: "number",
|
|
1739
|
+
description: "Window to pick the active tab from (when tabId is omitted)."
|
|
1740
|
+
},
|
|
1741
|
+
filename: {
|
|
1742
|
+
type: "string",
|
|
1743
|
+
description: 'File name (".pdf" added automatically). Saved under Downloads/mcp-pdf/.'
|
|
1744
|
+
},
|
|
1745
|
+
paperFormat: {
|
|
1746
|
+
type: "string",
|
|
1747
|
+
enum: ["a4", "a3", "letter", "legal"],
|
|
1748
|
+
description: "Paper size (default a4)."
|
|
1749
|
+
},
|
|
1750
|
+
landscape: { type: "boolean", description: "Landscape orientation (default false)." },
|
|
1751
|
+
printBackground: {
|
|
1752
|
+
type: "boolean",
|
|
1753
|
+
description: "Include background colors/images (default true)."
|
|
1754
|
+
},
|
|
1755
|
+
scale: { type: "number", description: "Render scale 0.1-2 (default 1)." },
|
|
1756
|
+
pageRanges: {
|
|
1757
|
+
type: "string",
|
|
1758
|
+
description: 'Pages to include, e.g. "1-3" or "2". Default all.'
|
|
1759
|
+
},
|
|
1760
|
+
displayHeaderFooter: {
|
|
1761
|
+
type: "boolean",
|
|
1762
|
+
description: "Print URL/page numbers in header and footer (default false)."
|
|
1763
|
+
},
|
|
1764
|
+
marginInches: {
|
|
1765
|
+
type: "number",
|
|
1766
|
+
description: "Margin on all sides in inches, 0-3 (default 0.4)."
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
name: TOOL_NAMES.BROWSER.EMULATE,
|
|
1773
|
+
description: 'Emulate a device viewport (size, pixel density, touch, User-Agent) on a tab for responsive/mobile checking. The real window is never resized, so this works on background work tabs. Emulation persists until action="reset" - always reset when finished, since Chrome shows an automation notice on an emulated tab.',
|
|
1774
|
+
inputSchema: {
|
|
1775
|
+
type: "object",
|
|
1776
|
+
properties: {
|
|
1777
|
+
action: {
|
|
1778
|
+
type: "string",
|
|
1779
|
+
enum: ["set", "reset", "status"],
|
|
1780
|
+
description: 'Default "set". "status" also lists available device presets.'
|
|
1781
|
+
},
|
|
1782
|
+
device: {
|
|
1783
|
+
type: "string",
|
|
1784
|
+
description: "Preset: iphone-se, iphone-15, pixel-8, galaxy-s23, ipad, desktop-1280, desktop-1080p."
|
|
1785
|
+
},
|
|
1786
|
+
width: {
|
|
1787
|
+
type: "number",
|
|
1788
|
+
description: "Custom viewport width in CSS px (overrides preset)."
|
|
1789
|
+
},
|
|
1790
|
+
height: {
|
|
1791
|
+
type: "number",
|
|
1792
|
+
description: "Custom viewport height in CSS px (overrides preset)."
|
|
1793
|
+
},
|
|
1794
|
+
deviceScaleFactor: { type: "number", description: "Device pixel ratio, 0-5." },
|
|
1795
|
+
mobile: {
|
|
1796
|
+
type: "boolean",
|
|
1797
|
+
description: "Emulate a mobile device (affects viewport meta handling)."
|
|
1798
|
+
},
|
|
1799
|
+
hasTouch: { type: "boolean", description: "Enable touch event emulation." },
|
|
1800
|
+
userAgent: { type: "string", description: "Override the User-Agent string." },
|
|
1801
|
+
tabId: { type: "number", description: "Target tab. Defaults to the session work tab." },
|
|
1802
|
+
windowId: {
|
|
1803
|
+
type: "number",
|
|
1804
|
+
description: "Window to pick the active tab from (when tabId is omitted)."
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
name: TOOL_NAMES.BROWSER.NETWORK_RULES,
|
|
1811
|
+
description: "Block network requests with declarativeNetRequest session rules. Blocking ads/trackers or heavy images makes pages load noticeably faster and cuts the boilerplate that read_page/get_web_content would otherwise return (fewer tokens). Rules are session-scoped (gone on Chrome restart) and can be limited to one tab. Beware: some sites depend on tracker domains for login.",
|
|
1812
|
+
inputSchema: {
|
|
1813
|
+
type: "object",
|
|
1814
|
+
properties: {
|
|
1815
|
+
action: {
|
|
1816
|
+
type: "string",
|
|
1817
|
+
enum: ["block", "unblock", "list", "clear"],
|
|
1818
|
+
description: 'Default "block". "list" shows active rules with their ids, "clear" removes all of them.'
|
|
1819
|
+
},
|
|
1820
|
+
preset: {
|
|
1821
|
+
type: "string",
|
|
1822
|
+
enum: ["ads", "trackers", "images", "media", "fonts"],
|
|
1823
|
+
description: "Built-in rule set. ads/trackers block known domains; images/media/fonts block those resource types entirely."
|
|
1824
|
+
},
|
|
1825
|
+
patterns: {
|
|
1826
|
+
type: "array",
|
|
1827
|
+
items: { type: "string" },
|
|
1828
|
+
description: 'Custom urlFilter patterns, e.g. ["||doubleclick.net^", "/ads/"]. Max 100.'
|
|
1829
|
+
},
|
|
1830
|
+
tabId: {
|
|
1831
|
+
type: "number",
|
|
1832
|
+
description: "Apply only to this tab. Omit to apply to all tabs."
|
|
1833
|
+
},
|
|
1834
|
+
ruleIds: {
|
|
1835
|
+
type: "array",
|
|
1836
|
+
items: { type: "number" },
|
|
1837
|
+
description: 'For action="unblock": rule ids to remove (get them from action="list").'
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1646
1841
|
}
|
|
1647
1842
|
];
|
|
1648
1843
|
|