diff --git a/src/cli/utils/validate-project.ts b/src/cli/utils/validate-project.ts index 1ca1e70..c9d6208 100644 --- a/src/cli/utils/validate-project.ts +++ b/src/cli/utils/validate-project.ts @@ -1,6 +1,8 @@ + import { readFile } from "fs/promises"; import { findUp } from 'find-up'; + export async function validateMCPProject() { try { const packageJsonPath = await findUp('package.json'); @@ -8,10 +10,7 @@ export async function validateMCPProject() { if (!packageJsonPath) { throw new Error("Could not find package.json in current directory or any parent directories"); } - - const packageJsonContent = await readFile(packageJsonPath, 'utf-8'); - const package_json = JSON.parse(packageJsonContent); - + const package_json = JSON.parse(await readFile(packageJsonPath, "utf-8")); if ( !package_json.dependencies?.["mcp-framework"] && !package_json.devDependencies?.["mcp-framework"]