scpl-updated-mcp-server 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/index.js +105 -36
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -29,13 +29,19 @@ USAGE:
29
29
  npx scpl-updated-mcp-server [OPTIONS]
30
30
 
31
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
32
+ --setup Auto-install for Claude Code
33
+ --setup-codex Auto-install for OpenAI Codex CLI (~/.codex)
34
+ --setup-codex=<dir> Auto-install for Codex forks with custom directory
35
+ --help, -h Show this help message
35
36
 
36
37
  EXAMPLES:
37
- npx scpl-updated-mcp-server --setup # Install for Claude Code
38
- npx scpl-updated-mcp-server --setup-codex # Install for Codex
38
+ npx scpl-updated-mcp-server --setup
39
+ npx scpl-updated-mcp-server --setup-codex
40
+ npx scpl-updated-mcp-server --setup-codex=~/.code
41
+ npx scpl-updated-mcp-server --setup-codex=/path/to/code_config
42
+
43
+ For Codex forks like just-every/code that use CODE_HOME or CODEX_HOME:
44
+ npx scpl-updated-mcp-server --setup-codex=$CODE_HOME
39
45
 
40
46
  After setup, restart your AI coding tool and ask:
41
47
  "Create a shortcut that starts a timer and plays a sound"
@@ -44,16 +50,29 @@ After setup, restart your AI coding tool and ask:
44
50
  }
45
51
 
46
52
  // ============================================================================
47
- // CODEX SETUP: Run with --setup-codex for OpenAI Codex CLI
53
+ // CODEX SETUP: Run with --setup-codex or --setup-codex=<dir>
48
54
  // ============================================================================
49
- if (process.argv.includes("--setup-codex")) {
50
- console.log("🚀 Setting up ScPL Shortcuts for Codex...\n");
55
+ const codexArg = process.argv.find(arg => arg.startsWith("--setup-codex"));
56
+ if (codexArg) {
57
+ // Check for custom directory: --setup-codex=/path/to/dir or --setup-codex=~/custom
58
+ let codexDir = join(homedir(), ".codex"); // default
59
+
60
+ if (codexArg.includes("=")) {
61
+ let customDir = codexArg.split("=")[1];
62
+ // Expand ~ to home directory
63
+ if (customDir.startsWith("~")) {
64
+ customDir = customDir.replace("~", homedir());
65
+ }
66
+ codexDir = customDir;
67
+ }
51
68
 
52
- const codexConfigPath = join(homedir(), ".codex", "config.toml");
53
- const agentsPath = join(homedir(), ".codex", "AGENTS.md");
69
+ console.log(`🚀 Setting up ScPL Shortcuts for Codex at ${codexDir}...\n`);
54
70
 
55
- // Step 1: Add MCP server to ~/.codex/config.toml
56
- console.log("📝 Step 1: Adding MCP server to ~/.codex/config.toml...");
71
+ const codexConfigPath = join(codexDir, "config.toml");
72
+ const skillDir = join(codexDir, "skills", "scpl-shortcuts");
73
+
74
+ // Step 1: Add MCP server to config.toml
75
+ console.log(`📝 Step 1: Adding MCP server to ${codexConfigPath}...`);
57
76
  try {
58
77
  let config = "";
59
78
  if (existsSync(codexConfigPath)) {
@@ -84,42 +103,92 @@ startup_timeout_sec = 60.0
84
103
  `);
85
104
  }
86
105
 
87
- // Step 2: Add instructions to AGENTS.md
88
- console.log("📁 Step 2: Adding skill instructions to AGENTS.md...");
106
+ // Step 2: Install skill
107
+ console.log(`📁 Step 2: Installing skill to ${skillDir}...`);
89
108
  try {
90
- let agents = "";
91
- if (existsSync(agentsPath)) {
92
- agents = readFileSync(agentsPath, "utf-8");
93
- }
109
+ mkdirSync(skillDir, { recursive: true });
94
110
 
95
- if (agents.includes("## ScPL Shortcuts")) {
96
- console.log(" ⏭️ Already in AGENTS.md, skipping...\n");
97
- } else {
98
- const agentBlock = `
111
+ const skillContent = `---
112
+ name: scpl-shortcuts
113
+ 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.
114
+ metadata:
115
+ short-description: Create macOS Shortcuts with AI
116
+ ---
99
117
 
100
- ## ScPL Shortcuts
118
+ # ScPL Shortcuts Skill
101
119
 
102
- You have access to the ScPL MCP server with 493 actions for creating macOS Shortcuts.
120
+ Create macOS Shortcuts using natural language with 493 available actions.
121
+
122
+ ## MCP Tools Available
103
123
 
104
- **Tools available:**
105
- - \`create_shortcut\` - Generate a .shortcut file from ScPL code
106
- - \`validate_scpl\` - Check if ScPL code is valid
107
- - \`list_actions\` - Search available actions
124
+ You have access to the \`scpl-shortcuts\` MCP server with these tools:
125
+
126
+ | Tool | Description |
127
+ |------|-------------|
128
+ | \`create_shortcut\` | Generate a .shortcut file from ScPL code |
129
+ | \`validate_scpl\` | Check if ScPL code is valid before creating |
130
+ | \`list_actions\` | Search available actions by category or keyword |
131
+
132
+ ## ScPL Syntax
133
+
134
+ ScPL is line-based. Each line is an action. Parameters use \`key=value\` or \`key="value"\`.
108
135
 
109
- **ScPL syntax example:**
110
136
  \`\`\`scpl
111
- Text "Hello"
112
- AskLLM model="Apple Intelligence" prompt="Make it fun"
137
+ # Comments start with #
138
+ Text "Hello World"
113
139
  ShowResult
140
+
141
+ # Variables
142
+ Text "some value"
143
+ SetVariable v:myVar
144
+ ShowResult v:myVar
145
+
146
+ # AI actions
147
+ AskLLM model="Apple Intelligence" prompt="Summarize this"
148
+ AskChatGPT prompt="Explain this"
149
+ \`\`\`
150
+
151
+ ## Popular Actions by Category
152
+
153
+ **AI**: AskLLM, AskChatGPT, AskClaude
154
+ **Clock**: StartStopwatch, StopStopwatch, CreateAlarm
155
+ **Voice Memos**: CreateRecording, PlayRecording
156
+ **System**: SetDarkMode, TakeScreenshot, LockScreen
157
+ **Files**: GetFile, SaveFile, RenameFile, RevealInFinder
158
+ **Scripting**: RunShellScript, RunAppleScript, RunJavaScriptForAutomation
159
+ **Clipboard**: GetClipboard, SetClipboard
160
+
161
+ ## Workflow
162
+
163
+ 1. User describes what shortcut they want
164
+ 2. Use \`list_actions\` if you need to find specific actions
165
+ 3. Write ScPL code for the shortcut
166
+ 4. Use \`validate_scpl\` to check syntax
167
+ 5. Use \`create_shortcut\` to generate the .shortcut file
168
+ 6. Tell user to install via Shortcut Source Helper from RoutineHub
169
+
170
+ ## Example: Timer with Notification
171
+
172
+ \`\`\`scpl
173
+ # Start a 25-minute Pomodoro timer
174
+ StartTimer minutes=25
175
+ ShowAlert title="Timer Started" message="Focus for 25 minutes!"
114
176
  \`\`\`
115
177
 
116
- When user asks to create a shortcut, write ScPL code, validate it, then create the file.
178
+ ## Example: Clipboard AI Enhancement
179
+
180
+ \`\`\`scpl
181
+ GetClipboard
182
+ SetVariable v:text
183
+ AskChatGPT prompt="Improve this text: \\(v:text)"
184
+ SetClipboard
185
+ ShowAlert title="Done" message="Improved text copied!"
186
+ \`\`\`
117
187
  `;
118
- writeFileSync(agentsPath, agents + agentBlock);
119
- console.log(" ✅ Instructions added!\n");
120
- }
188
+ writeFileSync(join(skillDir, "SKILL.md"), skillContent);
189
+ console.log(" ✅ Skill installed!\n");
121
190
  } catch (error) {
122
- console.error(" ❌ Failed to update AGENTS.md:", error.message, "\n");
191
+ console.error(" ❌ Failed to install skill:", error.message, "\n");
123
192
  }
124
193
 
125
194
  console.log("🎉 Setup complete! Restart Codex to use the shortcuts tools.\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scpl-updated-mcp-server",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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",