MCP auth repeatedly resets when multiple server entries use the same hosted Linear URL

Open 💬 2 comments Opened Jun 6, 2026 by dvyio
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What issue are you seeing?

I am seeing repeated auth failures with Linear MCP in both Codex App and Codex CLI.

I have three Linear MCP server entries:

  • linear — global/default, for my personal Linear team
  • linear_tce — project-specific
  • linear_tcetest — project-specific

In the TCE project config I disable the global linear entry, so Codex should only use linear_tce and linear_tcetest for that project.

This worked fine until a few days ago. Since then, Codex repeatedly hits auth issues and I have to log in again to all three Linear MCP entries several times per day.

One detail that may matter: all three entries point at the same hosted Linear MCP URL:

https://mcp.linear.app/mcp

They only differ by Codex MCP server name. Could the auth/session cache be keyed by the MCP URL rather than by the Codex server name?

What steps can reproduce the bug?

  1. Configure a global Linear MCP server named linear with URL https://mcp.linear.app/mcp.
  2. In a project-level Codex config, disable linear.
  3. In that same project config, add two Linear MCP servers named linear_tce and linear_tcetest, both using URL https://mcp.linear.app/mcp.
  4. Authenticate each Linear MCP entry.
  5. Use Codex App and Codex CLI across the global workspace and the project workspace.
  6. After some time, observe that Codex starts reporting auth issues and requires logging in again to all three MCP entries.

The issue is intermittent, but currently happens several times per day.

What is the expected behavior?

Each MCP server entry should keep its own auth state, even when multiple entries use the same hosted MCP URL.

Disabling the global linear entry in a project config should not disturb auth for linear_tce or linear_tcetest, and auth should not reset several times per day.

Additional information

Versions:

  • Codex App: 26.602.40724
  • Codex CLI: v0.137.0
  • macOS: 26.0.1 (25A362)

Relevant config shape:

Global ~/.codex/config.toml:

[mcp_servers.linear]
url = "https://mcp.linear.app/mcp"

Project .codex/config.toml:

[mcp_servers.linear]
enabled = false

[mcp_servers.linear_tce]
url = "https://mcp.linear.app/mcp"

[mcp_servers.linear_tcetest]
url = "https://mcp.linear.app/mcp"

Project agent instructions also tell agents to use linear_tce for TCE-* issues and linear_tcetest for TCETEST-* issues, never the global linear MCP.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #26586

Powered by Codex Action

dvyio · 2 months ago

Update: I think I have a workable setup for my use case, in case it helps anyone.

The goal was to use different Linear workspaces from the same machine, with different Codex projects using different Linear MCP identities.

The approach that seems to work is to avoid the Linear MCP OAuth flow for these project-specific entries and use per-workspace Linear API keys via bearer_token_env_var.

Global ~/.codex/config.toml:

[mcp_servers.linear]
url = "https://mcp.linear.app/mcp"
bearer_token_env_var = "LINEAR_PERSONAL_MCP_TOKEN"

Project .codex/config.toml:

[mcp_servers.linear]
enabled = false

[mcp_servers.linear_tce]
url = "https://mcp.linear.app/mcp"
bearer_token_env_var = "LINEAR_TCE_MCP_TOKEN"

[mcp_servers.linear_tcetest]
url = "https://mcp.linear.app/mcp"
bearer_token_env_var = "LINEAR_TCETEST_MCP_TOKEN"

Then I added the env vars to ~/.zshenv:

export LINEAR_PERSONAL_MCP_TOKEN='...'
export LINEAR_TCE_MCP_TOKEN='...'
export LINEAR_TCETEST_MCP_TOKEN='...'

This does not prove the OAuth/session bug is fixed, but it gives a cleaner workaround for multi-workspace Linear MCP usage:

  • no repeated browser OAuth prompts
  • no shared OAuth cache between same-URL MCP aliases
  • no tokens stored directly in Codex config
  • each project-specific MCP entry gets its own Linear workspace token