@goforgeit/mcp-macos-automation 0.5.2 → 0.5.3

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 CHANGED
@@ -6,6 +6,8 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
6
6
  import { z } from "zod";
7
7
  import { execFile } from "child_process";
8
8
  import { promisify } from "util";
9
+ import { realpathSync } from "fs";
10
+ import { fileURLToPath } from "url";
9
11
  var execFileAsync = promisify(execFile);
10
12
  var OSASCRIPT_TIMEOUT = 3e4;
11
13
  var MAX_BUFFER = 1024 * 1024;
@@ -391,7 +393,13 @@ function createMacOSAutomationMCPServer() {
391
393
  }
392
394
  };
393
395
  }
394
- var isMainModule = process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/"));
396
+ var isMainModule = (() => {
397
+ try {
398
+ return process.argv[1] && fileURLToPath(import.meta.url) === realpathSync(process.argv[1]);
399
+ } catch {
400
+ return false;
401
+ }
402
+ })();
395
403
  if (isMainModule || process.env.FORGE_MCP_START === "true") {
396
404
  const mcpServer = createMacOSAutomationMCPServer();
397
405
  mcpServer.start().catch((err) => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @goforgeit/mcp-macos-automation\n *\n * Forge MCP server for macOS automation.\n * Provides general AppleScript/JXA execution, plus dedicated tools\n * for Microsoft PowerPoint and Microsoft Word via osascript.\n */\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { execFile } from 'child_process';\nimport { promisify } from 'util';\n\nconst execFileAsync = promisify(execFile);\n\nconst OSASCRIPT_TIMEOUT = 30000;\nconst MAX_BUFFER = 1024 * 1024;\n\nexport interface MacOSAutomationMCPServer {\n server: McpServer;\n getRegisteredTools(): string[];\n start(): Promise<void>;\n}\n\nexport async function runAppleScript(script: string, timeout = OSASCRIPT_TIMEOUT): Promise<string> {\n const { stdout } = await execFileAsync('osascript', ['-e', script], {\n timeout,\n maxBuffer: MAX_BUFFER,\n });\n return stdout.trim();\n}\n\nasync function runJxa(script: string, timeout = OSASCRIPT_TIMEOUT): Promise<string> {\n const { stdout } = await execFileAsync('osascript', ['-l', 'JavaScript', '-e', script], {\n timeout,\n maxBuffer: MAX_BUFFER,\n });\n return stdout.trim();\n}\n\nexport function createMacOSAutomationMCPServer(): MacOSAutomationMCPServer {\n const server = new McpServer({\n name: '@goforgeit/mcp-macos-automation',\n version: '0.1.0',\n });\n\n const registeredTools: string[] = [];\n\n // ============================================================\n // General AppleScript Tools\n // ============================================================\n\n // --- run_applescript ---\n server.tool(\n 'run_applescript',\n 'Execute arbitrary AppleScript code via osascript. Returns the script output as text.',\n {\n script: z.string().describe('The AppleScript code to execute'),\n timeout: z\n .number()\n .optional()\n .default(OSASCRIPT_TIMEOUT)\n .describe('Execution timeout in milliseconds (default: 30000)'),\n },\n async ({ script, timeout }) => {\n try {\n const result = await runAppleScript(script, timeout);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `AppleScript error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('run_applescript');\n\n // --- run_jxa ---\n server.tool(\n 'run_jxa',\n 'Execute JavaScript for Automation (JXA) code via osascript -l JavaScript. Returns the script output as text.',\n {\n script: z.string().describe('The JXA (JavaScript for Automation) code to execute'),\n timeout: z\n .number()\n .optional()\n .default(OSASCRIPT_TIMEOUT)\n .describe('Execution timeout in milliseconds (default: 30000)'),\n },\n async ({ script, timeout }) => {\n try {\n const result = await runJxa(script, timeout);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `JXA error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('run_jxa');\n\n // ============================================================\n // PowerPoint Tools\n // ============================================================\n\n // --- list_presentations ---\n server.tool(\n 'list_presentations',\n 'List all currently open Microsoft PowerPoint presentations with their names and slide counts',\n {},\n async () => {\n const script = `\n tell application \"Microsoft PowerPoint\"\n set output to \"[\"\n set isFirst to true\n repeat with pres in presentations\n if not isFirst then\n set output to output & \",\"\n end if\n set presName to name of pres\n set slideCount to count of slides of pres\n set output to output & \"{\\\\\"name\\\\\":\\\\\"\" & presName & \"\\\\\",\\\\\"slides\\\\\":\" & slideCount & \"}\"\n set isFirst to false\n end repeat\n return output & \"]\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to list presentations: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('list_presentations');\n\n // --- get_slide_content ---\n server.tool(\n 'get_slide_content',\n 'Read text content and notes from a specific slide in the active PowerPoint presentation',\n {\n slide_number: z.number().describe('Slide number (1-indexed)'),\n },\n async ({ slide_number }) => {\n const script = `\n tell application \"Microsoft PowerPoint\"\n if (count of presentations) = 0 then\n return \"No presentation is open\"\n end if\n set activePres to active presentation\n set targetSlide to slide ${slide_number} of activePres\n set slideText to \"\"\n repeat with shp in shapes of targetSlide\n if has text frame shp then\n set slideText to slideText & (content of text range of text frame of shp) & return\n end if\n end repeat\n return slideText\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to get slide content: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('get_slide_content');\n\n // --- create_presentation ---\n server.tool(\n 'create_presentation',\n 'Create a new PowerPoint presentation with a title slide',\n {\n title: z.string().optional().describe('Title for the first slide'),\n },\n async ({ title }) => {\n const titlePart = title\n ? `\n set targetSlide to slide 1 of activePres\n set content of text range of text frame of shape 1 of targetSlide to ${JSON.stringify(title)}`\n : '';\n\n const script = `\n tell application \"Microsoft PowerPoint\"\n activate\n set activePres to make new presentation\n ${titlePart}\n return \"New presentation created successfully\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to create presentation: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('create_presentation');\n\n // --- add_slide ---\n server.tool(\n 'add_slide',\n 'Add a new slide with optional content to an open PowerPoint presentation',\n {\n title: z.string().optional().describe('Slide title text'),\n body: z.string().optional().describe('Slide body text'),\n layout: z\n .enum(['title', 'title_content', 'blank'])\n .optional()\n .default('title_content')\n .describe('Slide layout type'),\n },\n async ({ title, body, layout }) => {\n const layoutMap: Record<string, string> = {\n title: 'slide layout title slide',\n title_content: 'slide layout title only',\n blank: 'slide layout blank',\n };\n const pptLayout = layoutMap[layout];\n\n const titlePart = title\n ? `set content of text range of text frame of shape 1 of newSlide to ${JSON.stringify(title)}`\n : '';\n const bodyPart = body\n ? `set content of text range of text frame of shape 2 of newSlide to ${JSON.stringify(body)}`\n : '';\n\n const script = `\n tell application \"Microsoft PowerPoint\"\n if (count of presentations) = 0 then\n return \"No presentation is open\"\n end if\n set activePres to active presentation\n set newSlide to make new slide at end of activePres with properties {slide layout:${pptLayout}}\n ${titlePart}\n ${bodyPart}\n return \"Slide added successfully\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to add slide: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('add_slide');\n\n // ============================================================\n // Word Tools\n // ============================================================\n\n // --- list_documents ---\n server.tool(\n 'list_documents',\n 'List all currently open Microsoft Word documents with their names',\n {},\n async () => {\n const script = `\n tell application \"Microsoft Word\"\n set output to \"[\"\n set isFirst to true\n repeat with doc in documents\n if not isFirst then\n set output to output & \",\"\n end if\n set docName to name of doc\n set output to output & \"{\\\\\"name\\\\\":\\\\\"\" & docName & \"\\\\\"}\"\n set isFirst to false\n end repeat\n return output & \"]\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to list documents: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('list_documents');\n\n // --- get_document_content ---\n server.tool(\n 'get_document_content',\n 'Read all text content from the active Microsoft Word document',\n {},\n async () => {\n const script = `\n tell application \"Microsoft Word\"\n if (count of documents) = 0 then\n return \"No document is open\"\n end if\n set activeDoc to active document\n return content of text object of activeDoc as string\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to get document content: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('get_document_content');\n\n // --- create_document ---\n server.tool(\n 'create_document',\n 'Create a new Microsoft Word document with optional initial content',\n {\n content: z.string().optional().describe('Initial text content for the document'),\n },\n async ({ content: docContent }) => {\n const contentPart = docContent\n ? `\n tell newDoc\n set content of text object to ${JSON.stringify(docContent)}\n end tell`\n : '';\n\n const script = `\n tell application \"Microsoft Word\"\n activate\n set newDoc to make new document\n ${contentPart}\n return \"New document created successfully\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to create document: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('create_document');\n\n // --- search_in_document ---\n server.tool(\n 'search_in_document',\n 'Find text in the active Microsoft Word document. Returns whether the text was found.',\n {\n query: z.string().describe('Text to search for in the document'),\n },\n async ({ query }) => {\n const script = `\n tell application \"Microsoft Word\"\n if (count of documents) = 0 then\n return \"No document is open\"\n end if\n set activeDoc to active document\n set docText to content of text object of activeDoc as string\n if docText contains ${JSON.stringify(query)} then\n return \"Found: \" & ${JSON.stringify(query)}\n else\n return \"Not found: \" & ${JSON.stringify(query)}\n end if\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to search document: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('search_in_document');\n\n return {\n server,\n getRegisteredTools() {\n return [...registeredTools];\n },\n async start() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n };\n}\n\n// CLI entry point\nconst isMainModule =\n process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\\\/g, '/'));\n\nif (isMainModule || process.env.FORGE_MCP_START === 'true') {\n const mcpServer = createMacOSAutomationMCPServer();\n mcpServer.start().catch((err) => {\n console.error('Failed to start macOS Automation MCP server:', err);\n process.exit(1);\n });\n}\n"],"mappings":";;;AAOA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAClB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAE1B,IAAM,gBAAgB,UAAU,QAAQ;AAExC,IAAM,oBAAoB;AAC1B,IAAM,aAAa,OAAO;AAQ1B,eAAsB,eAAe,QAAgB,UAAU,mBAAoC;AACjG,QAAM,EAAE,OAAO,IAAI,MAAM,cAAc,aAAa,CAAC,MAAM,MAAM,GAAG;AAAA,IAClE;AAAA,IACA,WAAW;AAAA,EACb,CAAC;AACD,SAAO,OAAO,KAAK;AACrB;AAEA,eAAe,OAAO,QAAgB,UAA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AAM,YAAY,+BAA+B;AACjD,YAAU,MAAM,EAAE,MAAM,CAAC,QAAQ;AAC/B,YAAQ,MAAM,gDAAgD,GAAG;AACjE,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @goforgeit/mcp-macos-automation\n *\n * Forge MCP server for macOS automation.\n * Provides general AppleScript/JXA execution, plus dedicated tools\n * for Microsoft PowerPoint and Microsoft Word via osascript.\n */\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { execFile } from 'child_process';\nimport { promisify } from 'util';\n\nconst execFileAsync = promisify(execFile);\n\nconst OSASCRIPT_TIMEOUT = 30000;\nconst MAX_BUFFER = 1024 * 1024;\n\nexport interface MacOSAutomationMCPServer {\n server: McpServer;\n getRegisteredTools(): string[];\n start(): Promise<void>;\n}\n\nexport async function runAppleScript(script: string, timeout = OSASCRIPT_TIMEOUT): Promise<string> {\n const { stdout } = await execFileAsync('osascript', ['-e', script], {\n timeout,\n maxBuffer: MAX_BUFFER,\n });\n return stdout.trim();\n}\n\nasync function runJxa(script: string, timeout = OSASCRIPT_TIMEOUT): Promise<string> {\n const { stdout } = await execFileAsync('osascript', ['-l', 'JavaScript', '-e', script], {\n timeout,\n maxBuffer: MAX_BUFFER,\n });\n return stdout.trim();\n}\n\nexport function createMacOSAutomationMCPServer(): MacOSAutomationMCPServer {\n const server = new McpServer({\n name: '@goforgeit/mcp-macos-automation',\n version: '0.1.0',\n });\n\n const registeredTools: string[] = [];\n\n // ============================================================\n // General AppleScript Tools\n // ============================================================\n\n // --- run_applescript ---\n server.tool(\n 'run_applescript',\n 'Execute arbitrary AppleScript code via osascript. Returns the script output as text.',\n {\n script: z.string().describe('The AppleScript code to execute'),\n timeout: z\n .number()\n .optional()\n .default(OSASCRIPT_TIMEOUT)\n .describe('Execution timeout in milliseconds (default: 30000)'),\n },\n async ({ script, timeout }) => {\n try {\n const result = await runAppleScript(script, timeout);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `AppleScript error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('run_applescript');\n\n // --- run_jxa ---\n server.tool(\n 'run_jxa',\n 'Execute JavaScript for Automation (JXA) code via osascript -l JavaScript. Returns the script output as text.',\n {\n script: z.string().describe('The JXA (JavaScript for Automation) code to execute'),\n timeout: z\n .number()\n .optional()\n .default(OSASCRIPT_TIMEOUT)\n .describe('Execution timeout in milliseconds (default: 30000)'),\n },\n async ({ script, timeout }) => {\n try {\n const result = await runJxa(script, timeout);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `JXA error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('run_jxa');\n\n // ============================================================\n // PowerPoint Tools\n // ============================================================\n\n // --- list_presentations ---\n server.tool(\n 'list_presentations',\n 'List all currently open Microsoft PowerPoint presentations with their names and slide counts',\n {},\n async () => {\n const script = `\n tell application \"Microsoft PowerPoint\"\n set output to \"[\"\n set isFirst to true\n repeat with pres in presentations\n if not isFirst then\n set output to output & \",\"\n end if\n set presName to name of pres\n set slideCount to count of slides of pres\n set output to output & \"{\\\\\"name\\\\\":\\\\\"\" & presName & \"\\\\\",\\\\\"slides\\\\\":\" & slideCount & \"}\"\n set isFirst to false\n end repeat\n return output & \"]\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to list presentations: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('list_presentations');\n\n // --- get_slide_content ---\n server.tool(\n 'get_slide_content',\n 'Read text content and notes from a specific slide in the active PowerPoint presentation',\n {\n slide_number: z.number().describe('Slide number (1-indexed)'),\n },\n async ({ slide_number }) => {\n const script = `\n tell application \"Microsoft PowerPoint\"\n if (count of presentations) = 0 then\n return \"No presentation is open\"\n end if\n set activePres to active presentation\n set targetSlide to slide ${slide_number} of activePres\n set slideText to \"\"\n repeat with shp in shapes of targetSlide\n if has text frame shp then\n set slideText to slideText & (content of text range of text frame of shp) & return\n end if\n end repeat\n return slideText\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to get slide content: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('get_slide_content');\n\n // --- create_presentation ---\n server.tool(\n 'create_presentation',\n 'Create a new PowerPoint presentation with a title slide',\n {\n title: z.string().optional().describe('Title for the first slide'),\n },\n async ({ title }) => {\n const titlePart = title\n ? `\n set targetSlide to slide 1 of activePres\n set content of text range of text frame of shape 1 of targetSlide to ${JSON.stringify(title)}`\n : '';\n\n const script = `\n tell application \"Microsoft PowerPoint\"\n activate\n set activePres to make new presentation\n ${titlePart}\n return \"New presentation created successfully\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to create presentation: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('create_presentation');\n\n // --- add_slide ---\n server.tool(\n 'add_slide',\n 'Add a new slide with optional content to an open PowerPoint presentation',\n {\n title: z.string().optional().describe('Slide title text'),\n body: z.string().optional().describe('Slide body text'),\n layout: z\n .enum(['title', 'title_content', 'blank'])\n .optional()\n .default('title_content')\n .describe('Slide layout type'),\n },\n async ({ title, body, layout }) => {\n const layoutMap: Record<string, string> = {\n title: 'slide layout title slide',\n title_content: 'slide layout title only',\n blank: 'slide layout blank',\n };\n const pptLayout = layoutMap[layout];\n\n const titlePart = title\n ? `set content of text range of text frame of shape 1 of newSlide to ${JSON.stringify(title)}`\n : '';\n const bodyPart = body\n ? `set content of text range of text frame of shape 2 of newSlide to ${JSON.stringify(body)}`\n : '';\n\n const script = `\n tell application \"Microsoft PowerPoint\"\n if (count of presentations) = 0 then\n return \"No presentation is open\"\n end if\n set activePres to active presentation\n set newSlide to make new slide at end of activePres with properties {slide layout:${pptLayout}}\n ${titlePart}\n ${bodyPart}\n return \"Slide added successfully\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to add slide: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('add_slide');\n\n // ============================================================\n // Word Tools\n // ============================================================\n\n // --- list_documents ---\n server.tool(\n 'list_documents',\n 'List all currently open Microsoft Word documents with their names',\n {},\n async () => {\n const script = `\n tell application \"Microsoft Word\"\n set output to \"[\"\n set isFirst to true\n repeat with doc in documents\n if not isFirst then\n set output to output & \",\"\n end if\n set docName to name of doc\n set output to output & \"{\\\\\"name\\\\\":\\\\\"\" & docName & \"\\\\\"}\"\n set isFirst to false\n end repeat\n return output & \"]\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to list documents: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('list_documents');\n\n // --- get_document_content ---\n server.tool(\n 'get_document_content',\n 'Read all text content from the active Microsoft Word document',\n {},\n async () => {\n const script = `\n tell application \"Microsoft Word\"\n if (count of documents) = 0 then\n return \"No document is open\"\n end if\n set activeDoc to active document\n return content of text object of activeDoc as string\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to get document content: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('get_document_content');\n\n // --- create_document ---\n server.tool(\n 'create_document',\n 'Create a new Microsoft Word document with optional initial content',\n {\n content: z.string().optional().describe('Initial text content for the document'),\n },\n async ({ content: docContent }) => {\n const contentPart = docContent\n ? `\n tell newDoc\n set content of text object to ${JSON.stringify(docContent)}\n end tell`\n : '';\n\n const script = `\n tell application \"Microsoft Word\"\n activate\n set newDoc to make new document\n ${contentPart}\n return \"New document created successfully\"\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to create document: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('create_document');\n\n // --- search_in_document ---\n server.tool(\n 'search_in_document',\n 'Find text in the active Microsoft Word document. Returns whether the text was found.',\n {\n query: z.string().describe('Text to search for in the document'),\n },\n async ({ query }) => {\n const script = `\n tell application \"Microsoft Word\"\n if (count of documents) = 0 then\n return \"No document is open\"\n end if\n set activeDoc to active document\n set docText to content of text object of activeDoc as string\n if docText contains ${JSON.stringify(query)} then\n return \"Found: \" & ${JSON.stringify(query)}\n else\n return \"Not found: \" & ${JSON.stringify(query)}\n end if\n end tell\n `;\n try {\n const result = await runAppleScript(script);\n return { content: [{ type: 'text' as const, text: result }] };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: `Failed to search document: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true,\n };\n }\n },\n );\n registeredTools.push('search_in_document');\n\n return {\n server,\n getRegisteredTools() {\n return [...registeredTools];\n },\n async start() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n };\n}\n\n// CLI entry point\nimport { realpathSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nconst isMainModule = (() => {\n try {\n return process.argv[1] &&\n fileURLToPath(import.meta.url) === realpathSync(process.argv[1]);\n } catch { return false; }\n})();\n\nif (isMainModule || process.env.FORGE_MCP_START === 'true') {\n const mcpServer = createMacOSAutomationMCPServer();\n mcpServer.start().catch((err) => {\n console.error('Failed to start macOS Automation MCP server:', err);\n process.exit(1);\n });\n}\n"],"mappings":";;;AAOA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AACrC,SAAS,SAAS;AAClB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAyc1B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAxc9B,IAAM,gBAAgB,UAAU,QAAQ;AAExC,IAAM,oBAAoB;AAC1B,IAAM,aAAa,OAAO;AAQ1B,eAAsB,eAAe,QAAgB,UAAU,mBAAoC;AACjG,QAAM,EAAE,OAAO,IAAI,MAAM,cAAc,aAAa,CAAC,MAAM,MAAM,GAAG;AAAA,IAClE;AAAA,IACA,WAAW;AAAA,EACb,CAAC;AACD,SAAO,OAAO,KAAK;AACrB;AAEA,eAAe,OAAO,QAAgB,UAAU,mBAAoC;AAClF,QAAM,EAAE,OAAO,IAAI,MAAM,cAAc,aAAa,CAAC,MAAM,cAAc,MAAM,MAAM,GAAG;AAAA,IACtF;AAAA,IACA,WAAW;AAAA,EACb,CAAC;AACD,SAAO,OAAO,KAAK;AACrB;AAEO,SAAS,iCAA2D;AACzE,QAAM,SAAS,IAAI,UAAU;AAAA,IAC3B,MAAM;AAAA,IACN,SAAS;AAAA,EACX,CAAC;AAED,QAAM,kBAA4B,CAAC;AAOnC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ,EAAE,OAAO,EAAE,SAAS,iCAAiC;AAAA,MAC7D,SAAS,EACN,OAAO,EACP,SAAS,EACT,QAAQ,iBAAiB,EACzB,SAAS,oDAAoD;AAAA,IAClE;AAAA,IACA,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S,MAAM,eAAe,MAAM;AAC1C,eAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAiB,MAAM,OAAO,CAAC,EAAE;AAAA,MAC9D,SAAS,OAAO;AACd,eAAO;AAAA,UACL,SAAS;AAAA,YACP;AAAA,cACE,MAAM;AAAA,cACN,MAAM,8BAA8B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,YAC5F;AAAA,UACF;AAAA,UACA,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,kBAAgB,KAAK,oBAAoB;AAEzC,SAAO;AAAA,IACL;AAAA,IACA,qBAAqB;AACnB,aAAO,CAAC,GAAG,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,QAAQ;AACZ,YAAM,YAAY,IAAI,qBAAqB;AAC3C,YAAM,OAAO,QAAQ,SAAS;AAAA,IAChC;AAAA,EACF;AACF;AAKA,IAAM,gBAAgB,MAAM;AAC1B,MAAI;AACF,WAAO,QAAQ,KAAK,CAAC,KACnB,cAAc,YAAY,GAAG,MAAM,aAAa,QAAQ,KAAK,CAAC,CAAC;AAAA,EACnE,QAAQ;AAAE,WAAO;AAAA,EAAO;AAC1B,GAAG;AAEH,IAAI,gBAAgB,QAAQ,IAAI,oBAAoB,QAAQ;AAC1D,QAAM,YAAY,+BAA+B;AACjD,YAAU,MAAM,EAAE,MAAM,CAAC,QAAQ;AAC/B,YAAQ,MAAM,gDAAgD,GAAG;AACjE,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goforgeit/mcp-macos-automation",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "description": "Forge MCP server for macOS automation — AppleScript, JXA, Microsoft PowerPoint, and Microsoft Word via osascript",
6
6
  "bin": {