Skip to main content
Glama
index.ts938 B
#!/usr/bin/env node import packageJson from "../package.json" with { type: "json" }; import { runServer } from "./server.js"; /** * Main entry point for the Perplexity MCP Server */ const arguments_ = new Set(process.argv.slice(2)); if (arguments_.has("--version") || arguments_.has("-v")) { console.log(packageJson.version); process.exit(0); } // Validate required environment variables // Preflight check to fail fast before starting the server for a clearer UX. // Note: performChatCompletion() also validates PERPLEXITY_API_KEY as a defensive // guard when the client is used in isolation (e.g., tests or scripts). const PERPLEXITY_API_KEY = process.env.PERPLEXITY_API_KEY; if (!PERPLEXITY_API_KEY) { console.error("Error: PERPLEXITY_API_KEY environment variable is required"); process.exit(1); } try { await runServer(); } catch (error) { console.error("Fatal error running server:", error); process.exit(1); }

Latest Blog Posts

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/Jercik/perplexity-agent-mcp'

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