Skip to main content
Glama

EVM MCP Server

by chulanpro5
#!/usr/bin/env node import { fileURLToPath } from "url"; import { dirname, resolve } from "path"; import { spawn } from "child_process"; import { createRequire } from "module"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const require = createRequire(import.meta.url); // Parse command line arguments const args = process.argv.slice(2); const httpMode = args.includes("--http") || args.includes("-h"); console.log( `Starting EVM MCP Server in ${httpMode ? "HTTP" : "stdio"} mode...`, ); // Determine which file to execute const scriptPath = resolve( __dirname, "../build", httpMode ? "http-server.js" : "index.js", ); try { // Check if the built files exist require.resolve(scriptPath); // Execute the server const server = spawn("node", [scriptPath], { stdio: "inherit", shell: false, }); server.on("error", (err) => { console.error("Failed to start server:", err); process.exit(1); }); // Handle clean shutdown const cleanup = () => { if (!server.killed) { server.kill(); } }; process.on("SIGINT", cleanup); process.on("SIGTERM", cleanup); process.on("exit", cleanup); } catch (error) { console.error( "Error: Server files not found. The package may not be built correctly.", ); console.error( "Please try reinstalling the package or contact the maintainers.", ); console.error(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/chulanpro5/evm-mcp-server'

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