@olib-ai/owl-browser-mcp 2.0.6 → 2.0.7
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.js +81 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28789,11 +28789,92 @@ var API_ENDPOINT = process.env.OWL_API_ENDPOINT || "http://127.0.0.1:8080";
|
|
|
28789
28789
|
var API_TOKEN = process.env.OWL_API_TOKEN || "";
|
|
28790
28790
|
var activeContexts = /* @__PURE__ */ new Map();
|
|
28791
28791
|
var toolIntegerFields = /* @__PURE__ */ new Map();
|
|
28792
|
+
var MCP_TOOL_WHITELIST = /* @__PURE__ */ new Set([
|
|
28793
|
+
// Context management
|
|
28794
|
+
"browser_create_context",
|
|
28795
|
+
"browser_close_context",
|
|
28796
|
+
"browser_list_contexts",
|
|
28797
|
+
// Navigation
|
|
28798
|
+
"browser_navigate",
|
|
28799
|
+
"browser_reload",
|
|
28800
|
+
"browser_go_back",
|
|
28801
|
+
"browser_go_forward",
|
|
28802
|
+
// Core interaction
|
|
28803
|
+
"browser_click",
|
|
28804
|
+
"browser_type",
|
|
28805
|
+
"browser_clear_input",
|
|
28806
|
+
"browser_press_key",
|
|
28807
|
+
"browser_keyboard_combo",
|
|
28808
|
+
"browser_pick",
|
|
28809
|
+
"browser_submit_form",
|
|
28810
|
+
"browser_focus",
|
|
28811
|
+
"browser_select_all",
|
|
28812
|
+
"browser_upload_file",
|
|
28813
|
+
// Content reading
|
|
28814
|
+
"browser_extract_text",
|
|
28815
|
+
"browser_screenshot",
|
|
28816
|
+
"browser_get_html",
|
|
28817
|
+
"browser_get_markdown",
|
|
28818
|
+
"browser_get_page_map",
|
|
28819
|
+
"browser_get_page_info",
|
|
28820
|
+
// Element state & discovery
|
|
28821
|
+
"browser_is_visible",
|
|
28822
|
+
"browser_is_enabled",
|
|
28823
|
+
"browser_is_checked",
|
|
28824
|
+
"browser_get_attribute",
|
|
28825
|
+
"browser_get_bounding_box",
|
|
28826
|
+
"browser_count_elements",
|
|
28827
|
+
"browser_find_element",
|
|
28828
|
+
// Scroll
|
|
28829
|
+
"browser_scroll_by",
|
|
28830
|
+
"browser_scroll_to_element",
|
|
28831
|
+
"browser_scroll_to_top",
|
|
28832
|
+
"browser_scroll_to_bottom",
|
|
28833
|
+
// Wait
|
|
28834
|
+
"browser_wait_for_selector",
|
|
28835
|
+
"browser_wait",
|
|
28836
|
+
"browser_wait_for_network_idle",
|
|
28837
|
+
"browser_wait_for_url",
|
|
28838
|
+
"browser_wait_for_function",
|
|
28839
|
+
// JavaScript & debug
|
|
28840
|
+
"browser_evaluate",
|
|
28841
|
+
"browser_get_console_log",
|
|
28842
|
+
"browser_clear_console_log",
|
|
28843
|
+
"browser_highlight",
|
|
28844
|
+
// Tabs
|
|
28845
|
+
"browser_get_tabs",
|
|
28846
|
+
"browser_switch_tab",
|
|
28847
|
+
"browser_new_tab",
|
|
28848
|
+
"browser_close_tab",
|
|
28849
|
+
"browser_get_active_tab",
|
|
28850
|
+
// Frames
|
|
28851
|
+
"browser_list_frames",
|
|
28852
|
+
"browser_switch_to_frame",
|
|
28853
|
+
"browser_switch_to_main_frame",
|
|
28854
|
+
// Dialogs
|
|
28855
|
+
"browser_set_dialog_action",
|
|
28856
|
+
"browser_handle_dialog",
|
|
28857
|
+
"browser_get_pending_dialog",
|
|
28858
|
+
// Cookies
|
|
28859
|
+
"browser_get_cookies",
|
|
28860
|
+
"browser_set_cookie",
|
|
28861
|
+
"browser_delete_cookies",
|
|
28862
|
+
// Network debug
|
|
28863
|
+
"browser_get_network_log",
|
|
28864
|
+
"browser_enable_network_logging",
|
|
28865
|
+
"browser_get_headers",
|
|
28866
|
+
// Viewport
|
|
28867
|
+
"browser_set_viewport",
|
|
28868
|
+
"browser_reset_viewport",
|
|
28869
|
+
// HTTP client
|
|
28870
|
+
"http_request"
|
|
28871
|
+
]);
|
|
28792
28872
|
function convertOpenAPIToMCPTools(schema) {
|
|
28793
28873
|
const tools = [];
|
|
28794
28874
|
for (const [path, pathItem] of Object.entries(schema.paths)) {
|
|
28795
28875
|
if (!pathItem.post) continue;
|
|
28796
28876
|
const toolName = path.replace("/api/execute/", "");
|
|
28877
|
+
if (!MCP_TOOL_WHITELIST.has(toolName)) continue;
|
|
28797
28878
|
const operation = pathItem.post;
|
|
28798
28879
|
const requestSchema = operation.requestBody?.content?.["application/json"]?.schema;
|
|
28799
28880
|
const inputSchema = {
|