Skip to main content
Glama
index.js1.79 kB
/** * QoutaMCP - Vercel Serverless API * For Vercel deployment (stateless, no SSE) */ import { inspectProject } from '../src/tools/inspectProject.js'; import { detectStack } from '../src/tools/detectStack.js'; import { listKeyFiles } from '../src/tools/listKeyFiles.js'; const tools = { inspect_project: inspectProject, detect_stack: detectStack, list_key_files: listKeyFiles }; export default async function handler(req, res) { // CORS headers res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type'); if (req.method === 'OPTIONS') { return res.status(200).end(); } // Health check if (req.method === 'GET') { return res.json({ status: 'ok', server: 'qoutamcp', version: '1.1.0', mode: 'serverless', tools: Object.keys(tools) }); } // Tool calls if (req.method === 'POST') { const { tool, params } = req.body; if (!tool || !tools[tool]) { return res.status(400).json({ error: { code: 'INVALID_TOOL', message: `Unknown tool: ${tool}. Available: ${Object.keys(tools).join(', ')}` } }); } try { const result = await tools[tool](params); return res.json(result); } catch (error) { return res.status(500).json({ error: { code: 'EXECUTION_ERROR', message: error.message } }); } } return res.status(405).json({ error: 'Method not allowed' }); }

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/QoutaID/qoutaMcp'

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