Best MCP Servers for Codex in 2026 (Ranked and Tested)
The best MCP servers for OpenAI Codex in 2026, ranked and tested: GitHub, Context7, Playwright, Postgres, Exa, and the essential picks, with the exact codex mcp add commands and the context-cost tradeoffs of running many at once.
The best MCP servers for Codex in 2026 connect OpenAI’s coding agent to systems it cannot reach on its own: GitHub, your database, a real browser, live library docs, and the web. A short, well-chosen set works better than a long one, because every server adds tools to the agent’s context and every credential widens the surface you have to trust. This guide ranks the servers worth installing, gives the exact codex mcp add command for each, and flags the popular picks that Codex already makes redundant. For the underlying config mechanics, see the Codex MCP setup guide.
Best MCP servers for Codex: ranked comparison
| MCP server | Best for | Install command | Context cost | Notes |
|---|---|---|---|---|
| GitHub | Issue and PR workflow | codex mcp add github --url https://api.githubcopilot.com/mcp | High | Official hosted server; OAuth via codex mcp login github |
| Context7 | Up-to-date library docs | codex mcp add context7 -- npx -y @upstash/context7-mcp | Low | Two tools, cuts API hallucination |
| Playwright | Browser automation and E2E | codex mcp add playwright -- npx @playwright/mcp@latest | Medium | Microsoft official, drives the accessibility tree |
| Postgres | Database schema and queries | codex mcp add postgres -- npx -y @modelcontextprotocol/server-postgres <read-only-dsn> | Low | Use a read-only role |
| Exa | Live web search and research | codex mcp add exa --env EXA_API_KEY=... -- npx -y exa-mcp-server | Low | Semantic search built for agents |
| Sentry | Production error triage | codex mcp add sentry --url https://mcp.sentry.dev/mcp | Medium | Official hosted server, OAuth in the browser |
| Linear | Tickets and project status | codex mcp add linear --url https://mcp.linear.app/mcp | Medium | Official remote server over streamable HTTP |
| Figma | Design-to-code handoffs | Remote server; see Figma’s MCP docs | Medium | Useful for frontend teams |
| Sequential Thinking | Structured step planning | codex mcp add seq -- npx -y @modelcontextprotocol/server-sequential-thinking | Low | Situational; GPT models already plan in steps |
| Filesystem | Extra directory access | codex mcp add fs -- npx -y @modelcontextprotocol/server-filesystem <dir> | Low | Usually redundant with Codex’s built-in tools |
If you use Nimbalyst, the built-in tracker MCP server adds a low-cost planning surface on top of any of these. The full list of useful Codex MCP servers runs to dozens, but the ten above cover most working developers, and the first five cover most of the value.
How Codex MCP config works (the 60-second version)
Codex registers servers with the codex mcp commands, which write to ~/.codex/config.toml under [mcp_servers.<name>] tables. Stdio servers take a launch command after --, remote servers take --url with a streamable HTTP endpoint, and OAuth-based remote servers authenticate with codex mcp login <name>. Three Codex-specific facts matter for this list:
- One config, every surface. The CLI, the IDE extension, and the desktop app all read the same
config.toml, so a server you add once is available everywhere, and a malformed TOML line breaks all three. Prefer thecodex mcp addcommands over hand-editing. - Config loads at startup. Restart Codex after adding a server, then confirm it connected with
/mcpin the TUI orcodex mcp listoutside it. - You can trim what the agent sees.
enabled_toolsanddisabled_toolsin a server’s table filter its toolset, andstartup_timeout_secrescues slow-starting servers. These are the levers this guide leans on for the bigger servers.
The “essential 5” everyone recommends, tested against Codex
Roundups in this category converge on the same five: Filesystem, GitHub, Context7, Playwright, and Sequential Thinking. Three of them earn a place in a Codex setup. Two are mostly redundant with what Codex already ships, and installing them anyway just crowds the tool list.
- GitHub. Keep it. The highest-impact server for most developers, covered in detail below.
- Context7. Keep it. Two tools, low cost, and it noticeably reduces wrong-API-signature errors on unfamiliar libraries.
- Playwright. Keep it for frontend work. A real browser the agent can drive to verify its own UI changes.
- Filesystem. Skip it for most Codex users. Codex already reads and edits files and runs commands inside its own sandbox, gated by approval modes. If your goal is keeping the agent away from certain paths, the sandbox and approvals are the right lever. Install the Filesystem server only when you specifically want to expose additional directories through MCP or share one server config across several MCP clients.
- Sequential Thinking. Situational. It adds a single tool that gives the agent a scratchpad for step-by-step reasoning. Current GPT models already plan with adjustable reasoning effort, so the lift is smaller than on models without native planning. Try it on gnarly multi-step tasks and drop it if you do not see better results.
The context cost and security tradeoff of running many servers
Two hidden costs grow with every server you add.
Context and tool budget. Each server’s tools are described to the model and weigh on every turn. A long tool list makes the agent slower to choose and more likely to reach for the wrong tool. The cost is not uniform: Context7 adds two tools, while the GitHub server exposes dozens across issues, PRs, Actions, and code search. Codex’s enabled_tools filter is the cleanest answer: expose the handful of GitHub tools your workflow uses and hide the rest.
Credentials and blast radius. Every server is a token and a permission surface. A write-capable Postgres DSN or an admin-scoped GitHub token is a footgun the moment the agent misfires. Three habits keep this in check:
- Read-only roles wherever the work allows it (databases especially).
- Fine-grained tokens scoped to the exact repos, projects, or channels in play.
- Secrets in environment variables via
--envorbearer_token_env_var, never in a checked-in file. Keep project-scoped.codex/config.tomlfor server definitions that travel with a trusted repo, and keep the tokens out of it.
A practical rule: three to six servers for most developers. Add one per project when a real need shows up, and remove any server the agent never calls.
Best MCP server by use case
If you want the pick for one specific job rather than a full stack:
| Use case | Pick | Why |
|---|---|---|
| GitHub workflow | GitHub (official hosted server) | Issues, PRs, code search, and Actions in one server |
| Database work | Postgres with a read-only DSN | Schema reading and safe query analysis |
| Browser automation and E2E | Playwright (Microsoft) | Real browser, accessibility-tree driven, self-verifies UI |
| Web search and research | Exa (or Brave for free) | Semantic retrieval tuned for agents |
| Library and API docs | Context7 | Version-aware docs, fewer hallucinated signatures |
| Tickets and planning | Linear (or Nimbalyst Tracker in-app) | Reads and updates project state |
| Production errors | Sentry | Stack traces and issue triage in context |
The detailed list
1. GitHub MCP server
The single highest-impact install for most developers. GitHub ships an official MCP server, and the cleanest path is the hosted remote endpoint:
codex mcp add github --url https://api.githubcopilot.com/mcp
codex mcp login github
The login command runs the OAuth flow in your browser, so no token lands in a config file. Scope access to the repos and permissions Codex actually needs, and for team projects use a service account so the agent’s actions are auditable separately from your own. This is also the server that benefits most from enabled_tools: its toolset is the largest on this list, and trimming it to the issue and PR tools you use keeps the agent sharp.
What it unlocks: “Find the issues tagged blocking. Write a PR that closes the top one. Open it as a draft, link the issue, and request review from the owner of the affected module.”
2. Context7 MCP server
Context7 keeps live, version-aware documentation for hundreds of libraries. The agent fetches the right docs for the right version on demand instead of guessing.
codex mcp add context7 -- npx -y @upstash/context7-mcp
Two tools, low context cost, broadly useful. Context7 also offers a hosted remote endpoint if you would rather not run it locally.
What it unlocks: Less hallucination on library APIs. Instead of guessing the current React or Prisma signature, the agent looks it up.
3. Playwright MCP server
Microsoft maintains the official Playwright MCP server. It drives a real browser through the accessibility tree rather than screenshots, which keeps its context footprint lower than image-based automation.
codex mcp add playwright -- npx @playwright/mcp@latest
What it unlocks: The agent can verify its own UI changes by actually using the app. “Add the new payment form. Then open the checkout page in the browser, fill it out, and confirm the success state appears.”
4. Postgres MCP server
For database-backed projects, exposing the database to Codex transforms what it can do: schema reading, query writing, data inspection, and (if you choose) mutations.
codex mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://readonly@localhost/mydb
Strong recommendation: use a read-only role. Postgres MCP with a read-only DSN is safe and fast. Postgres MCP with a write-capable DSN is a footgun unless you trust the agent fully and have backups. The ecosystem also has actively maintained community options such as Postgres MCP Pro if you want query analysis and stricter write controls.
What it unlocks: “Read the schema. Find the slowest query in the slow_log table. Write a candidate index. Run EXPLAIN ANALYZE before and after.”
5. Exa MCP server (web search)
For live web research without leaving the agent, Exa is the most-used search server for coding agents. Its API is built around semantic queries and structured results rather than keyword matching.
codex mcp add exa --env EXA_API_KEY=your-key -- npx -y exa-mcp-server
Pick one search server and stop. Running Exa plus Brave plus Tavily together is a common reason the agent picks the wrong tool. Brave Search is a solid free, privacy-first alternative with an independent index, and Parallel offers a free hosted search endpoint you can add with a single --url.
What it unlocks: “Pull the three most recent posts on this library’s breaking change, summarize the migration steps, and check them against our current version.”
6. Sentry MCP server
If you ship to production, Sentry wires error context into Codex. It reads recent issues, groups by frequency, and pulls stack traces.
codex mcp add sentry --url https://mcp.sentry.dev/mcp
codex mcp login sentry
Sentry runs an official hosted MCP server over streamable HTTP, and every connection authenticates with OAuth, so you approve access in the browser rather than managing a token. You can also scope the endpoint to an organization or project by appending the slugs to the URL.
What it unlocks: “Look at this morning’s top three Sentry errors. Find the underlying bug in the code. Open a fix PR for the worst one.”
7. Linear MCP server
For teams that live in Linear, this turns Codex into a participant in the planning system. It reads tickets, updates status, leaves comments, and creates new issues.
codex mcp add linear --url https://mcp.linear.app/mcp
codex mcp login linear
Linear’s official server runs over streamable HTTP at https://mcp.linear.app/mcp, and Linear’s docs include a Codex setup section. If the OAuth flow gives you trouble, check Linear’s current docs, since the Codex path has required a feature flag in some versions.
What it unlocks: “Read all open bugs assigned to me. Pick the one with the smallest scope. Open a fix branch, write the patch, and link the Linear ticket from the PR.”
8. Figma MCP server
For frontend teams working from designs, Figma’s MCP server lets the agent read frames, components, and design tokens instead of guessing layout from a screenshot. Add it as a remote server following Figma’s current MCP documentation, since the endpoint and auth details have changed during the year.
What it unlocks: “Read the checkout redesign frame. Implement the new layout in our component library, matching the spacing and type tokens.”
9. Sequential Thinking MCP server
A single tool that gives the agent a structured scratchpad for step-by-step reasoning.
codex mcp add seq -- npx -y @modelcontextprotocol/server-sequential-thinking
Situational for Codex, since GPT models already plan in steps with adjustable reasoning effort. Worth trying on hard multi-step tasks, and worth removing if it does not change the output.
What it unlocks: A more explicit plan-then-act loop on tangled problems, at the cost of one extra tool.
10. Nimbalyst Tracker MCP server
If you use Nimbalyst, the built-in tracker MCP server gives Codex direct access to your in-app plans, tasks, and bugs. The agent can create, update, and close tracker items as part of normal work, with the changes appearing in real time on your kanban board.
What it unlocks: Plans, tasks, and bugs that stay in sync without the agent ever leaving the workspace.
Honorable mentions
- Brave Search for free, privacy-first web research with an independent index.
- Notion for teams whose source-of-truth lives there instead of Linear.
- Stripe for SaaS work that touches billing.
- Cloudflare for edge and DNS workflows.
- Codex itself. Run
codex mcp-serverand Codex becomes an MCP server another agent can call, which turns it into a building block in multi-agent setups.
The MCP ecosystem doubles every few months. Bookmark the official MCP servers repository for the canonical list.
A sensible starter pack
If you want a day-one setup to install and tune later:
codex mcp add github --url https://api.githubcopilot.com/mcp
codex mcp login github
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp add linear --url https://mcp.linear.app/mcp
Restart Codex, confirm the servers with /mcp, and add Postgres, Sentry, Playwright, or a search server when the project demands them. Resist installing servers you do not have a clear use for. Each one expands the agent’s tool list, and a bloated tool list hurts the agent’s decision quality.
Codex MCP servers in Nimbalyst
Nimbalyst is the open-source visual workspace for building with Codex, Claude Code, and more. The most useful extra MCP server to pair with Nimbalyst is usually GitHub, because Nimbalyst already gives you the visual session layer, tracker, and review workflow. The next-best adds are whatever connect Codex to systems outside the workspace: Linear for tickets, Postgres or Sentry for backend work, and Playwright for UI verification. The MCP configuration you keep in ~/.codex/config.toml carries over into Nimbalyst sessions, so once you wire those up they show up in both places. For the full setup walkthrough, see the Codex MCP setup guide.
Frequently Asked Questions
How many MCP servers should I run with Codex?
Three to six is the sweet spot for most developers. Start with GitHub plus one or two project-specific servers, then add Context7 if you frequently work across unfamiliar stacks. Past ten servers, the agent’s tool list gets crowded and its tool choice degrades, and the enabled_tools filter becomes essential rather than optional.
Do MCP servers slow Codex down?
They can. Every server adds its tools to the agent’s context, which gives the model more options to weigh on each step. Low-tool servers like Context7 cost little, while large ones like the GitHub server add a lot. Keep the set small, trim big servers with enabled_tools in config.toml, and remove servers the agent never calls.
What is the best MCP server for GitHub in Codex?
The official GitHub MCP server. Add the hosted endpoint with codex mcp add github --url https://api.githubcopilot.com/mcp, authenticate with codex mcp login github, and Codex can work issues, pull requests, code search, and Actions. Trim its large toolset with enabled_tools and use a service account on team repos so the agent’s actions stay auditable.
What is the best MCP server for Codex overall?
GitHub, for most developers. It turns Codex from a code generator into a participant in the issue and pull request workflow. If you use Nimbalyst, GitHub is also the cleanest complement, since Nimbalyst already covers the visual session and review layer.
Do I need the Filesystem MCP server for Codex?
Usually no. Codex already reads and edits files and runs commands inside its own sandbox with approval modes. Install the Filesystem server only when you specifically want to expose extra directories through MCP or reuse one server config across several MCP clients.
Why is my MCP server not showing up in Codex?
Codex reads MCP config at startup, so restart Codex after adding a server, then check /mcp inside the TUI or codex mcp list outside it. Other common causes are a TOML typo in config.toml, a command that does not resolve on PATH, a missing token, or a slow server tripping the startup timeout, which you can raise with startup_timeout_sec.
Related Reading
Related pages
-
Codex MCP setup guide
The step-by-step guide to installing, scoping, and debugging MCP servers in Codex.
-
Best MCP servers for Claude Code
The same roundup for the other major agent, if you run both.
-
Best Codex GUI Tools and Desktop Apps in 2026
Where to host and review Codex's work, from OpenAI's app to visual workspaces.
Related posts
-
Codex vs Cursor (2026): Which One Should You Use?
Codex vs Cursor compared for 2026 on agent autonomy, editing, models, surfaces, parallel sessions, code review, pricing, and open source. A clear, current guide to picking the right one, with a full comparison table.
-
OpenCode vs Codex (2026): Which AI Coding Agent to Use
OpenCode vs Codex compared for 2026 on models, surfaces, LSP feedback, openness, safety, and pricing. See which AI coding agent fits your workflow, and how to run both side by side.
-
Best AI Agent Orchestration Platforms 2026: Coding vs Workflow
AI agent orchestration means two different products. Compare control planes for your own coding agents (Nimbalyst, Orca, Emdash, Superset, Conductor, Warp) against workflow frameworks like LangGraph and CrewAI.