Skip to main content
Glama

Google Maps MCP Server

by iceener
app.ts1.45 kB
// Unified MCP server entry point (Node.js/Hono) import type { HttpBindings } from '@hono/node-server'; import { Hono } from 'hono'; import { createMcpSecurityMiddleware } from '../adapters/http-hono/middleware.security.js'; import { config } from '../config/env.js'; import { serverMetadata } from '../config/metadata.js'; import { buildServer } from '../core/mcp.js'; import { parseConfig } from '../shared/config/env.js'; import { createAuthHeaderMiddleware } from './middlewares/auth.js'; import { corsMiddleware } from './middlewares/cors.js'; import { healthRoutes } from './routes/health.js'; import { buildMcpRoutes } from './routes/mcp.js'; export function buildHttpApp(): Hono<{ Bindings: HttpBindings }> { const app = new Hono<{ Bindings: HttpBindings }>(); // Parse unified config const unifiedConfig = parseConfig(process.env as Record<string, unknown>); // Build MCP server const server = buildServer({ name: config.MCP_TITLE || serverMetadata.title, version: config.MCP_VERSION, instructions: config.MCP_INSTRUCTIONS || serverMetadata.instructions, }); const transports = new Map(); // Global middleware app.use('*', corsMiddleware()); app.use('*', createAuthHeaderMiddleware()); // Routes app.route('/', healthRoutes()); // MCP endpoint with security app.use('/mcp', createMcpSecurityMiddleware(unifiedConfig)); app.route('/mcp', buildMcpRoutes({ server, transports })); return app; }

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/iceener/maps-streamable-mcp-server'

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