sweetspot-remote-agent 1.6.0 → 1.7.0
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/mcp-server.js +15 -0
- package/package.json +1 -1
package/mcp-server.js
CHANGED
|
@@ -125,6 +125,21 @@ function createServer() {
|
|
|
125
125
|
return { content: [{ type: "text", text: JSON.stringify(info, null, 2) }] };
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
// ── AppleScript 실행 (macOS 전용, 앱 직접 제어) ──
|
|
129
|
+
srv.tool("applescript", "AppleScript 실행 (macOS). 메모 작성, 앱 내부 조작 등에 사용", {
|
|
130
|
+
script: z.string().describe("실행할 AppleScript 코드"),
|
|
131
|
+
}, async ({ script }) => {
|
|
132
|
+
const { execSync } = await import("child_process");
|
|
133
|
+
try {
|
|
134
|
+
const output = execSync(`osascript -e '${script.replace(/'/g, "'\\''")}'`, {
|
|
135
|
+
timeout: 15000, encoding: "utf-8", maxBuffer: 1024 * 1024,
|
|
136
|
+
});
|
|
137
|
+
return { content: [{ type: "text", text: output || "(실행 완료)" }] };
|
|
138
|
+
} catch (e) {
|
|
139
|
+
return { content: [{ type: "text", text: `AppleScript 오류: ${e.message}` }] };
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
128
143
|
return srv;
|
|
129
144
|
}
|
|
130
145
|
|