ios-vibe-mcp01 0.1.6 → 0.1.8

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/README.md CHANGED
@@ -15,7 +15,7 @@ Transform any idea into a complete iOS application using AI in Cursor. Works wit
15
15
  Install and run with npx:
16
16
 
17
17
  ```bash
18
- npm i ios-vibe-mcp01
18
+ npm i ios-vibe-mcp01xx
19
19
  ```
20
20
 
21
21
  ### Add to Cursor
package/dist/index.js CHANGED
@@ -1,21 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
- import { registerIosVibeTool } from "./iosVibe.js";
4
+ import { registerIosVibeTools } from "./iosVibe.js";
5
5
  async function main() {
6
- const server = new McpServer({
7
- name: "ios-vibe-factory",
8
- version: "0.1.2",
9
- });
10
- // ✅ ios_vibe tool'unu ekle
11
- registerIosVibeTool(server);
12
- // ✅ Cursor MCP: stdio transport ile bağlan
6
+ const server = new McpServer({ name: "ios-vibe-factory", version: "0.1.5" });
7
+ registerIosVibeTools(server);
13
8
  const transport = new StdioServerTransport();
14
9
  await server.connect(transport);
15
- // ⚠️ stdout'a log basma (protocol bozulur). Sadece stderr.
16
10
  console.error("ios-vibe-mcp01: connected via stdio");
17
11
  }
18
12
  main().catch((err) => {
19
- console.error("ios-vibe-mcp01: startup failed", err);
13
+ console.error("startup failed", err);
20
14
  process.exit(1);
21
15
  });
package/dist/iosVibe.js CHANGED
@@ -1,76 +1,92 @@
1
1
  import { z } from "zod";
2
2
  import { renderFilesForCommand } from "./templates.js";
3
3
  import { validateWorkflow } from "./rules.js";
4
- const CommandSchema = z.enum(["plan", "architecture", "coding", "uiux", "test", "review", "ship"]);
5
- const InputSchema = z.object({
6
- command: CommandSchema.describe("Which stage of the iOS app workflow to run"),
7
- idea: z.string().optional().describe("Your app idea (required for plan)"),
8
- config: z
9
- .object({
10
- appName: z.string().default("MyApp"),
11
- iosMin: z.string().default("17.0"),
12
- storage: z.enum(["coredata", "swiftdata"]).default("coredata"),
13
- tone: z.string().default("soft pink"),
14
- constraints: z.array(z.string()).default(["offline-first", "no firebase", "mvvm", "repository"]),
15
- })
16
- .optional()
17
- .describe("Optional project configuration"),
18
- state: z
19
- .object({
20
- projectBlueprintMd: z.string().optional(),
21
- todoMd: z.string().optional(),
22
- stageArchitectureMd: z.string().optional(),
23
- stageCodingMd: z.string().optional(),
24
- stageUiuxMd: z.string().optional(),
25
- stageTestMd: z.string().optional(),
26
- iosRulesMd: z.string().optional(),
27
- runbookMd: z.string().optional(),
28
- backlogMd: z.string().optional(),
29
- })
30
- .optional()
31
- .describe("Previous stage outputs (auto-managed)"),
32
- });
33
- function normalizeInput(raw) {
34
- const text = typeof raw === "string"
35
- ? raw
36
- : raw && typeof raw === "object" && "text" in raw && typeof raw.text === "string"
37
- ? raw.text
38
- : null;
39
- if (!text)
40
- return raw;
41
- const t = text.trim();
42
- const planMatch = t.match(/^plan\s*:\s*(.+)$/i);
43
- if (planMatch)
44
- return { command: "plan", idea: planMatch[1].trim() };
45
- const lower = t.toLowerCase();
46
- const allowed = ["architecture", "coding", "uiux", "test", "review", "ship"];
47
- if (allowed.includes(lower))
48
- return { command: lower };
49
- if (/^plan$/i.test(t))
50
- return { command: "plan", idea: "" };
51
- return raw;
4
+ const ConfigSchema = z
5
+ .object({
6
+ appName: z.string().default("MyApp"),
7
+ iosMin: z.string().default("17.0"),
8
+ storage: z.enum(["coredata", "swiftdata"]).default("coredata"),
9
+ tone: z.string().default("soft pink"),
10
+ constraints: z.array(z.string()).default(["offline-first", "no firebase", "mvvm", "repository"]),
11
+ })
12
+ .optional();
13
+ const StateSchema = z
14
+ .object({
15
+ projectBlueprintMd: z.string().optional(),
16
+ todoMd: z.string().optional(),
17
+ stageArchitectureMd: z.string().optional(),
18
+ stageCodingMd: z.string().optional(),
19
+ stageUiuxMd: z.string().optional(),
20
+ stageTestMd: z.string().optional(),
21
+ iosRulesMd: z.string().optional(),
22
+ runbookMd: z.string().optional(),
23
+ backlogMd: z.string().optional(),
24
+ })
25
+ .optional();
26
+ function run(command, raw) {
27
+ const r = (raw ?? {});
28
+ const input = {
29
+ command,
30
+ idea: r.idea,
31
+ config: r.config,
32
+ state: r.state,
33
+ };
34
+ const flow = validateWorkflow(input);
35
+ if (!flow.ok) {
36
+ return {
37
+ content: [
38
+ {
39
+ type: "text",
40
+ text: `Command blocked: ${flow.reason}\n\nFix: ${flow.fix}\n\nSuggested next: ${flow.suggestedNext}`,
41
+ },
42
+ ],
43
+ };
44
+ }
45
+ const result = renderFilesForCommand(input);
46
+ return {
47
+ content: [
48
+ {
49
+ type: "text",
50
+ text: JSON.stringify(result, null, 2),
51
+ },
52
+ ],
53
+ };
52
54
  }
53
- export function registerIosVibeTool(server) {
54
- // ✅ Use InputSchema.shape for maximum SDK compatibility
55
- server.tool("ios_vibe", InputSchema.shape, async (raw) => {
56
- const normalized = normalizeInput(raw);
57
- const parsed = InputSchema.safeParse(normalized);
58
- if (!parsed.success) {
59
- return { content: [{ type: "text", text: `Invalid input: ${parsed.error.message}` }] };
60
- }
61
- const input = parsed.data;
62
- const flow = validateWorkflow(input);
63
- if (!flow.ok) {
64
- return {
65
- content: [
66
- {
67
- type: "text",
68
- text: `Command blocked: ${flow.reason}\n\nFix: ${flow.fix}\n\nSuggested next: ${flow.suggestedNext}`,
69
- },
70
- ],
71
- };
72
- }
73
- const result = renderFilesForCommand(input);
74
- return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
75
- });
55
+ export function registerIosVibeTools(server) {
56
+ // ✅ PLAN (idea required)
57
+ server.tool("ios_plan", {
58
+ idea: z.string().describe("Your app idea (required)"),
59
+ config: ConfigSchema.describe("Optional project configuration").optional(),
60
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
61
+ }, async (args) => run("plan", args));
62
+ // ✅ architecture
63
+ server.tool("ios_architecture", {
64
+ config: ConfigSchema.describe("Optional project configuration").optional(),
65
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
66
+ }, async (args) => run("architecture", args));
67
+ // ✅ coding
68
+ server.tool("ios_coding", {
69
+ config: ConfigSchema.describe("Optional project configuration").optional(),
70
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
71
+ }, async (args) => run("coding", args));
72
+ // ✅ uiux
73
+ server.tool("ios_uiux", {
74
+ config: ConfigSchema.describe("Optional project configuration").optional(),
75
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
76
+ }, async (args) => run("uiux", args));
77
+ // ✅ test
78
+ server.tool("ios_test", {
79
+ config: ConfigSchema.describe("Optional project configuration").optional(),
80
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
81
+ }, async (args) => run("test", args));
82
+ // ✅ review
83
+ server.tool("ios_review", {
84
+ config: ConfigSchema.describe("Optional project configuration").optional(),
85
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
86
+ }, async (args) => run("review", args));
87
+ // ✅ ship
88
+ server.tool("ios_ship", {
89
+ config: ConfigSchema.describe("Optional project configuration").optional(),
90
+ state: StateSchema.describe("Previous stage outputs (auto-managed)").optional(),
91
+ }, async (args) => run("ship", args));
76
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ios-vibe-mcp01",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "MCP server for vibe coding iOS apps with command-based workflow (plan, architecture, coding, uiux, test)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",