Skip to main content
Glama

Gotas Commerce MCP Server

minimal-mcp-server.js3.1 kB
/** * Servidor MCP minimalista para Smithery * * Este servidor implementa apenas o necessário para listar ferramentas * sem autenticação e ser compatível com o Smithery. */ const express = require('express'); const cors = require('cors'); const app = express(); const port = process.env.PORT || 3000; // Definição das ferramentas const tools = [ { name: 'create-payment', description: 'Creates a new payment in the Gotas Commerce API', parameters: { type: 'object', properties: { amount: { type: 'number', description: 'Payment amount (e.g., 100.50)' }, currency: { type: 'string', description: 'Currency code (e.g., "USDT")' }, return_url: { type: 'string', description: 'URL to redirect customer after payment' }, description: { type: 'string', description: 'Optional description of the payment' } }, required: ['amount', 'currency', 'return_url'] } }, { name: 'check-payment-status', description: 'Checks the status of an existing payment', parameters: { type: 'object', properties: { payment_id: { type: 'string', description: 'Identifier of the payment to check' } }, required: ['payment_id'] } } ]; // Middleware para processar JSON app.use(express.json()); // Middleware para CORS app.use(cors({ origin: '*', methods: ['GET', 'POST', 'DELETE', 'OPTIONS'], allowedHeaders: ['Content-Type', 'Accept', 'Mcp-Session-Id', 'Origin', 'X-Requested-With'] })); // Middleware para logging app.use((req, res, next) => { console.log(`${new Date().toISOString()} - ${req.method} ${req.originalUrl}`); next(); }); // Endpoint para listar ferramentas - responde a qualquer método app.all('/mcp', (req, res) => { console.log('Requisição recebida em /mcp:', { method: req.method, query: req.query, body: req.body, headers: req.headers }); // Responder com a lista de ferramentas res.json({ tools }); }); // Endpoint específico para listar ferramentas app.all('/mcp/list-tools', (req, res) => { console.log('Requisição recebida em /mcp/list-tools'); // Responder com a lista de ferramentas res.json({ tools }); }); // Rota raiz para verificação de saúde app.get('/', (req, res) => { res.json({ status: 'ok', message: 'Gotas Commerce MCP Server is running', version: '1.0.0' }); }); // Iniciar o servidor const server = app.listen(port, () => { console.log(`Minimal MCP Server running on port ${port}`); console.log(`MCP endpoint available at: http://localhost:${port}/mcp`); }); // Lidar com sinais de encerramento process.on('SIGTERM', () => { console.log('SIGTERM signal received: closing HTTP server'); server.close(() => { console.log('HTTP server closed'); }); }); process.on('SIGINT', () => { console.log('SIGINT signal received: closing HTTP server'); server.close(() => { console.log('HTTP server closed'); }); });

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/caiovicentino/mcpGOTAS'

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