@mcp-b/extension-tools 0.0.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 +143 -18
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +1360 -211
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +19 -11
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ Chrome Extension API tools for Model Context Protocol (MCP) - provides MCP-compa
|
|
|
6
6
|
|
|
7
7
|
This package provides a comprehensive set of tool classes that expose Chrome Extension APIs through the Model Context Protocol (MCP). Each API is wrapped in a dedicated class that handles permission checking, error handling, and tool registration.
|
|
8
8
|
|
|
9
|
+
Currently, **62 out of 74** Chrome Extension APIs have been implemented and are ready to use. See the [API Implementation Status](#api-implementation-status) section below for a complete list of available and pending APIs.
|
|
10
|
+
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
11
13
|
```bash
|
|
@@ -16,22 +18,99 @@ pnpm add @b-mcp/extension-tools @modelcontextprotocol/sdk
|
|
|
16
18
|
yarn add @b-mcp/extension-tools @modelcontextprotocol/sdk
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## API Implementation Status
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
### ✅ Available API Tools (62 APIs)
|
|
24
|
+
|
|
25
|
+
The following Chrome Extension APIs have been fully implemented and are ready to use:
|
|
26
|
+
|
|
27
|
+
- `AlarmsApiTools` - Set and manage alarms
|
|
28
|
+
- `AudioApiTools` - Audio device management
|
|
23
29
|
- `BookmarksApiTools` - Manage browser bookmarks
|
|
24
|
-
- `
|
|
30
|
+
- `BrowsingDataApiTools` - Clear browsing data
|
|
31
|
+
- `CertificateProviderApiTools` - Provide certificates for TLS authentication
|
|
32
|
+
- `CommandsApiTools` - Manage keyboard shortcuts
|
|
33
|
+
- `ContentSettingsApiTools` - Manage content settings
|
|
34
|
+
- `ContextMenusApiTools` - Create context menu items
|
|
35
|
+
- `CookiesApiTools` - Manage browser cookies
|
|
36
|
+
- `DebuggerApiTools` - Debug network and JavaScript
|
|
37
|
+
- `DeclarativeContentApiTools` - Take actions based on content
|
|
38
|
+
- `DeclarativeNetRequestApiTools` - Modify network requests
|
|
39
|
+
- `DesktopCaptureApiTools` - Capture desktop content
|
|
40
|
+
- `DevtoolsInspectedWindowApiTools` - Interact with inspected window
|
|
41
|
+
- `DevtoolsNetworkApiTools` - Retrieve network information
|
|
42
|
+
- `DevtoolsPanelsApiTools` - Create DevTools panels
|
|
43
|
+
- `DocumentScanApiTools` - Scan documents
|
|
44
|
+
- `DomApiTools` - Access DOM from extensions
|
|
45
|
+
- `DownloadsApiTools` - Control file downloads
|
|
46
|
+
- `EnterpriseDeviceAttributesApiTools` - Access enterprise device attributes
|
|
47
|
+
- `EnterpriseHardwarePlatformApiTools` - Access enterprise hardware info
|
|
48
|
+
- `EnterpriseNetworkingAttributesApiTools` - Access enterprise network attributes
|
|
49
|
+
- `EnterprisePlatformKeysApiTools` - Enterprise platform keys
|
|
50
|
+
- `ExtensionApiTools` - Extension utilities
|
|
51
|
+
- `FileBrowserHandlerApiTools` - Handle file browser events
|
|
52
|
+
- `FileSystemProviderApiTools` - Provide file systems
|
|
53
|
+
- `FontSettingsApiTools` - Manage font settings
|
|
54
|
+
- `GcmApiTools` - Google Cloud Messaging
|
|
25
55
|
- `HistoryApiTools` - Search and manage browsing history
|
|
56
|
+
- `I18nApiTools` - Internationalization utilities
|
|
57
|
+
- `IdentityApiTools` - OAuth2 authentication
|
|
58
|
+
- `IdleApiTools` - Detect idle state
|
|
59
|
+
- `InputImeApiTools` - Input method editor
|
|
60
|
+
- `InstanceIDApiTools` - Instance ID operations
|
|
61
|
+
- `LoginStateApiTools` - Read login state
|
|
62
|
+
- `ManagementApiTools` - Manage extensions
|
|
26
63
|
- `NotificationsApiTools` - Create system notifications
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
64
|
+
- `OffscreenApiTools` - Manage offscreen documents
|
|
65
|
+
- `OmniboxApiTools` - Customize address bar
|
|
66
|
+
- `PageCaptureApiTools` - Save pages as MHTML
|
|
67
|
+
- `PermissionsApiTools` - Request optional permissions
|
|
68
|
+
- `PlatformKeysApiTools` - Platform-specific keys
|
|
69
|
+
- `PowerApiTools` - Power management
|
|
70
|
+
- `PrintingApiTools` - Print documents
|
|
71
|
+
- `PrintingMetricsApiTools` - Printing metrics
|
|
72
|
+
- `ProxyApiTools` - Manage proxy settings
|
|
73
|
+
- `ReadingListApiTools` - Access reading list
|
|
30
74
|
- `RuntimeApiTools` - Access extension runtime information
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
75
|
+
- `ScriptingApiTools` - Execute scripts and inject CSS
|
|
76
|
+
- `SearchApiTools` - Search via default provider
|
|
77
|
+
- `SessionsApiTools` - Query and restore browser sessions
|
|
78
|
+
- `SidePanelApiTools` - Control side panel
|
|
79
|
+
- `StorageApiTools` - Access extension storage (local, sync, session)
|
|
80
|
+
- `SystemCpuApiTools` - Query CPU information
|
|
81
|
+
- `SystemLogApiTools` - Add system log entries
|
|
82
|
+
- `SystemMemoryApiTools` - Get memory information
|
|
83
|
+
- `SystemStorageApiTools` - Query storage devices
|
|
84
|
+
- `TabCaptureApiTools` - Capture tab media streams
|
|
34
85
|
- `TabGroupsApiTools` - Manage tab groups
|
|
86
|
+
- `TabsApiTools` - Create, update, query, and manage browser tabs
|
|
87
|
+
- `TopSitesApiTools` - Access top sites
|
|
88
|
+
- `TtsApiTools` - Text-to-speech functionality
|
|
89
|
+
- `TtsEngineApiTools` - Implement TTS engine
|
|
90
|
+
- `UserScriptsApiTools` - Execute user scripts
|
|
91
|
+
- `VpnProviderApiTools` - Implement VPN client
|
|
92
|
+
- `WallpaperApiTools` - Set wallpaper
|
|
93
|
+
- `WebAuthenticationProxyApiTools` - Web authentication proxy
|
|
94
|
+
- `WebNavigationApiTools` - Monitor web navigation
|
|
95
|
+
- `WebRequestApiTools` - Intercept and modify requests
|
|
96
|
+
- `WindowsApiTools` - Control browser windows
|
|
97
|
+
|
|
98
|
+
### 🚧 APIs Under Development (12 APIs)
|
|
99
|
+
|
|
100
|
+
The following Chrome Extension APIs are not yet implemented or need additional work:
|
|
101
|
+
|
|
102
|
+
- `AccessibilityFeaturesApiTools` - Manage accessibility features
|
|
103
|
+
- `ActionApiTools` - Control extension's action button
|
|
104
|
+
- `DevtoolsPerformanceApiTools` - Access performance data
|
|
105
|
+
- `DevtoolsRecorderApiTools` - DevTools recorder panel
|
|
106
|
+
- `DnsApiTools` - DNS resolution
|
|
107
|
+
- `EventsApiTools` - Common event handling
|
|
108
|
+
- `ExtensionTypesApiTools` - Extension type definitions
|
|
109
|
+
- `PrinterProviderApiTools` - Provide printers
|
|
110
|
+
- `PrivacyApiTools` - Control privacy features
|
|
111
|
+
- `ProcessesApiTools` - Interact with browser processes
|
|
112
|
+
- `SystemDisplayApiTools` - Query display information
|
|
113
|
+
- `TypesApiTools` - Chrome type definitions
|
|
35
114
|
|
|
36
115
|
## Usage
|
|
37
116
|
|
|
@@ -188,28 +267,74 @@ interface TabsOptions {
|
|
|
188
267
|
|
|
189
268
|
## Permission Requirements
|
|
190
269
|
|
|
191
|
-
Each Chrome API requires specific permissions in your extension's manifest.json:
|
|
270
|
+
Each Chrome API requires specific permissions in your extension's manifest.json. Here are some common permissions:
|
|
192
271
|
|
|
193
272
|
```json
|
|
194
273
|
{
|
|
195
274
|
"manifest_version": 3,
|
|
196
275
|
"permissions": [
|
|
197
|
-
"
|
|
276
|
+
"activeTab",
|
|
277
|
+
"alarms",
|
|
278
|
+
"audio",
|
|
198
279
|
"bookmarks",
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"
|
|
280
|
+
"browsingData",
|
|
281
|
+
"certificateProvider",
|
|
282
|
+
"contentSettings",
|
|
283
|
+
"contextMenus",
|
|
202
284
|
"cookies",
|
|
203
|
-
"
|
|
285
|
+
"debugger",
|
|
286
|
+
"declarativeContent",
|
|
287
|
+
"declarativeNetRequest",
|
|
288
|
+
"desktopCapture",
|
|
204
289
|
"downloads",
|
|
205
|
-
"
|
|
290
|
+
"fontSettings",
|
|
291
|
+
"gcm",
|
|
292
|
+
"history",
|
|
293
|
+
"identity",
|
|
294
|
+
"idle",
|
|
295
|
+
"management",
|
|
296
|
+
"notifications",
|
|
297
|
+
"offscreen",
|
|
298
|
+
"pageCapture",
|
|
299
|
+
"permissions",
|
|
300
|
+
"platformKeys",
|
|
301
|
+
"power",
|
|
302
|
+
"printing",
|
|
303
|
+
"printingMetrics",
|
|
304
|
+
"proxy",
|
|
305
|
+
"readingList",
|
|
306
|
+
"scripting",
|
|
307
|
+
"search",
|
|
308
|
+
"sessions",
|
|
309
|
+
"sidePanel",
|
|
310
|
+
"storage",
|
|
311
|
+
"system.cpu",
|
|
312
|
+
"system.memory",
|
|
313
|
+
"system.storage",
|
|
314
|
+
"tabCapture",
|
|
315
|
+
"tabGroups",
|
|
316
|
+
"tabs",
|
|
317
|
+
"topSites",
|
|
318
|
+
"tts",
|
|
319
|
+
"ttsEngine",
|
|
320
|
+
"unlimitedStorage",
|
|
321
|
+
"vpnProvider",
|
|
322
|
+
"wallpaper",
|
|
323
|
+
"webAuthenticationProxy",
|
|
324
|
+
"webNavigation",
|
|
325
|
+
"webRequest"
|
|
206
326
|
],
|
|
207
327
|
"host_permissions": [
|
|
208
|
-
"<all_urls>" // Required for scripting API
|
|
328
|
+
"<all_urls>" // Required for scripting API and some other APIs
|
|
329
|
+
],
|
|
330
|
+
"optional_permissions": [
|
|
331
|
+
// Add any permissions you want to request at runtime
|
|
209
332
|
]
|
|
210
333
|
}
|
|
211
334
|
```
|
|
212
335
|
|
|
336
|
+
**Note:** Not all APIs require permissions. Some APIs like `i18n`, `runtime`, and `extension` are available without explicit permissions. Enterprise APIs require the extension to be force-installed via enterprise policy.
|
|
337
|
+
|
|
213
338
|
## Tool Examples
|
|
214
339
|
|
|
215
340
|
### Tab Management
|