Skip to main content
Glama
config.ts1.12 kB
import type { ProxyConfig } from './types.js'; import type { CLIArgs } from './cli-args.js'; import { parseHeaders } from './utils/header-parser.js'; import { parseEnvVars } from './utils/env-parser.js'; export function createProxyConfig(args: CLIArgs): ProxyConfig { const denyPatterns = args.deny ? args.deny.split(',').map((p) => p.trim()).filter((p) => p.length > 0) : []; const timeouts = { connection: 30000, toolList: 10000, }; if (args.upstream) { const headers = args.header && args.header.length > 0 ? parseHeaders(args.header) : undefined; return { mode: 'http', upstreamUrl: args.upstream, denyPatterns, headers, timeouts, }; } if (args.upstreamStdio) { const [upstreamCommand, ...upstreamArgs] = args.positionals; const env = args.env && args.env.length > 0 ? parseEnvVars(args.env) : undefined; return { mode: 'stdio', upstreamCommand, upstreamArgs, denyPatterns, env, timeouts, }; } throw new Error('Invalid configuration: no upstream specified'); }

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/respawn-app/tool-filter-mcp'

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