Skip to main content
Glama

Scrapeless MCP Server

import { Context } from "./context.js"; import { API_KEY } from "./config.js"; export class ContextManager { private static instance: ContextManager; private contexts: Map<string, Context>; private constructor() { this.contexts = new Map<string, Context>(); } public static getInstance(): ContextManager { if (!ContextManager.instance) { ContextManager.instance = new ContextManager(); } return ContextManager.instance; } public getContext(apiKey?: string): Context { const key = apiKey ?? API_KEY; if (!this.contexts.has(key)) { console.log( `Creating new Context for API key: ${key?.substring(0, 8)}...` ); this.contexts.set(key, new Context(key)); } else { console.log( `Reusing existing Context for API key: ${key?.substring(0, 8)}...` ); } return this.contexts.get(key)!; } public clearContext(apiKey?: string): void { const key = apiKey ?? API_KEY; if (this.contexts.has(key)) { this.contexts.delete(key); console.log(`Cleared Context for API key: ${key?.substring(0, 8)}...`); } } public clearAllContexts(): void { this.contexts.clear(); console.log("Cleared all Contexts"); } public getContextCount(): number { return this.contexts.size; } }

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/scrapeless-ai/scrapeless-mcp-server'

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