Skip to main content
Glama
index.ts838 B
import { MCPServer, APIKeyAuthProvider } from "mcp-framework"; import * as dotenv from 'dotenv'; import { config } from 'dotenv'; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); config({ path: join(__dirname, '..', '.env') }); const apiKey = process.env.INMOVILLA_API_TOKEN; if (!apiKey) { throw new Error("API key not found"); } const mcpApiKey = process.env.MCP_API_KEY; if (!mcpApiKey) { throw new Error("MCP_API_KEY not found"); } const server = new MCPServer({ transport: { type: "http-stream", options: { port: 1337, cors: { allowOrigin: "*" } }, auth: { provider: new APIKeyAuthProvider({ keys: [mcpApiKey] }) } } }); server.start();

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/laica-ayudavets/mcp-inmovilla'

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