Skip to main content
Glama

Cashfree MCP Server

Official
by cashfree
index.ts1.68 kB
#!/usr/bin/env node /** * Entry point for Cashfree MCP server. * Initializes server, loads OpenAPI tools, and starts the server. */ import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { connectServer } from "./connect.js"; import { initialize } from "./initialize.js"; import { createToolsFromOpenApi } from "./openapi/index.js"; import { createSearchTool } from "./search.js"; import { isMcpEnabled } from "./openapi/helpers.js"; import { readConfig } from "./config.js"; import { createCashienTool } from "./cashien.js"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); async function main() { const config = readConfig(); const server = initialize(config); const existingTools: Set<string> = new Set(); await createSearchTool(server); await createCashienTool(server); // Dynamically load OpenAPI-based tools const openApiDir = path.join(__dirname, "openapi"); if (!fs.existsSync(openApiDir)) { throw new Error(`OpenAPI directory not found at path: ${openApiDir}`); } const openApiFilePaths = fs .readdirSync(openApiDir) .filter((file) => file.startsWith("openapi-") && file.endsWith(".json")) .filter((file) => isMcpEnabled(file)); await Promise.all( openApiFilePaths.map(async (openApiPath, index) => { return createToolsFromOpenApi( path.join(openApiDir, openApiPath), index, server, existingTools ); }) ); await connectServer(server); } main().catch((error: unknown) => { console.error("Fatal error in trying to initialize MCP server:", error); process.exit(1); });

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/cashfree/cashfree-mcp'

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