Skip to main content
Glama

MCP Agent TypeScript Port

by waldzellai
index.ts953 B
// Context module exports export interface McpContext { traceId: string; timestamp: number; metadata: Record<string, unknown>; } export class ContextManager { private static instance: ContextManager; private currentContext: McpContext | null = null; private constructor() {} public static getInstance(): ContextManager { if (!ContextManager.instance) { ContextManager.instance = new ContextManager(); } return ContextManager.instance; } public createContext(metadata: Record<string, unknown> = {}): McpContext { this.currentContext = { traceId: this.generateTraceId(), timestamp: Date.now(), metadata }; return this.currentContext; } public getCurrentContext(): McpContext | null { return this.currentContext; } private generateTraceId(): string { return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); } }

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/waldzellai/mcp-agent-ts'

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