scpl-updated-mcp-server 1.0.1 → 1.0.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/index.js +161 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -19,7 +19,167 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
19
19
|
const __dirname = dirname(__filename);
|
|
20
20
|
|
|
21
21
|
// ============================================================================
|
|
22
|
-
//
|
|
22
|
+
// HELP
|
|
23
|
+
// ============================================================================
|
|
24
|
+
if (process.argv.includes("--help") || process.argv.includes("-h")) {
|
|
25
|
+
console.log(`
|
|
26
|
+
ScPL Updated MCP Server - Create macOS Shortcuts with AI
|
|
27
|
+
|
|
28
|
+
USAGE:
|
|
29
|
+
npx scpl-updated-mcp-server [OPTIONS]
|
|
30
|
+
|
|
31
|
+
OPTIONS:
|
|
32
|
+
--setup Auto-install for Claude Code (recommended)
|
|
33
|
+
--setup-codex Auto-install for OpenAI Codex CLI
|
|
34
|
+
--help, -h Show this help message
|
|
35
|
+
|
|
36
|
+
EXAMPLES:
|
|
37
|
+
npx scpl-updated-mcp-server --setup # Install for Claude Code
|
|
38
|
+
npx scpl-updated-mcp-server --setup-codex # Install for Codex
|
|
39
|
+
|
|
40
|
+
After setup, restart your AI coding tool and ask:
|
|
41
|
+
"Create a shortcut that starts a timer and plays a sound"
|
|
42
|
+
`);
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ============================================================================
|
|
47
|
+
// CODEX SETUP: Run with --setup-codex for OpenAI Codex CLI
|
|
48
|
+
// ============================================================================
|
|
49
|
+
if (process.argv.includes("--setup-codex")) {
|
|
50
|
+
console.log("🚀 Setting up ScPL Shortcuts for Codex...\n");
|
|
51
|
+
|
|
52
|
+
const codexConfigPath = join(homedir(), ".codex", "config.toml");
|
|
53
|
+
const skillDir = join(homedir(), ".codex", "skills", "scpl-shortcuts");
|
|
54
|
+
|
|
55
|
+
// Step 1: Add MCP server to ~/.codex/config.toml
|
|
56
|
+
console.log("📝 Step 1: Adding MCP server to ~/.codex/config.toml...");
|
|
57
|
+
try {
|
|
58
|
+
let config = "";
|
|
59
|
+
if (existsSync(codexConfigPath)) {
|
|
60
|
+
config = readFileSync(codexConfigPath, "utf-8");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Check if already configured
|
|
64
|
+
if (config.includes('[mcp_servers."scpl-shortcuts"]') || config.includes('[mcp_servers.scpl-shortcuts]')) {
|
|
65
|
+
console.log(" ⏭️ Already configured, skipping...\n");
|
|
66
|
+
} else {
|
|
67
|
+
const tomlBlock = `
|
|
68
|
+
[mcp_servers.scpl-shortcuts]
|
|
69
|
+
command = "npx"
|
|
70
|
+
args = ["-y", "scpl-updated-mcp-server"]
|
|
71
|
+
startup_timeout_sec = 60.0
|
|
72
|
+
`;
|
|
73
|
+
writeFileSync(codexConfigPath, config + tomlBlock);
|
|
74
|
+
console.log(" ✅ MCP server added!\n");
|
|
75
|
+
}
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(" ❌ Failed to update config:", error.message);
|
|
78
|
+
console.log(" Add this to ~/.codex/config.toml manually:");
|
|
79
|
+
console.log(`
|
|
80
|
+
[mcp_servers.scpl-shortcuts]
|
|
81
|
+
command = "npx"
|
|
82
|
+
args = ["-y", "scpl-updated-mcp-server"]
|
|
83
|
+
startup_timeout_sec = 60.0
|
|
84
|
+
`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Step 2: Install skill to ~/.codex/skills/scpl-shortcuts/
|
|
88
|
+
console.log("📁 Step 2: Installing skill to ~/.codex/skills/scpl-shortcuts/...");
|
|
89
|
+
try {
|
|
90
|
+
mkdirSync(skillDir, { recursive: true });
|
|
91
|
+
|
|
92
|
+
const skillContent = `---
|
|
93
|
+
name: scpl-shortcuts
|
|
94
|
+
description: Create macOS Shortcuts using natural language. Use when users want to create, generate, or build Apple Shortcuts. Converts requests to ScPL code and generates .shortcut files.
|
|
95
|
+
metadata:
|
|
96
|
+
short-description: Create macOS Shortcuts with AI
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
# ScPL Shortcuts Skill
|
|
100
|
+
|
|
101
|
+
Create macOS Shortcuts using natural language with 493 available actions.
|
|
102
|
+
|
|
103
|
+
## MCP Tools Available
|
|
104
|
+
|
|
105
|
+
You have access to the \`scpl-shortcuts\` MCP server with these tools:
|
|
106
|
+
|
|
107
|
+
| Tool | Description |
|
|
108
|
+
|------|-------------|
|
|
109
|
+
| \`create_shortcut\` | Generate a .shortcut file from ScPL code |
|
|
110
|
+
| \`validate_scpl\` | Check if ScPL code is valid before creating |
|
|
111
|
+
| \`list_actions\` | Search available actions by category or keyword |
|
|
112
|
+
|
|
113
|
+
## ScPL Syntax
|
|
114
|
+
|
|
115
|
+
ScPL is line-based. Each line is an action. Parameters use \`key=value\` or \`key="value"\`.
|
|
116
|
+
|
|
117
|
+
\`\`\`scpl
|
|
118
|
+
# Comments start with #
|
|
119
|
+
Text "Hello World"
|
|
120
|
+
ShowResult
|
|
121
|
+
|
|
122
|
+
# Variables
|
|
123
|
+
Text "some value"
|
|
124
|
+
SetVariable v:myVar
|
|
125
|
+
ShowResult v:myVar
|
|
126
|
+
|
|
127
|
+
# AI actions
|
|
128
|
+
AskLLM model="Apple Intelligence" prompt="Summarize this"
|
|
129
|
+
AskChatGPT prompt="Explain this"
|
|
130
|
+
\`\`\`
|
|
131
|
+
|
|
132
|
+
## Popular Actions by Category
|
|
133
|
+
|
|
134
|
+
**AI**: AskLLM, AskChatGPT, AskClaude
|
|
135
|
+
**Clock**: StartStopwatch, StopStopwatch, CreateAlarm
|
|
136
|
+
**Voice Memos**: CreateRecording, PlayRecording
|
|
137
|
+
**System**: SetDarkMode, TakeScreenshot, LockScreen
|
|
138
|
+
**Files**: GetFile, SaveFile, RenameFile, RevealInFinder
|
|
139
|
+
**Scripting**: RunShellScript, RunAppleScript, RunJavaScriptForAutomation
|
|
140
|
+
**Clipboard**: GetClipboard, SetClipboard
|
|
141
|
+
|
|
142
|
+
## Workflow
|
|
143
|
+
|
|
144
|
+
1. User describes what shortcut they want
|
|
145
|
+
2. Use \`list_actions\` if you need to find specific actions
|
|
146
|
+
3. Write ScPL code for the shortcut
|
|
147
|
+
4. Use \`validate_scpl\` to check syntax
|
|
148
|
+
5. Use \`create_shortcut\` to generate the .shortcut file
|
|
149
|
+
6. Tell user to install via Shortcut Source Helper from RoutineHub
|
|
150
|
+
|
|
151
|
+
## Example: Timer with Notification
|
|
152
|
+
|
|
153
|
+
\`\`\`scpl
|
|
154
|
+
# Start a 25-minute Pomodoro timer
|
|
155
|
+
StartTimer minutes=25
|
|
156
|
+
ShowAlert title="Timer Started" message="Focus for 25 minutes!"
|
|
157
|
+
\`\`\`
|
|
158
|
+
|
|
159
|
+
## Example: Clipboard AI Enhancement
|
|
160
|
+
|
|
161
|
+
\`\`\`scpl
|
|
162
|
+
GetClipboard
|
|
163
|
+
SetVariable v:text
|
|
164
|
+
AskChatGPT prompt="Improve this text: \\(v:text)"
|
|
165
|
+
SetClipboard
|
|
166
|
+
ShowAlert title="Done" message="Improved text copied!"
|
|
167
|
+
\`\`\`
|
|
168
|
+
`;
|
|
169
|
+
writeFileSync(join(skillDir, "SKILL.md"), skillContent);
|
|
170
|
+
console.log(" ✅ Skill installed!\n");
|
|
171
|
+
} catch (error) {
|
|
172
|
+
console.error(" ❌ Failed to install skill:", error.message, "\n");
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
console.log("🎉 Setup complete! Restart Codex to use the shortcuts tools.\n");
|
|
176
|
+
console.log("Usage: Just ask Codex to create a shortcut!");
|
|
177
|
+
console.log(' Example: "Create a shortcut that starts a timer and plays a sound"\n');
|
|
178
|
+
process.exit(0);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ============================================================================
|
|
182
|
+
// CLAUDE CODE SETUP: Run with --setup to install everything automatically
|
|
23
183
|
// ============================================================================
|
|
24
184
|
if (process.argv.includes("--setup")) {
|
|
25
185
|
console.log("🚀 Setting up ScPL Shortcuts for Claude Code...\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scpl-updated-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "AI-powered Apple Shortcuts creation with Claude Code! Generate macOS shortcuts using natural language. 493 actions available. MCP server for text-based shortcut programming. Vibe code your automation workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|