mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +00:00
fix: check if .mcp.json file exists
This commit is contained in:
parent
6da0663021
commit
5dc4cfba0e
1 changed files with 5 additions and 1 deletions
|
@ -273,7 +273,11 @@ export namespace Config {
|
|||
|
||||
async function getProjectMcps(cwd: string): Promise<ProjectMcps> {
|
||||
const projectMcpFile = path.join(cwd, ".mcp.json")
|
||||
const data = await Bun.file(projectMcpFile).json()
|
||||
const file = Bun.file(projectMcpFile)
|
||||
const fileExists = await file.exists()
|
||||
if(!fileExists) return undefined
|
||||
|
||||
const data = await file.json()
|
||||
|
||||
const parsed = StandardMcpConfig.safeParse(data)
|
||||
if (parsed.success) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue