@nekobato/chatgpt-websearch-mcp
Version:
A local MCP stdio server that provides access to the OpenAI (ChatGPT) API with web search capabilities for Claude Code and other MCP clients.
37 lines (36 loc) • 993 B
TypeScript
import { type SupportedModel } from '../utils/models.js';
export interface ChatRequest {
prompt: string;
model: SupportedModel;
system?: string;
temperature?: number;
effort?: 'minimal' | 'low' | 'medium' | 'high';
verbosity?: 'low' | 'medium' | 'high';
searchContextSize?: 'low' | 'medium' | 'high';
maxTokens?: number;
maxRetries?: number;
timeoutMs?: number;
stream?: boolean;
}
export interface ChatResponse {
content: string;
model: string;
usage?: {
input_tokens: number;
output_tokens: number;
};
}
export interface StreamChunk {
content: string;
done: boolean;
}
export declare class ChatGPTClient {
private openai;
constructor(apiKey?: string);
private createOpenAIClient;
private validateRequest;
chat(request: ChatRequest): Promise<ChatResponse>;
chatStream(request: ChatRequest): AsyncGenerator<StreamChunk>;
private callResponsesAPI;
private streamResponsesAPI;
}