openai_websearch
Provides web search and image search capabilities by leveraging OpenAI's native server-side web search via the Codex/ChatGPT Responses API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openai_websearchWhat are the latest breakthroughs in AI?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
openai_websearch
Self-hostable MCP server and reusable API client that exposes OpenAI's native server-side web search via the Codex/ChatGPT Responses API.
Uses your existing Codex CLI auth (ChatGPT subscription) — no API keys, no Exa, no Brave, no third-party search services. Zero dependencies.
Two ways to use this
MCP server — drop into any MCP-compatible client (Hermes, OpenCode, Claude Code, etc.)
NPM package — import as a library in any Node.js/Bun/Deno project for free web search
Related MCP server: websearch-mcp
As an MCP server
Tools
Tool | Description |
| Full-text web search with real URLs, citations, and configurable depth |
| Image search returning image URLs and source pages |
Config
Add to your MCP client config:
{
"mcpServers": {
"openai_websearch": {
"command": "node",
"args": ["/path/to/openai_websearch/index.js"]
}
}
}As a library (NPM package)
Install
# Local install from repo
git clone https://github.com/hffmnnj/openai_websearch.git
cd openai_websearch && npm link
# Or add as a dependency in package.json
"dependencies": {
"openai_websearch": "github:hffmnnj/openai_websearch"
}Quick start
import { search, imageSearch } from 'openai_websearch';
// Web search
const results = await search('smart ring market size 2026');
console.log(results.text);
console.log(results.searchQueries); // queries OpenAI actually ran
console.log(results.usage); // token counts
// Image search
const images = await imageSearch('oura ring product photos');
console.log(images.text); // URLs and descriptionsAdvanced usage
import { createClient } from 'openai_websearch';
// Custom client with explicit options
const client = createClient({
model: 'gpt-5.6-luna', // default model
authPath: '/custom/auth.json', // custom codex auth path
});
// Use per-call options
const fast = await client.search('quick fact', { contextSize: 'low' });
const deep = await client.search('thorough research', { contextSize: 'high', model: 'gpt-5.6-luna' });
const imgs = await client.imageSearch('competitor screenshots');Explicit auth (no codex file needed)
const client = createClient({
accessToken: 'eyJhbG...', // raw JWT
refreshToken: 'rt.1.AAB...', // for auto-refresh
accountId: 'uuid-here',
});
const result = await client.search('test query');API reference
search(query, opts?) / client.search(query, opts?)
Param | Type | Default | Description |
|
| required | What to search for |
|
|
| How much web context to retrieve |
|
|
| OpenAI model to use |
Returns { text, searchQueries, usage, model }.
imageSearch(query, opts?) / client.imageSearch(query, opts?)
Same params as search(). Returns image URLs and source pages.
createClient(opts?)
Param | Type | Default | Description |
|
|
| Path to Codex auth file |
|
| — | Explicit JWT (skip file loading) |
|
| — | For auto-refresh |
|
| — | ChatGPT account ID |
|
|
| Default model |
Result shape
{
text: string; // The answer / search results
searchQueries: string[]; // Queries OpenAI actually searched for
usage: {
input_tokens: number;
output_tokens: number;
total_tokens: number;
} | null;
model: string; // Model used for this request
}Configuration
Env var | Default | Description |
|
| Path to Codex auth file |
|
| Default OpenAI model |
Requirements
Node.js 18+ (for native
fetch), Bun, or DenoCodex CLI installed and authenticated (
codex→ log in with ChatGPT)
How it works
Reads OAuth tokens from
~/.codex/auth.json(where Codex CLI stores them)If token is expired, refreshes via the OpenAI OAuth endpoint automatically
Sends search requests to the ChatGPT backend Responses API with
{"type": "web_search"}Parses SSE stream, extracts search queries and results
Returns structured results (as a library) or MCP tool responses (as a server)
All search runs server-side at OpenAI — same infrastructure that powers ChatGPT's web search.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProvides intelligent web search capabilities using OpenAI's Web Search API with reasoning models. Supports localized results, multiple model options, and automatic source citations for current information retrieval.13
- AlicenseAquality-maintenanceEnables web searching via SearXNG, page content extraction with Crawl4AI, and image analysis using vision language models. It provides AI agents with tools for information synthesis and web-based data retrieval through OpenAI-compatible LLM endpoints.3
- Alicense-qualityDmaintenanceProvides intelligent web search capabilities using OpenAI's reasoning models, enabling AI assistants to fetch up-to-date information with smart reasoning.MIT
- Flicense-qualityCmaintenanceProvides free web search, content fetching, image search, and deep research via SearXNG, no API keys required.
Related MCP Connectors
The best web search for your AI Agent
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
x402-gated web search gateway. Tools: search, search_enriched.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/hffmnnj/openai_websearch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server