Skip to main content
Glama
MIT License
27,120
19,789
  • Linux
  • Apple
clientInfo.ts•553 B
import type { Context } from 'hono'; export interface ClientInfo { ip: string; userAgent?: string; referer?: string; } export function getClientInfo(c: Context): ClientInfo { // Get client IP from various headers (prioritized order) const ip = c.req.header('x-forwarded-for')?.split(',')[0]?.trim() || c.req.header('x-real-ip') || c.req.header('cf-connecting-ip') || '0.0.0.0'; const userAgent = c.req.header('user-agent'); const referer = c.req.header('referer'); return { ip, userAgent, referer, }; }

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/yamadashy/repomix'

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