Skip to main content
Glama

Financial Modeling Prep MCP Server

Apache 2.0
17
59
  • Linux
  • Apple
verify-npm-ready.tsβ€’3.89 kB
#!/usr/bin/env tsx /** * Simple verification script to ensure the package is ready for NPM publishing * This script performs essential checks without complex installation testing */ import { readFileSync, existsSync } from "fs"; import { execSync } from "child_process"; interface PackageJson { name: string; version: string; mcpName?: string; main: string; bin?: Record<string, string>; files?: string[]; } /** * Executes a command safely and returns success status * @param command - Command to execute * @returns true if command succeeded, false otherwise */ function safeExecute(command: string): boolean { try { execSync(command, { stdio: "pipe" }); return true; } catch { return false; } } /** * Main verification function */ function main(): void { console.log("πŸ” Verifying NPM publishing readiness...\n"); let allChecks = true; // Check 1: package.json exists and has required fields console.log("1. Checking package.json configuration..."); try { const packageJson: PackageJson = JSON.parse( readFileSync("package.json", "utf-8") ); if (!packageJson.mcpName) { console.log(" ❌ Missing mcpName field"); allChecks = false; } else if (!packageJson.mcpName.startsWith("io.github.imbenrabi/")) { console.log(` ❌ Invalid mcpName format: ${packageJson.mcpName}`); allChecks = false; } else { console.log(` βœ… mcpName: ${packageJson.mcpName}`); } if (!packageJson.files || !packageJson.files.includes("dist")) { console.log(" ❌ Missing dist in files array"); allChecks = false; } else { console.log(" βœ… Files array includes dist"); } if (!packageJson.bin || !packageJson.bin["fmp-mcp"]) { console.log(" ❌ Missing binary configuration"); allChecks = false; } else { console.log(" βœ… Binary configuration present"); } } catch (error) { console.log(" ❌ Failed to read package.json"); allChecks = false; } // Check 2: Build works console.log("\n2. Checking build process..."); if (safeExecute("npm run build")) { console.log(" βœ… Build successful"); } else { console.log(" ❌ Build failed"); allChecks = false; } // Check 3: Required files exist (after build) console.log("\n3. Checking required files..."); const requiredFiles = [ "LICENSE", "README.md", "dist/index.js", "dist/index.d.ts", ]; for (const file of requiredFiles) { if (existsSync(file)) { console.log(` βœ… ${file}`); } else { console.log(` ❌ Missing: ${file}`); allChecks = false; } } // Check 4: Package creation works console.log("\n4. Checking package creation..."); if (safeExecute("npm pack --dry-run")) { console.log(" βœ… Package creation successful"); } else { console.log(" ❌ Package creation failed"); allChecks = false; } // Check 5: Version consistency console.log("\n5. Checking version consistency..."); if (safeExecute("npm run version:validate")) { console.log(" βœ… Version consistency verified"); } else { console.log(" ❌ Version inconsistency detected"); allChecks = false; } // Summary console.log("\n" + "=".repeat(50)); if (allChecks) { console.log("πŸŽ‰ All checks passed! Package is ready for NPM publishing."); console.log("\nπŸ“‹ Manual publishing steps:"); console.log("1. npm login --registry https://registry.npmjs.org/"); console.log("2. npm publish --registry https://registry.npmjs.org/"); console.log("3. npm view financial-modeling-prep-mcp-server"); } else { console.log( "❌ Some checks failed. Please fix the issues above before publishing." ); process.exit(1); } } // Run if executed directly if (import.meta.url === `file://${process.argv[1]}`) { main(); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/imbenrabi/Financial-Modeling-Prep-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server