Library
Guides/15 minutes read

7 best MCP servers for Codex in 2026

Published August 28, 2026
HC

Harkirat Chahal

Growth

Share this article


7 best MCP servers for Codex in 2026
SUMMARY

Codex can inspect a codebase, edit files, and run terminal commands, but many development tasks depend on systems outside the repository. MCP servers bring current documentation, GitHub activity, browser testing, production errors, databases, and project tickets into the session. This guide compares seven MCP servers and explains what each provides, when Codex should call it, and how to connect it.

Codex can inspect a codebase, edit files, and run terminal commands, but many development tasks depend on information and systems outside the repository. MCP servers bring those sources into the session, giving Codex access to current documentation, GitHub activity, browser testing, production errors, databases, and project tickets. You can configure tool availability and approval requirements for each server in config.toml.

This guide reviews seven MCP servers that support common Codex tasks. It explains what each server provides, when Codex should call it, how to connect it, and what level of access it requires. For version-specific implementation questions, Mintlify Index is the first server to add because its public MCP server retrieves the relevant documentation pages with source URLs and requires no account or API key.

The seven MCP servers at a glance

ServerCodex jobHow to connectAccess levelBest for
Mintlify IndexCurrent technical documentationnpx mint index --codexRead-only, with no account or API keyVersion-specific APIs, configuration, and migrations
GitHub MCPRepository activityStreamable HTTPRead and write, based on GitHub permissionsIssues, pull requests, Actions runs, and search
Playwright MCPBrowser automationLocal npx serverLocal browser controlChecking rendered pages and frontend behavior
Sentry MCPProduction debuggingStreamable HTTP with OAuthProject data and selected management toolsTracing live errors back to relevant code
PostgreSQL MCP ProDatabase inspectionLocal uvx serverConfigurable database accessSchema review, query analysis, and performance
Linear MCPProject and task contextStreamable HTTP with OAuthRead and write, with a read-only endpointWorking from issues and acceptance criteria
Tavily MCPFocused web researchStreamable HTTPRead-only web retrievalFinding information outside formal documentation

Connect Codex to current technical documentation with Mintlify Index →

A minimal Codex MCP stack

Start with Mintlify Index, GitHub MCP, and Playwright MCP. Together, they cover a common Codex task from research through validation. Mintlify Index retrieves up-to-date technical documentation and supporting source URLs, GitHub MCP provides repository activity that may not appear in the local codebase, and Playwright MCP checks how the finished change behaves in a browser.

Add the remaining servers when the work depends on their data. Sentry supports tasks that begin with a production error, PostgreSQL MCP helps with database and query analysis, Linear supplies requirements stored in project issues, and Tavily searches technical information published outside formal documentation. Keeping the initial stack small also gives Codex a more focused toolset and makes permissions easier to review.

7 best MCP servers for Codex

1. Mintlify Index for current documentation

Best for: Version-specific questions about APIs, configuration, setup, and migrations.

Codex can read dependency versions from a repository, but the correct implementation may depend on documentation published after the model's training cutoff. Mintlify Index retrieves focused technical context with supporting source URLs, giving Codex current publisher documentation before it recommends an API or configuration. Index covers more than 200,000 libraries, frameworks, and APIs and can also retrieve information from the broader technical web.

The public Index MCP server provides a single context tool for documentation research. It requires no Mintlify account or API key and can be added to Codex with:

npx mint index --codex

The Mintlify CLI adds https://index.mintlify.com/mcp to ~/.codex/config.toml. It also installs a usage rule that directs Codex to retrieve documentation for questions involving syntax, configuration, setup, and migrations. The connection applies globally by default. Adding --project writes it to .codex/config.toml for the current repository.

Verify the connection from the terminal:

codex mcp list

The output should show mintlify-index, the public MCP endpoint, and an enabled status. You can also enter /mcp inside Codex to confirm that the context tool is available.

After verifying the connection, test retrieval with a question where the framework version changes the correct answer. LangChain JavaScript v1 is a useful example because the release introduced createAgent as the standard agent API, replacing the older createReactAgent pattern.

Use Mintlify Index to find the current recommended way to create and invoke a basic agent in LangChain JavaScript v1.

Explain what replaces createReactAgent and show a concise example that passes a user message to the agent. Limit retrieval to docs.langchain.com. Include a source URL for every API or behavior you recommend. Do not edit any files.

The prompt tells Codex which library and which version to look up, and restricting retrieval to docs.langchain.com keeps LangChain tutorials and blog posts out of the answer. Asking for a source URL on every recommendation gives you a page to open before you accept the code.

Mintlify Index returned the LangChain JavaScript v1 release notes. The retrieved source identifies createAgent as the standard API for building agents in LangChain v1 and explains that it replaces createReactAgent from LangGraph.

Open the cited release notes before applying the recommendation and confirm that the proposed implementation uses the documented createAgent API. If Codex subsequently edits the project, run its normal build and tests to validate the change against the installed LangChain version.

Access and context: Mintlify Index retrieves public technical information through one read-only tool. It cannot inspect or modify repository files, databases, or external accounts. The product and includeDomains parameters focus retrieval on the intended documentation, and tokenBudget controls how much retrieved material enters the Codex session.

2. GitHub MCP for repositories and pull requests

Best for: Tasks that depend on pull request reviews, issue discussions, repository history, and other GitHub activity.

Codex can inspect the files and Git history available in a local repository. The GitHub MCP server adds GitHub-hosted information, including issues, pull requests, review comments, commits, and workflow activity. With that history in the session, Codex can trace a change back through the review discussion that produced it without leaving the terminal.

The hosted server requires a GitHub personal access token. Store the token in GITHUB_PAT_TOKEN and limit its repository access and permissions to what Codex needs. For investigation tasks, connect the read-only endpoint:

codex mcp add github --url https://api.githubcopilot.com/mcp/readonly --bearer-token-env-var GITHUB_PAT_TOKEN

The token remains in the environment, and Codex stores only the variable name in its configuration.

Use GitHub MCP to inspect pull request #88 and its linked issue. Summarize the requested change, identify any unresolved review comments, and find the latest commit that modified the relevant code. Include links to the pull request, issue, and commit. Report your findings only. Do not push changes, post comments, merge the pull request, or edit any files.

Naming pull request 88 and its linked issue keeps Codex from crawling the wider repository, and the closing instructions stop it from posting or merging anything. Direct links let you read the review thread before acting on the summary.

Access and context: The /readonly endpoint exposes GitHub's read tools and prevents changes to repositories, issues, and pull requests. The personal access token determines which repositories and data the server can read. GitHub also supports narrower toolsets, which can reduce the number of tools Codex must consider when a task only needs repositories, issues, or pull requests.

3. Playwright MCP for browser automation

Best for: Checking how a web page behaves after a frontend change.

Reading component code tells Codex what a page is expected to do. Playwright MCP lets it open the page in a browser, interact with elements, and inspect the resulting state. It works from structured accessibility snapshots, which give Codex the roles, labels, and text it needs to navigate a page.

The server requires Node.js 20 or later and can run through npx. The --isolated option starts each session with a separate browser profile:

codex mcp add playwright -- npx -y @playwright/mcp@latest --isolated

For example, ask Codex to verify one defined browser flow:

Use Playwright MCP to open the staging pricing page and switch the currency selector to EUR. Turn on annual billing and verify that the displayed total updates correctly. Report any console errors and describe the final page state. Stop before checkout and do not submit any forms.

This request gives Codex a specific flow, an expected result, and a clear stopping point. You can then compare the report with the intended pricing behavior.

Access and context: Playwright can navigate, click, type, and submit forms on any page it opens. Use local or staging environments and test accounts for automated checks. Isolated sessions keep the test separate from your normal browser data, and limiting each request to one flow prevents unnecessary page snapshots from filling the Codex context.

4. Sentry MCP for production errors

Best for: Investigating production errors that are difficult to reproduce locally.

The Sentry MCP server gives Codex access to error details such as stack traces, affected releases, event counts, and project information. Codex can use this evidence to compare production failures with the repository code and identify where an investigation should begin.

Sentry authenticates through OAuth, so scope the connection to one organization and project, and Codex receives only the matching tools and data:

codex mcp add sentry --url https://mcp.sentry.dev/mcp/{organizationSlug}/{projectSlug}
codex mcp login sentry

A narrow production investigation might look like this:

Use Sentry MCP to inspect the three most frequent unhandled errors in the api-gateway project during the last 24 hours. Compare their event counts, affected users, and releases, then recommend which error to investigate first and explain why. Include a link to each Sentry issue. Do not resolve, assign, or change the status of any issue.

Naming the project and the time window stops Codex from ranking every error in the organization. Counts, releases, and issue links let you check its ranking before you open a single file.

Access and context: OAuth determines which Sentry organizations and projects Codex can access. Sentry events may contain request and application data, so each request should name a project, issue, release, or time window. The server also includes management tools, so investigation-only instructions and approval checks are important before changing any Sentry data.

5. PostgreSQL MCP Pro for database inspection

Best for: Understanding database schemas, diagnosing slow queries, and evaluating possible indexes.

Migration files may not reflect the complete state of a running database. Postgres MCP Pro lets Codex inspect schemas, describe tables, review query plans, and simulate how a proposed index could affect query performance.

After installing uv, set the database connection string as DATABASE_URI in the environment that launches Codex. Then add the following configuration to ~/.codex/config.toml:

[mcp_servers.postgres]
command = "uvx"
args = ["postgres-mcp", "--access-mode=restricted"]
env_vars = ["DATABASE_URI"]

The env_vars setting forwards the existing connection string to the server without storing it directly in config.toml. Restricted mode limits database operations to read-only transactions and applies an execution-time limit.

For query diagnosis, give Codex a defined read-only task:

Use PostgreSQL MCP Pro to inspect the subscriptions and invoices tables, then explain why the billing reconciliation query uses a sequential scan. Propose an index and compare the current execution plan with the simulated plan. Do not create the index or modify any schema or data.

This request asks Codex to examine the schema and query plan before recommending an index. Comparing the current and simulated plans shows whether the proposed index is likely to improve the query.

Access and context: Use a dedicated read-only database account in the DATABASE_URI, even when the MCP server runs in restricted mode. Database schemas and query results can add substantial context and may expose sensitive records, so identify the relevant tables and query instead of requesting a broad database inspection.

6. Linear MCP for project and task context

Best for: Tasks where requirements, decisions, and edge cases live in Linear issues and comments.

Codex can understand the code in a repository, but it cannot infer every decision recorded by the product or engineering team. Linear MCP lets it read issues, projects, and comments so the implementation plan reflects the agreed requirements.

Linear provides a dedicated read-only endpoint and uses OAuth:

codex mcp add linear --url https://mcp.linear.app/mcp/readonly
codex mcp login linear

To bring the relevant ticket context into the task, ask:

Use Linear MCP to read issue PLT-1044 and its comment thread. List every acceptance criterion the current webhook handler must satisfy, including edge cases mentioned in comments but missing from the issue description. Identify any unresolved questions. Do not update the issue or add comments.

Providing the issue key keeps retrieval on the task. Separating acceptance criteria, edge cases, and unresolved questions gives Codex usable implementation context without asking it to change the project record.

Access and context: The /readonly endpoint exposes only tools that retrieve Linear data. OAuth limits access to the connected workspace. Long issue histories can add substantial context, so identify a specific issue or project instead of asking Codex to search the entire workspace.

7. Tavily MCP for focused web research

Best for: Research that depends on announcements, standards pages, maintainer discussions, or other sources outside product documentation.

Tavily MCP gives Codex tools for web search, page extraction, site mapping, and crawling. It is useful when the answer must be assembled from several current web sources rather than retrieved from one product's technical documentation.

The hosted server supports OAuth, which keeps the Tavily API key out of the MCP URL:

codex mcp add tavily --url https://mcp.tavily.com/mcp/
codex mcp login tavily

For focused research, define the source and date boundaries in the request:

Use Tavily MCP to find first-party sources published during the last 12 months about Node.js 24 changes that affect native addons. Restrict the research to nodejs.org and the official nodejs GitHub organization. Summarize the relevant changes and include the publication date and URL for every source. Skip third-party summaries.

Twelve months and two domains rule out the stale third-party posts that dominate search results for Node.js releases. Publication dates tell you whether a change landed in the version you are running.

Access and context: Tavily's search, extraction, mapping, and crawling tools retrieve public web content. Broad searches can return more material than Codex needs, so each request should specify the topic, date range, preferred domains, and desired result type. Use Mintlify Index for version-specific library and API documentation, and reserve Tavily for research that spans announcements, discussions, and other web sources.

Add and verify an MCP server in Codex

Codex stores MCP connections in ~/.codex/config.toml. You can also place a connection in .codex/config.toml to limit it to a trusted project. The Codex CLI and IDE extension share this configuration, so a server added through one is available in the other.

Use the command that matches the server's transport:

ActionCommand
Add a hosted HTTP servercodex mcp add <name> --url <server-url>
Add a local servercodex mcp add <name> -- <launch-command>
Authenticate with OAuthcodex mcp login <name>
List configured serverscodex mcp list
View active servers and tools/mcp inside Codex

A saved connection still has to be exercised. Finish the check inside Codex with one narrow, read-only request that names the server you want it to call, then confirm the tool ran and returned data.

For the complete configuration options, see the official Codex MCP documentation.

Permissions, secrets, and overlapping tools in Codex

An MCP server can access whatever its account, token, browser session, or database role permits. Codex adds controls over which tools are available and when approval is required, so configure both layers before connecting a server that can change repositories, databases, or external services.

  • Prefer read-only access. GitHub and Linear provide dedicated read-only endpoints, while Postgres MCP Pro supports --access-mode=restricted for read-only transactions. Use write access only when the task requires it.
  • Keep secrets in environment variables. Codex supports bearer_token_env_var for bearer tokens, env_http_headers for secret header values, and env_vars for variables passed to local servers. If a server supports OAuth, authenticate with codex mcp login <name> instead of placing a token directly in its configuration.
  • Require approval for write tools. Setting default_tools_approval_mode = "writes" lets read-only tools run normally but asks for approval before other tools execute. You can also use enabled_tools to expose only the tools required for the task.
  • Limit the underlying credentials. Pair a read-only server setting with least-privilege access. Restrict GitHub tokens to the required repositories, use a read-only Postgres role for inspection, and scope Sentry or Linear access to the relevant projects.
  • Keep retrieved context focused. Documentation pages, issue threads, database schemas, and production traces all add material to the task. Ask for the specific version, repository, project, or domain instead of retrieving everything available.

Avoid connecting several servers for the same purpose. Use Mintlify Index for up-to-date technical documentation and Tavily for broader web research, then connect GitHub, Playwright, Sentry, Postgres, or Linear when the task needs their data. Clear roles give Codex fewer overlapping tools to choose from and keep each request short.

Troubleshoot or remove a Codex MCP server

Inspect the connection before deleting and adding it again. Codex can show a server's saved configuration, refresh its authentication, temporarily disable it, or remove it completely.

Issue or actionWhat to do
Inspect one serverRun codex mcp get <name> --json
Check all configured serversRun codex mcp list
Renew an OAuth connectionRun codex mcp login <name>
Clear stored OAuth credentialsRun codex mcp logout <name>
Disable a server temporarilySet enabled = false in its config.toml entry
Remove a serverRun codex mcp remove <name>
A project-level server does not appearConfirm that Codex trusts the project directory
A local server does not startRun its launch command directly and check that -- separates the add options from the command

If the connection still fails, confirm that any required environment variable is available in the shell that starts Codex. Restart Codex after changing config.toml so it loads the new configuration. For a local STDIO server, running the launch command separately usually reveals missing packages, invalid arguments, or unavailable environment variables.

Why Mintlify Index comes first

Mintlify Index takes the first spot because current technical documentation supports almost every Codex task, from planning an implementation to debugging version-specific behavior. Index retrieves relevant publisher documentation during the task and returns source URLs that developers can review before Codex changes the code.

Anthropic, Perplexity, Replit, and Lovable use Mintlify to publish technical documentation. Index can search their public Mintlify documentation when Codex needs current guidance for working with their products.

Give Codex current technical context with Mintlify Index →

Frequently Asked Questions

Which MCP server should I install first in Codex?

For a general-purpose coding setup, start with Mintlify Index. Documentation questions span frameworks, libraries, and APIs, while most other servers become useful only when a task reaches a specific repository, browser, database, or external service.

Do MCP servers work in Codex project settings?

Codex supports project-scoped MCP connections through .codex/config.toml, which loads after the project directory is trusted. This keeps repository-specific servers separate from the connections available in every Codex session. You can add Mintlify Index at this level with npx mint index --codex --project.

How do I remove an MCP server from Codex?

Run codex mcp remove to delete its configuration. Set enabled = false when you may need the server again, or use codex mcp logout to clear OAuth credentials without removing the connection.

How many MCP servers should Codex have connected at once?

Three to five is a useful range, but Codex doesn't require a specific number. Keep servers with distinct roles that you use regularly, then add specialized connections for individual tasks. If two servers expose similar search or action tools, disable one or give Codex a clear routing instruction.

Web search reaches engineering posts, release announcements, standards, and maintainer discussions, while a documentation server checks versioned APIs, configuration options, and publisher-maintained guidance. Mintlify Index also returns source URLs with the retrieved documentation, so you can verify the recommendation.

Is Mintlify Index free to use with Codex?

The public Mintlify Index MCP server is free during beta and does not require a Mintlify account, API key, or OAuth login. Its per-IP limits are 10 requests per second and 1,000 requests per day, which is sufficient for normal interactive use in Codex.

Can my documentation become an MCP server?

Mintlify automatically hosts a Search MCP server at the /mcp path of a documentation site. Public pages can be searched without authentication. Sites with protected documentation can use /authed/mcp, which returns content based on each user's existing access permissions.