Skip to main content
Glama

Search1API MCP Server

index.ts1.17 kB
#!/usr/bin/env node import { log } from "./utils.js"; import { createServer } from "./server.js"; import { API_KEY } from "./config.js"; /** * Main function - Program entry point */ async function main() { // Ensure API key exists if (!API_KEY) { log("SEARCH1API_KEY environment variable is not set"); process.exit(1); } try { log("Starting Search1API MCP server"); const server = createServer(); // Start server await server.start(); log("Server started successfully"); // Handle process exit signals setupExitHandlers(server); } catch (error) { log("Failed to start server:", error); process.exit(1); } } /** * Set up process exit signal handlers */ function setupExitHandlers(server: any) { const exitHandler = async () => { log("Shutting down server..."); await server.stop(); process.exit(0); }; // Handle various exit signals process.on("SIGINT", exitHandler); process.on("SIGTERM", exitHandler); process.on("SIGUSR1", exitHandler); process.on("SIGUSR2", exitHandler); } // Start program main().catch((error) => { log("Fatal 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/fatwang2/search1api-mcp'

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