Skip to content

Commit e630ce8

Browse files
authored
feat: use HTTPS protocol when https is enabled in Vite (#12)
1 parent 56457e9 commit e630ce8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vite-plugin-mcp/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export function ViteMcp(options: ViteMcpOptions = {}): Plugin {
3636
const port = vite.config.server.port
3737
const root = searchForWorkspaceRoot(vite.config.root)
3838

39-
const sseUrl = `http://${options.host || 'localhost'}:${options.port || port}${mcpPath}/sse`
39+
const protocol = vite.config.server.https ? 'https' : 'http'
40+
const sseUrl = `${protocol}://${options.host || 'localhost'}:${options.port || port}${mcpPath}/sse`
4041

4142
if (cursorMcpOptions.enabled) {
4243
if (existsSync(join(root, '.cursor'))) {

0 commit comments

Comments
 (0)