mirror of
https://github.com/penpot/penpot-mcp.git
synced 2026-04-25 11:18:37 +00:00
feat(plugin): support running the MCP server on a remote host (not just localhost)
This commit is contained in:
parent
0657394240
commit
dc3c407ac5
@ -42,7 +42,9 @@ function connectToMcpServer(): void {
|
||||
}
|
||||
|
||||
try {
|
||||
ws = new WebSocket("ws://localhost:4402");
|
||||
// Use environment variable for MCP WebSocket URL, fallback to localhost for local development
|
||||
const mcpWsUrl = import.meta.env.VITE_MCP_WS_URL || "ws://localhost:4402";
|
||||
ws = new WebSocket(mcpWsUrl);
|
||||
updateConnectionStatus("Connecting...", false);
|
||||
|
||||
ws.onopen = () => {
|
||||
|
||||
@ -26,5 +26,8 @@ export default defineConfig({
|
||||
preview: {
|
||||
port: 4400,
|
||||
cors: true,
|
||||
allowedHosts: process.env.VITE_ALLOWED_HOSTS
|
||||
? process.env.VITE_ALLOWED_HOSTS.split(",").map((h) => h.trim())
|
||||
: ["localhost", "0.0.0.0"],
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user