Skip to main content
Glama

MCP ChatGPT Multi-Server Suite

by bobhuff0
server.js1.64 kB
// server.js const express = require('express'); const app = express(); app.use(express.json()); // MCP route expected by ChatGPT app.post('/mcp', (req, res) => { res.json({ openapi: "3.1.0", info: { title: "Market Movers API", version: "1.0.0" }, paths: { "/stock-price": { get: { operationId: "getStockPrice", summary: "Get stock price by symbol", parameters: [ { name: "symbol", in: "query", required: true, schema: { type: "string" }, description: "Ticker symbol, e.g., AAPL" } ], responses: { "200": { description: "Stock price data", content: { "application/json": { example: { symbol: "AAPL", price: 179.23, currency: "USD" } } } } } } } } }); }); // Simulated endpoint for stock price app.get('/stock-price', (req, res) => { const symbol = req.query.symbol?.toUpperCase(); const mockPrices = { AAPL: 179.23, TSLA: 243.50, MSFT: 329.10, NVDA: 456.90 }; if (!symbol || !mockPrices[symbol]) { return res.status(404).json({ error: "Stock not found" }); } res.json({ symbol, price: mockPrices[symbol], currency: "USD" }); }); const port = 3000; app.listen(port, () => { console.log(`MCP server running at http://localhost:${port}`); });

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/bobhuff0/MCPAddIn'

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