Skip to content

Commit e45a0ae

Browse files
committed
fix: add error handling for mcp.json parsing
1 parent 0ab8aca commit e45a0ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function VueMcp(options: VueMcpOptions = {}): Plugin {
6767
if (cursorMcpOptions.enabled) {
6868
if (existsSync(join(root, '.cursor'))) {
6969
const mcp = existsSync(join(root, '.cursor/mcp.json'))
70-
? JSON.parse(await fs.readFile(join(root, '.cursor/mcp.json'), 'utf-8'))
70+
? JSON.parse(await fs.readFile(join(root, '.cursor/mcp.json'), 'utf-8') || '{}')
7171
: {}
7272
mcp.mcpServers ||= {}
7373
mcp.mcpServers[cursorMcpOptions.serverName || 'vue-mcp'] = { url: sseUrl }

0 commit comments

Comments
 (0)