scpl-updated-mcp-server 1.0.1 → 1.0.2
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 +111 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -19,7 +19,117 @@ 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 agentsPath = join(homedir(), ".codex", "AGENTS.md");
|
|
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: Add instructions to AGENTS.md
|
|
88
|
+
console.log("📁 Step 2: Adding skill instructions to AGENTS.md...");
|
|
89
|
+
try {
|
|
90
|
+
let agents = "";
|
|
91
|
+
if (existsSync(agentsPath)) {
|
|
92
|
+
agents = readFileSync(agentsPath, "utf-8");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (agents.includes("## ScPL Shortcuts")) {
|
|
96
|
+
console.log(" ⏭️ Already in AGENTS.md, skipping...\n");
|
|
97
|
+
} else {
|
|
98
|
+
const agentBlock = `
|
|
99
|
+
|
|
100
|
+
## ScPL Shortcuts
|
|
101
|
+
|
|
102
|
+
You have access to the ScPL MCP server with 493 actions for creating macOS Shortcuts.
|
|
103
|
+
|
|
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
|
|
108
|
+
|
|
109
|
+
**ScPL syntax example:**
|
|
110
|
+
\`\`\`scpl
|
|
111
|
+
Text "Hello"
|
|
112
|
+
AskLLM model="Apple Intelligence" prompt="Make it fun"
|
|
113
|
+
ShowResult
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
When user asks to create a shortcut, write ScPL code, validate it, then create the file.
|
|
117
|
+
`;
|
|
118
|
+
writeFileSync(agentsPath, agents + agentBlock);
|
|
119
|
+
console.log(" ✅ Instructions added!\n");
|
|
120
|
+
}
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error(" ❌ Failed to update AGENTS.md:", error.message, "\n");
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
console.log("🎉 Setup complete! Restart Codex to use the shortcuts tools.\n");
|
|
126
|
+
console.log("Usage: Just ask Codex to create a shortcut!");
|
|
127
|
+
console.log(' Example: "Create a shortcut that starts a timer and plays a sound"\n');
|
|
128
|
+
process.exit(0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// CLAUDE CODE SETUP: Run with --setup to install everything automatically
|
|
23
133
|
// ============================================================================
|
|
24
134
|
if (process.argv.includes("--setup")) {
|
|
25
135
|
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.2",
|
|
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",
|