@urbicon-ui/mcp-server 6.48.0 → 6.49.0
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/package.json +4 -4
- package/src/index.ts +12 -2
- package/src/transports/http.ts +9 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbicon-ui/mcp-server",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.49.0",
|
|
4
4
|
"description": "Model Context Protocol server exposing the Urbicon UI component catalog, recipes and design intelligence to LLM agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
42
|
-
"@urbicon-ui/design-content": "6.
|
|
43
|
-
"@urbicon-ui/design-engine": "6.
|
|
42
|
+
"@urbicon-ui/design-content": "6.49.0",
|
|
43
|
+
"@urbicon-ui/design-engine": "6.49.0",
|
|
44
44
|
"zod": "^4.3.6"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
"@types/node": "^26.1.2",
|
|
49
49
|
"vitest": "^4.1.9"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -8,13 +8,20 @@ import { startStdioTransport } from './transports/stdio.js';
|
|
|
8
8
|
interface CliArgs {
|
|
9
9
|
transport: 'stdio' | 'http';
|
|
10
10
|
port: number;
|
|
11
|
+
host: string;
|
|
11
12
|
contentDir?: string;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
function parseArgs(args: string[]): CliArgs {
|
|
15
16
|
const result: CliArgs = {
|
|
16
17
|
transport: 'stdio',
|
|
17
|
-
port: 3001
|
|
18
|
+
port: 3001,
|
|
19
|
+
// Loopback by default: this server has no authentication of its own and is
|
|
20
|
+
// meant to sit behind a reverse proxy. Binding every interface was the old
|
|
21
|
+
// behaviour — the deploy host set `HOST=127.0.0.1` for years and nothing
|
|
22
|
+
// read it, so the listener answered on `0.0.0.0` and only the firewall kept
|
|
23
|
+
// it private. Widening this is now a deliberate `--host 0.0.0.0`.
|
|
24
|
+
host: process.env.HOST ?? '127.0.0.1'
|
|
18
25
|
};
|
|
19
26
|
|
|
20
27
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -29,6 +36,9 @@ function parseArgs(args: string[]): CliArgs {
|
|
|
29
36
|
} else if (arg === '--port' && next) {
|
|
30
37
|
result.port = parseInt(next, 10);
|
|
31
38
|
i++;
|
|
39
|
+
} else if (arg === '--host' && next) {
|
|
40
|
+
result.host = next;
|
|
41
|
+
i++;
|
|
32
42
|
} else if (arg === '--content-dir' && next) {
|
|
33
43
|
result.contentDir = next;
|
|
34
44
|
i++;
|
|
@@ -53,7 +63,7 @@ async function main(): Promise<void> {
|
|
|
53
63
|
}
|
|
54
64
|
|
|
55
65
|
if (args.transport === 'http') {
|
|
56
|
-
await startHttpTransport(args.port);
|
|
66
|
+
await startHttpTransport(args.port, args.host);
|
|
57
67
|
} else {
|
|
58
68
|
const server = createServer();
|
|
59
69
|
await startStdioTransport(server);
|
package/src/transports/http.ts
CHANGED
|
@@ -26,11 +26,16 @@ function respondError(res: ServerResponse, status: number, code: number, message
|
|
|
26
26
|
* server that offers no sessions. Any non-`/mcp` path returns a plain-text
|
|
27
27
|
* banner (a lightweight liveness ping).
|
|
28
28
|
*
|
|
29
|
-
* @param port - TCP port to listen on (binds `http
|
|
29
|
+
* @param port - TCP port to listen on (binds `http://<host>:<port>/mcp`).
|
|
30
|
+
* @param host - Interface to bind. Defaults to loopback: the server has no auth
|
|
31
|
+
* of its own and belongs behind a reverse proxy. Pass `0.0.0.0` to widen it.
|
|
30
32
|
* @returns A stop handle; `index.ts` ignores it and runs until the process
|
|
31
33
|
* exits, the transport test uses it to shut the listener down.
|
|
32
34
|
*/
|
|
33
|
-
export async function startHttpTransport(
|
|
35
|
+
export async function startHttpTransport(
|
|
36
|
+
port: number,
|
|
37
|
+
host = '127.0.0.1'
|
|
38
|
+
): Promise<{ close: () => Promise<void> }> {
|
|
34
39
|
const httpServer = createHttpServer(async (req, res) => {
|
|
35
40
|
const url = new URL(req.url || '/', `http://localhost:${port}`);
|
|
36
41
|
|
|
@@ -74,8 +79,8 @@ export async function startHttpTransport(port: number): Promise<{ close: () => P
|
|
|
74
79
|
});
|
|
75
80
|
|
|
76
81
|
await new Promise<void>((resolve) => {
|
|
77
|
-
httpServer.listen(port, () => {
|
|
78
|
-
console.error(`Urbicon UI MCP Server listening on http
|
|
82
|
+
httpServer.listen(port, host, () => {
|
|
83
|
+
console.error(`Urbicon UI MCP Server listening on http://${host}:${port}/mcp`);
|
|
79
84
|
resolve();
|
|
80
85
|
});
|
|
81
86
|
});
|