This guide shows you how to configure the Sita MCP server in Codex CLI to enable powerful codebase Q&A capabilities.
You must configure the MCP server for each repository you want to work with. Each repository requires its own configuration section with a unique repo ID.
Important: Codex CLI uses mcp_servers (with underscore) as the top-level key, not mcpServers like JSON-based tools.

Configuration Steps

1

Locate Configuration File

Open the Codex CLI configuration file located at:
~/.codex/config.toml
Create this file if it doesn’t exist.
2

Add MCP Server Configuration

Add an mcp_servers section to your TOML configuration file.
3

Configure Sita Server

Add the Sita MCP server configuration using TOML format (see examples below).
4

Save and Restart

Save the configuration file. The MCP server will be available next time you use Codex CLI.

Single Repository Configuration

To configure Sita for a single repository, add this to your ~/.codex/config.toml:
# IMPORTANT: Use mcp_servers (with underscore), not mcpServers
[mcp_servers.sita-qna]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "http://localhost:3000/api/mcp",
  "--header",
  "x-repo-id: YOUR_REPO_ID"
]
env = { "NODE_ENV" = "production" }
Replace YOUR_REPO_ID with your repository ID. The repo id can be copied from repos tab.

Multiple Repository Configuration

To configure multiple repositories, add separate server entries for each:
[mcp_servers.frontend-qna]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "http://localhost:3000/api/mcp",
  "--header",
  "x-repo-id: frontend-app"
]

[mcp_servers.backend-qna]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "http://localhost:3000/api/mcp",
  "--header",
  "x-repo-id: backend-api"
]

[mcp_servers.mobile-qna]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "http://localhost:3000/api/mcp",
  "--header",
  "x-repo-id: mobile-app"
]
Give each server configuration a descriptive name (like frontend-qna, backend-qna) to easily identify which repository it connects to.

Using Environment Variables

You can use an environment variable for the repo ID with the env field:
[mcp_servers.sita-qna]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "http://localhost:3000/api/mcp",
  "--header",
  "x-repo-id: ${REPO_ID}"
]
env = { "REPO_ID" = "your_repo_id" }

Create Configuration via Command Line

You can create the configuration file with this command:
mkdir -p ~/.codex && cat > ~/.codex/config.toml << 'EOF'
[mcp_servers.sita-qna]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "http://localhost:3000/api/mcp",
  "--header",
  "x-repo-id: YOUR_REPO_ID"
]
EOF
Then edit the file to add your actual repository ID:
nano ~/.codex/config.toml

Verification

After adding the configuration:
  1. Save the ~/.codex/config.toml file
  2. Run Codex CLI with a query about your codebase
  3. The MCP server tools should be available for use
If you encounter a “string does not match pattern” error, it may indicate a compatibility issue between the MCP server’s tool naming convention and Codex CLI’s validation rules. Contact support if this occurs.

Next Steps

  • Set up MCP in Claude Code for CLI integration
  • Configure Cursor with MCP support
  • Try Cline for VSCode integration