UNPKG

bottlenecks-mcp-server

Version:

Model Context Protocol server for Bottlenecks database - enables AI agents like Claude to interact with bottleneck data

48 lines 1.63 kB
/** * OAuth Client for MCP Authentication * Handles API key validation and HTTP requests to Vercel-deployed APIs */ import { MCPConfig, APIResponse } from '../types/mcp.js'; export declare class MCPOAuthClient { private config; private apiKey?; constructor(config: MCPConfig, apiKey?: string); /** * Set API key for authenticated requests */ setApiKey(apiKey: string): void; /** * Get the API base URL for constructing links */ getApiBaseUrl(): string; /** * Make authenticated HTTP request to API */ request<T = any>(endpoint: string, options?: { method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; body?: any; headers?: Record<string, string>; requireAuth?: boolean; }): Promise<APIResponse<T>>; /** * Validate API key with the server */ validateApiKey(): Promise<boolean>; /** * Get user information from API key */ getUserInfo(): Promise<APIResponse<any>>; /** * Check if user has required permissions * * Instead of trying to query the keys endpoint (which requires session auth), * we'll just skip permission checking and let the actual API calls handle validation. * This is more reliable since the API endpoints already have proper scope validation. */ checkPermissions(scopes: string[]): Promise<boolean>; /** * Handle rate limiting and retries */ requestWithRetry<T = any>(endpoint: string, options?: Parameters<typeof this.request>[1], maxRetries?: number): Promise<APIResponse<T>>; } //# sourceMappingURL=oauth-client.d.ts.map