@midscene/mcp 0.15.4 → 0.15.5

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.cjs CHANGED
@@ -407,15 +407,15 @@ class MidsceneManager {
407
407
  });
408
408
  this.mcpServer.tool('midscene_aiInput', 'Inputs text into a specified form field or element identified by a natural language selector.', {
409
409
  value: external_zod_namespaceObject.z.string().describe('The text to input'),
410
- selector: external_zod_namespaceObject.z.string().describe('Describe the element to input text into')
411
- }, async ({ value, selector })=>{
410
+ locate: external_zod_namespaceObject.z.string().describe('Describe the element to input text into, use natural language')
411
+ }, async ({ value, locate })=>{
412
412
  const agent = await this.initAgent();
413
- await agent.aiInput(value, selector);
413
+ await agent.aiInput(value, locate);
414
414
  return {
415
415
  content: [
416
416
  {
417
417
  type: 'text',
418
- text: `Inputted ${value} into ${selector}`
418
+ text: `Inputted ${value} into ${locate}`
419
419
  },
420
420
  {
421
421
  type: 'text',
@@ -426,15 +426,15 @@ class MidsceneManager {
426
426
  };
427
427
  });
428
428
  this.mcpServer.tool('midscene_aiHover', 'Moves the mouse cursor to hover over an element identified by a natural language selector.', {
429
- selector: external_zod_namespaceObject.z.string()
430
- }, async ({ selector })=>{
429
+ locate: external_zod_namespaceObject.z.string().describe('Use natural language describe the element to hover over')
430
+ }, async ({ locate })=>{
431
431
  const agent = await this.initAgent();
432
- await agent.aiHover(selector);
432
+ await agent.aiHover(locate);
433
433
  return {
434
434
  content: [
435
435
  {
436
436
  type: 'text',
437
- text: `Hovered over ${selector}`
437
+ text: `Hovered over ${locate}`
438
438
  },
439
439
  {
440
440
  type: 'text',
@@ -505,22 +505,24 @@ const PROMPTS = {
505
505
  (0, utils_namespaceObject.setIsMcp)(true);
506
506
  const src_server = new mcp_js_namespaceObject.McpServer({
507
507
  name: '@midscene/mcp',
508
- version: '0.15.4',
508
+ version: '0.15.5',
509
509
  description: 'Midscene MCP Server: Control the browser using natural language commands for navigation, clicking, input, hovering, and achieving goals. Also supports screenshots and JavaScript execution.'
510
510
  });
511
- src_server.resource('playwright-example', 'generate-code://playwright-example', async (uri)=>({
511
+ src_server.resource('playwright-example', 'file:///playwright-example.mdx', async (uri)=>({
512
512
  contents: [
513
513
  {
514
514
  uri: uri.href,
515
- text: PROMPTS.PLAYWRIGHT_CODE_EXAMPLE
515
+ text: PROMPTS.PLAYWRIGHT_CODE_EXAMPLE,
516
+ mimeType: 'text/plain'
516
517
  }
517
518
  ]
518
519
  }));
519
- src_server.resource('midscene-api-docs', 'generate-code://midscene-api-docs', async (uri)=>({
520
+ src_server.resource('midscene-api-docs', 'file:///midscene-api-docs.mdx', async (uri)=>({
520
521
  contents: [
521
522
  {
522
523
  uri: uri.href,
523
- text: PROMPTS.MIDSCENE_API_DOCS
524
+ text: PROMPTS.MIDSCENE_API_DOCS,
525
+ mimeType: 'text/plain'
524
526
  }
525
527
  ]
526
528
  }));
package/dist/index.js CHANGED
@@ -385,15 +385,15 @@ class MidsceneManager {
385
385
  });
386
386
  this.mcpServer.tool('midscene_aiInput', 'Inputs text into a specified form field or element identified by a natural language selector.', {
387
387
  value: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe('The text to input'),
388
- selector: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe('Describe the element to input text into')
389
- }, async ({ value, selector })=>{
388
+ locate: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe('Describe the element to input text into, use natural language')
389
+ }, async ({ value, locate })=>{
390
390
  const agent = await this.initAgent();
391
- await agent.aiInput(value, selector);
391
+ await agent.aiInput(value, locate);
392
392
  return {
393
393
  content: [
394
394
  {
395
395
  type: 'text',
396
- text: `Inputted ${value} into ${selector}`
396
+ text: `Inputted ${value} into ${locate}`
397
397
  },
398
398
  {
399
399
  type: 'text',
@@ -404,15 +404,15 @@ class MidsceneManager {
404
404
  };
405
405
  });
406
406
  this.mcpServer.tool('midscene_aiHover', 'Moves the mouse cursor to hover over an element identified by a natural language selector.', {
407
- selector: __WEBPACK_EXTERNAL_MODULE_zod__.z.string()
408
- }, async ({ selector })=>{
407
+ locate: __WEBPACK_EXTERNAL_MODULE_zod__.z.string().describe('Use natural language describe the element to hover over')
408
+ }, async ({ locate })=>{
409
409
  const agent = await this.initAgent();
410
- await agent.aiHover(selector);
410
+ await agent.aiHover(locate);
411
411
  return {
412
412
  content: [
413
413
  {
414
414
  type: 'text',
415
- text: `Hovered over ${selector}`
415
+ text: `Hovered over ${locate}`
416
416
  },
417
417
  {
418
418
  type: 'text',
@@ -479,22 +479,24 @@ const PROMPTS = {
479
479
  (0, __WEBPACK_EXTERNAL_MODULE__midscene_shared_utils_b0457388__.setIsMcp)(true);
480
480
  const src_server = new __WEBPACK_EXTERNAL_MODULE__modelcontextprotocol_sdk_server_mcp_js_2c42c5d0__.McpServer({
481
481
  name: '@midscene/mcp',
482
- version: '0.15.4',
482
+ version: '0.15.5',
483
483
  description: 'Midscene MCP Server: Control the browser using natural language commands for navigation, clicking, input, hovering, and achieving goals. Also supports screenshots and JavaScript execution.'
484
484
  });
485
- src_server.resource('playwright-example', 'generate-code://playwright-example', async (uri)=>({
485
+ src_server.resource('playwright-example', 'file:///playwright-example.mdx', async (uri)=>({
486
486
  contents: [
487
487
  {
488
488
  uri: uri.href,
489
- text: PROMPTS.PLAYWRIGHT_CODE_EXAMPLE
489
+ text: PROMPTS.PLAYWRIGHT_CODE_EXAMPLE,
490
+ mimeType: 'text/plain'
490
491
  }
491
492
  ]
492
493
  }));
493
- src_server.resource('midscene-api-docs', 'generate-code://midscene-api-docs', async (uri)=>({
494
+ src_server.resource('midscene-api-docs', 'file:///midscene-api-docs.mdx', async (uri)=>({
494
495
  contents: [
495
496
  {
496
497
  uri: uri.href,
497
- text: PROMPTS.MIDSCENE_API_DOCS
498
+ text: PROMPTS.MIDSCENE_API_DOCS,
499
+ mimeType: 'text/plain'
498
500
  }
499
501
  ]
500
502
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/mcp",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -30,9 +30,9 @@
30
30
  "@modelcontextprotocol/sdk": "1.10.1",
31
31
  "puppeteer": "24.2.0",
32
32
  "zod": "3.24.3",
33
- "@midscene/core": "0.15.4",
34
- "@midscene/web": "0.15.4",
35
- "@midscene/shared": "0.15.4"
33
+ "@midscene/shared": "0.15.5",
34
+ "@midscene/web": "0.15.5",
35
+ "@midscene/core": "0.15.5"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "rslib build",