---
title: "Add an MCP server to Claude Code and Codex"
description: "Run claude mcp add --transport http in Claude Code or codex mcp add --url in Codex, then sign in. We tested both with the LogBrew MCP server."
canonical: "https://logbrew.co/en/guides/mcp-server-claude-code-codex"
last_updated: "2026-11-10"
---

# Add an MCP server to Claude Code and Codex

Run `claude mcp add --transport http` in Claude Code or `codex mcp add --url` in Codex, then sign in. We tested both with the LogBrew MCP server.

Tested on November 10, 2026 with Claude Code 2.1.319 and Codex CLI 0.167.0

By [Furkan Erday](https://github.com/furkanerday). Furkan Erday is the founder of LogBrew. He builds LogBrew with Claude Code and Codex every day.

Canonical: https://logbrew.co/en/guides/mcp-server-claude-code-codex

## 1 MCP server, 2 agents

LogBrew MCP server `https://logbrew.co/mcp`

Tools `search` `execute`

|  | Claude Code | Codex |
| --- | --- | --- |
|  | `claude mcp add --transport http` | `codex mcp add --url` |
| Saved in | `~/.claude.json` | `~/.codex/config.toml` |
| Before you sign in | `Needs authentication` | `Not logged in` |

## Claude Code

### Add the server

Run this in your project folder. Claude Code adds the server for this project only and saves it in `~/.claude.json`.

```bash
claude mcp add --transport http logbrew https://logbrew.co/mcp
```

Output

```text
Added HTTP MCP server logbrew with URL: https://logbrew.co/mcp to local config
```

### Share it or use it everywhere

`--scope project` writes `.mcp.json` at the project root, so your team gets the server through Git. `--scope user` adds it to all your projects.

```bash
claude mcp add --transport http logbrew --scope user https://logbrew.co/mcp
```

Output

```text
Added HTTP MCP server logbrew with URL: https://logbrew.co/mcp to user config
```

### Check the server

Claude Code checks each server it lists. Before you sign in, a server that uses OAuth shows `Needs authentication`. A server from `.mcp.json` shows `Pending approval` until you approve it in a session.

```bash
claude mcp list
```

Output

```text
Checking MCP server health…

logbrew: https://logbrew.co/mcp (HTTP) - ! Needs authentication
```

### Sign in

Type `/mcp` in a session, pick the server, and approve access in your browser. From your shell, `claude mcp login logbrew` does the same. Add `--no-browser` over SSH.

```bash
/mcp
```

## Codex

### Add the server

Codex writes a `[mcp_servers.logbrew]` table to `~/.codex/config.toml`. If the server uses OAuth, Codex starts the sign-in at once and opens your browser.

```bash
codex mcp add logbrew --url https://logbrew.co/mcp
```

Output

```text
Added global MCP server 'logbrew'.
Detected OAuth support. Starting OAuth flow…
```

### Sign in later or over SSH

If you close the browser tab, sign in later with this command. Over SSH, add `--no-browser`, open the printed URL on another computer, and paste the full redirect URL back into the terminal.

```bash
codex mcp login logbrew
```

### Check the server

Before you sign in, the `Auth` column shows `Not logged in`. Type `/mcp` in an open Codex session to see your active servers.

```bash
codex mcp list
```

Output

```text
Name     Url                     Bearer Token Env Var  Status   Auth
logbrew  https://logbrew.co/mcp  -                     enabled  Not logged in
```

## What we saw when we tested it

We ran every command on this page on macOS, with throwaway config folders set by `CLAUDE_CONFIG_DIR` and `CODEX_HOME`, so no real setup changed.

In Claude Code, each `claude mcp add` printed the file it changed. `claude mcp list` then showed `Needs authentication` for the new server and `Pending approval` for the one in `.mcp.json`.

In Codex, `codex mcp add` printed `Detected OAuth support. Starting OAuth flow…` and then a sign-in URL. We had blocked the browser for the test, so Codex asked us to copy the URL by hand. Expect a browser tab when you add a server that uses OAuth.

We stopped before the consent screen in both agents. The sign-in steps on this page follow the Claude Code and Codex docs.

## Fix invalid transport in mcp_servers

Codex stops with `invalid transport` in `mcp_servers.logbrew` when a server table has neither `url` nor `command`. We got this exact error from an empty `[mcp_servers.logbrew]` table.

Give each table 1 of the 2. Use `url` for a remote server and `command` for a local one. A table with both fails too, with `url is not supported for stdio`. A Claude-style `type = "http"` line does no harm, because Codex ignores it.

Report #40715 shows the same message in the ChatGPT desktop app on Windows, for an `mcp_servers.codex_app` entry the user never wrote. On 26 August 2026 an OpenAI engineer wrote that the team was working on a fix. The report is still open.

Output

```text
Error: failed to load bootstrap configuration

Caused by:
    invalid transport
    in `mcp_servers.logbrew`
```

## Limit tools and wait times in Codex

`enabled_tools` keeps only the tools you list, and `disabled_tools` removes tools after that. `startup_timeout_sec` and `tool_timeout_sec` default to 10 and 60 seconds. The LogBrew server has 2 tools, `search` and `execute`. `codex mcp get logbrew` showed each value we set.

```bash
[mcp_servers.logbrew]
url = "https://logbrew.co/mcp"
enabled_tools = ["search", "execute"]
startup_timeout_sec = 20
```

## Edit the Claude Code config by hand

This is the `.mcp.json` that `--scope project` wrote in our test. Claude Code asks each person to approve the server the first time it starts in that project.

```bash
{
  "mcpServers": {
    "logbrew": {
      "type": "http",
      "url": "https://logbrew.co/mcp"
    }
  }
}
```

## Questions people ask

### Does Claude Code support remote MCP servers?

Yes. Use `--transport http` with the server URL. Claude Code signs you in through `/mcp` or `claude mcp login` when the server uses OAuth.

### Where does Claude Code store MCP servers?

Local and user servers go in `~/.claude.json`. Project servers go in `.mcp.json` at the project root.

### Where does Codex store MCP servers?

In `~/.codex/config.toml`, or in `.codex/config.toml` for a project you trust.

### How do I remove an MCP server?

Run `claude mcp remove logbrew` or `codex mcp remove logbrew`. In Claude Code, run `claude mcp logout logbrew` first if you also want to revoke the token.

## Let your agent read production errors

The LogBrew MCP server gives Claude Code, Codex, and any other MCP client the errors, logs, and traces of the projects you approve. It only reads unless you grant more. Start on the generous free tier, no card needed.

[Connect Your Agent](https://logbrew.co/en/agents)

## Sources

- [Claude Code docs, Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp)
- [Codex docs, Model Context Protocol](https://learn.chatgpt.com/docs/extend/mcp?surface=cli)
- [openai/codex#40715](https://github.com/openai/codex/issues/40715)

## More guides for AI coding agents

- [Use AGENTS.md in Claude Code and Codex](https://logbrew.co/en/guides/agents-md)
- [Fix the Claude overloaded error 529 and rate limit error 429](https://logbrew.co/en/guides/claude-overloaded-rate-limit-error)
- [How to fix errors in Claude Code, Codex, and browser JavaScript](https://logbrew.co/en/guides)
