oxylabs-ai-studio-mcp 1.0.0 → 1.0.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/package.json +12 -3
- package/server.js +17 -17
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "oxylabs-ai-studio-mcp",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.2",
|
4
4
|
"scripts": {
|
5
5
|
"lint": "eslint ."
|
6
6
|
},
|
@@ -8,7 +8,16 @@
|
|
8
8
|
"mcp",
|
9
9
|
"oxylabs",
|
10
10
|
"ai",
|
11
|
-
"studio"
|
11
|
+
"studio",
|
12
|
+
"ai-studio",
|
13
|
+
"scraping",
|
14
|
+
"ai-scrape",
|
15
|
+
"ai-crawl",
|
16
|
+
"ai-browser-agent",
|
17
|
+
"crawl",
|
18
|
+
"scrape",
|
19
|
+
"browser",
|
20
|
+
"search"
|
12
21
|
],
|
13
22
|
"author": "Oxylabs",
|
14
23
|
"license": "MIT",
|
@@ -19,7 +28,7 @@
|
|
19
28
|
},
|
20
29
|
"dependencies": {
|
21
30
|
"fastmcp": "^3.3.1",
|
22
|
-
"oxylabs-ai-studio": "^1.0.
|
31
|
+
"oxylabs-ai-studio": "^1.0.12",
|
23
32
|
"zod": "^3.25.67"
|
24
33
|
},
|
25
34
|
"files": [
|
package/server.js
CHANGED
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
|
9
9
|
|
10
10
|
const api_key = process.env.OXYLABS_AI_STUDIO_API_KEY;
|
11
|
-
const api_url = process.env.OXYLABS_AI_STUDIO_API_URL || 'https://api-aistudio.oxylabs.io
|
11
|
+
const api_url = process.env.OXYLABS_AI_STUDIO_API_URL || 'https://api-aistudio.oxylabs.io';
|
12
12
|
|
13
13
|
|
14
14
|
if (!api_key) {
|
@@ -35,17 +35,17 @@ server.addTool({
|
|
35
35
|
description: "Generates json schema in openapi format from provided prompt.",
|
36
36
|
parameters: z.object({
|
37
37
|
user_prompt: z.string(),
|
38
|
-
app_name: z.enum(["
|
38
|
+
app_name: z.enum(["ai_crawler", "ai_scraper", "browser_agent"]),
|
39
39
|
}),
|
40
40
|
execute: async (args) => {
|
41
|
-
if (args.app_name === '
|
42
|
-
const response = await sdk.
|
41
|
+
if (args.app_name === 'ai_scraper') {
|
42
|
+
const response = await sdk.aiScraper.generateSchema({ user_prompt: args.user_prompt });
|
43
43
|
return JSON.stringify(response);
|
44
|
-
} else if (args.app_name === '
|
45
|
-
const response = await sdk.
|
44
|
+
} else if (args.app_name === 'ai_crawler') {
|
45
|
+
const response = await sdk.aiCrawler.generateSchema({ user_prompt: args.user_prompt });
|
46
46
|
return JSON.stringify(response);
|
47
47
|
} else if (args.app_name === 'browser_agent') {
|
48
|
-
const response = await sdk.
|
48
|
+
const response = await sdk.browserAgent.generateSchema({ user_prompt: args.user_prompt });
|
49
49
|
return JSON.stringify(response);
|
50
50
|
} else {
|
51
51
|
throw new Error(`Invalid app name ${args.app_name}`);
|
@@ -55,7 +55,7 @@ server.addTool({
|
|
55
55
|
|
56
56
|
|
57
57
|
server.addTool({
|
58
|
-
name: "
|
58
|
+
name: "ai_scraper",
|
59
59
|
description: `
|
60
60
|
Scrape the contents of the web page and return the data in the specified format.
|
61
61
|
Schema is required only if output_format is json.
|
@@ -84,10 +84,10 @@ Parameters:
|
|
84
84
|
openapi_schema: args.schema,
|
85
85
|
render_html: args.render_javascript };
|
86
86
|
if (args.output_format === 'json' && !args.schema) {
|
87
|
-
const response = await sdk.
|
87
|
+
const response = await sdk.aiScraper.scrapeWithAutoSchema(payload);
|
88
88
|
return JSON.stringify({ content: response.data });
|
89
89
|
}
|
90
|
-
const response = await sdk.
|
90
|
+
const response = await sdk.aiScraper.scrape(payload);
|
91
91
|
return JSON.stringify({ content: response.data });
|
92
92
|
} catch (error) {
|
93
93
|
console.error(error);
|
@@ -97,7 +97,7 @@ Parameters:
|
|
97
97
|
});
|
98
98
|
|
99
99
|
server.addTool({
|
100
|
-
name: "
|
100
|
+
name: "ai_crawler",
|
101
101
|
description: `
|
102
102
|
Tool useful for crawling a website from starting url and returning data in a specified format.
|
103
103
|
Schema is required only if output_format is json.
|
@@ -130,7 +130,7 @@ Parameters:
|
|
130
130
|
render_html: args.render_javascript,
|
131
131
|
max_pages: args.return_sources_limit,
|
132
132
|
}
|
133
|
-
const response = await sdk.
|
133
|
+
const response = await sdk.aiCrawler.crawlWithAutoSchema(payload);
|
134
134
|
return JSON.stringify({ content: response.data });
|
135
135
|
}
|
136
136
|
const payload = {
|
@@ -140,7 +140,7 @@ Parameters:
|
|
140
140
|
openapi_schema: args.schema,
|
141
141
|
render_html: args.render_javascript,
|
142
142
|
max_pages: args.return_sources_limit };
|
143
|
-
const response = await sdk.
|
143
|
+
const response = await sdk.aiCrawler.crawl(payload);
|
144
144
|
return JSON.stringify({ content: response.data });
|
145
145
|
} catch (error) {
|
146
146
|
console.error(error);
|
@@ -150,7 +150,7 @@ Parameters:
|
|
150
150
|
});
|
151
151
|
|
152
152
|
server.addTool({
|
153
|
-
name: "
|
153
|
+
name: "browser_agent",
|
154
154
|
description: `
|
155
155
|
Run the browser agent and return the data in the specified format.
|
156
156
|
This tool is useful if you need navigate around the website and do some actions.
|
@@ -179,15 +179,15 @@ Parameters:
|
|
179
179
|
output_format: args.output_format,
|
180
180
|
parse_prompt: args.browse_prompt,
|
181
181
|
openapi_schema: args.schema };
|
182
|
-
const response = await sdk.
|
182
|
+
const response = await sdk.browserAgent.browseWithAutoSchema(payload, 240000);
|
183
183
|
return JSON.stringify({ content: response.data });
|
184
184
|
}
|
185
185
|
const payload = {
|
186
186
|
url: args.url,
|
187
187
|
browse_prompt: args.browse_prompt,
|
188
188
|
output_format: args.output_format,
|
189
|
-
|
190
|
-
const response = await sdk.
|
189
|
+
openapi_schema: args.schema };
|
190
|
+
const response = await sdk.browserAgent.browse(payload, 240000);
|
191
191
|
return JSON.stringify({ content: response.data });
|
192
192
|
} catch (error) {
|
193
193
|
console.error(error);
|