openuispec 0.1.35 → 0.1.36
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 +3 -3
- package/cli/index.ts +7 -0
- package/cli/init.ts +3 -2
- package/mcp-server/index.ts +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -257,14 +257,14 @@ OpenUISpec includes an MCP (Model Context Protocol) server that exposes CLI comm
|
|
|
257
257
|
{
|
|
258
258
|
"mcpServers": {
|
|
259
259
|
"openuispec": {
|
|
260
|
-
"command": "
|
|
261
|
-
"args": ["
|
|
260
|
+
"command": "openuispec",
|
|
261
|
+
"args": ["mcp"]
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
Or run directly: `
|
|
267
|
+
Or run directly: `openuispec mcp`
|
|
268
268
|
|
|
269
269
|
Set `OPENUISPEC_PROJECT_DIR` to override the working directory.
|
|
270
270
|
|
package/cli/index.ts
CHANGED
|
@@ -94,6 +94,12 @@ async function main(): Promise<void> {
|
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
case "mcp": {
|
|
98
|
+
const { startMcpServer } = await import("../mcp-server/index.js");
|
|
99
|
+
await startMcpServer();
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
|
|
97
103
|
case undefined:
|
|
98
104
|
case "--help":
|
|
99
105
|
case "-h":
|
|
@@ -117,6 +123,7 @@ Usage:
|
|
|
117
123
|
openuispec check --target <t> [--json] Composite validation + prepare readiness
|
|
118
124
|
openuispec validate [group...] [--json] Validate spec files
|
|
119
125
|
openuispec validate semantic --json Semantic validation as JSON
|
|
126
|
+
openuispec mcp Start MCP server (stdio transport)
|
|
120
127
|
|
|
121
128
|
Validate groups: manifest, tokens, screens, flows, platform, locales, contracts, semantic
|
|
122
129
|
|
package/cli/init.ts
CHANGED
|
@@ -489,6 +489,7 @@ export function updateRules(): void {
|
|
|
489
489
|
claudeJson.mcpServers.openuispec = mcpConfig;
|
|
490
490
|
writeFileSync(claudeJsonPath, JSON.stringify(claudeJson, null, 2) + "\n");
|
|
491
491
|
console.log(` create .claude.json (MCP server configured)`);
|
|
492
|
+
console.log(`\n Restart Claude Code to activate the MCP server.`);
|
|
492
493
|
}
|
|
493
494
|
} catch {
|
|
494
495
|
// non-critical — skip silently
|
|
@@ -762,8 +763,8 @@ export async function init(argv: string[] = []): Promise<void> {
|
|
|
762
763
|
|
|
763
764
|
const claudeJsonPath = join(cwd, ".claude.json");
|
|
764
765
|
const mcpConfig = {
|
|
765
|
-
command: "
|
|
766
|
-
args: ["
|
|
766
|
+
command: "openuispec",
|
|
767
|
+
args: ["mcp"],
|
|
767
768
|
};
|
|
768
769
|
|
|
769
770
|
try {
|
package/mcp-server/index.ts
CHANGED
|
@@ -172,12 +172,19 @@ server.registerTool(
|
|
|
172
172
|
|
|
173
173
|
// ── start server ─────────────────────────────────────────────────────
|
|
174
174
|
|
|
175
|
-
async function
|
|
175
|
+
export async function startMcpServer() {
|
|
176
176
|
const transport = new StdioServerTransport();
|
|
177
177
|
await server.connect(transport);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
process.
|
|
183
|
-
|
|
180
|
+
// Direct execution (npx openuispec-mcp)
|
|
181
|
+
const isDirectRun =
|
|
182
|
+
process.argv[1]?.endsWith("mcp-server/index.ts") ||
|
|
183
|
+
process.argv[1]?.endsWith("mcp-server/index.js");
|
|
184
|
+
|
|
185
|
+
if (isDirectRun) {
|
|
186
|
+
startMcpServer().catch((err) => {
|
|
187
|
+
console.error("Failed to start OpenUISpec MCP server:", err);
|
|
188
|
+
process.exit(1);
|
|
189
|
+
});
|
|
190
|
+
}
|