Connect an MCP server and verify a real tool call. The example uses OpenAI Docs MCP in Codex CLI to search for and read a document, with troubleshooting and a separate local practice server.
MCP gives an agent access to specific server tools. One server searches documentation; another reads files or changes records. First find out exactly what the chosen source provides.
Step 1. Example of connection in Codex CLI
This example is published in official Docs MCP instructions. The server provides read access to documentation and does not call the OpenAI API on your behalf.
These commands are for the CLI. For another client, check its current connection instructions. If the server requires authentication, complete its sign-in process; do not put a key or password into a shared copyable prompt.
In Codex CLI, configure the connection with a terminal command, not a button in the report below. Ask Codex to check codex mcp list and, if the server is absent, run codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp. Then run codex mcp list again. If the CLI is not installed, first use the client choice and installation guide and choose an available client. Do not paste CLI commands into an ordinary chat’s message field as shell commands.
Choose your client
| Client | Where to connect |
|---|---|
| Desktop app | Settings → MCP servers → Add server, then Restart |
| Codex CLI | codex mcp add, followed by codex mcp list |
| Codex IDE extension | Gear menu → MCP servers → Add server, then Restart extension |
For OpenAI Docs, select Streamable HTTP and use https://developers.openai.com/mcp. STDIO is for a server started by a local command. A URL and a process command configure different transports.
On the same Codex host, the app, CLI and extension share configuration. The default file is ~/.codex/config.toml; a project .codex/config.toml loads for trusted projects. Ask Codex to find an existing entry before adding a duplicate. ChatGPT web does not read these local files; it uses available plugins. Connection options.
If a server requires OAuth, use Authenticate in the server list or codex mcp login with its configured name. The public OpenAI Docs server does not need an OpenAI API key. After sign-in, still check a real call as described below.
Step 2. How to check MCP call
After connecting, ask the Codex chat to find and read a document about skills through OpenAI Docs MCP. Expand the agent actions beneath the reply: you need a search_openai_docs call followed by fetch_openai_doc. The first searches for the page; the second retrieves its content. Check that both calls finish without errors and that the link matches the request. A server appearing only in configuration does not yet confirm a working connection.
A successful check shows two results: search returned the required page’s address, and reading returned its text. Compare the assistant’s answer with that text and open the link. The pictured report comes from an earlier run, not from configuring your client.
Step 3. Connect for One Check Only
If you don't want to save the server in settings, ask Codex to perform a temporary check from a separate training folder without changing user configuration. Ask the agent to check the current codex --help and prepare a temporary run for your CLI version.
Requires installed Codex CLI and configured login. Before running, check that the chosen command uses a separate session and allows only the required reading. Uses your Codex login, so this is not anonymous model access. Do not run checks from a folder with personal documents.
Step 4. What to do in case of error
If a launch error occurs, check the command and program availability. For login errors, verify authorization for the specific service. For your own server, separately check allowed files, missing files, and attempts to read outside the training folder.
| What you see | What to check |
|---|---|
| Server listed, but no calls | Whether the server and required tool are enabled, and the client restarted after setup |
| Local server startup error | Command, dependencies and working directory in the actual execution environment |
| HTTP 401 or 403 | Sign-in to the correct service and account permissions; a longer timeout does not grant access |
| Hanging call or timeout | Address, network and server status; check connectivity before changing timeout settings |
Ask Codex to show the called tool's name and the specific error without keys or tokens. Reading one public page does not establish access to other service data.
Delete connection via client settings or command from current codex mcp --help. Local server process may require separate shutdown.
Step 5. How to replicate local example without accounts
Ask Codex to download and unpack the practice MCP kit into a separate folder, read README, server.mjs, and test.mjs, check the code and run the test. The server reads only training notes. The test creates fictional files, connects a local client, and closes it after verification. Your Obsidian storage is not needed. You confirm necessary access; preparation and launch are done by Codex.
Following the kit README, ask Codex to run pnpm install --frozen-lockfile --ignore-scripts, then node test.mjs. Expected success is 9/9; details are saved in results.json.
This is a separate local SDK check. An earlier 9/9 result does not confirm today’s Codex reading or Windows operation. Use fictional files without concurrent replacement; this sample is not a complete safeguard for other people’s secrets.
What you will have
Successful search and reading of a specific document confirm that the connection works.
Next: How to check permissions and AI agent access.
Prompt for Codex
Paste into your project chat:
Connect the official OpenAI documentation MCP: https://developers.openai.com/mcp. First check the current setup method for my Codex client and the server permissions. Then use it to find and read a document about Codex skills. Show the link and results of both calls. Explain any connection failure.
