Codex Setup
Use this guide when Codex should use Roster tools for customer approval routing, participant lookup, delegations, labels, projects, and Resolve history.
Prerequisites
Section titled “Prerequisites”- A reachable Roster MCP endpoint, such as
https://roster.example.com/mcp. ROSTER_MCP_RESOURCE_URIset to the exact public MCP URL.ROSTER_MCP_AUTH_MODE=oauthfor normal end-user access.- Optional:
ROSTER_MCP_AUTH_MODE=api_keyfor API-key-only deployments, orapi_key,oauthwhen OAuth and API-key clients are both allowed.
For example:
ROSTER_MCP_RESOURCE_URI=https://roster.example.com/mcpAdd The Server
Section titled “Add The Server”Roster is a Streamable HTTP MCP server. Add it with the Codex CLI:
codex mcp add roster --url https://roster.example.com/mcpcodex mcp listYou can also add it from the Codex UI. Open Settings > Integrations > MCP servers, select Add server, choose to connect a custom MCP server, select Streamable HTTP, then enter:
Name: rosterURL: https://roster.example.com/mcpFor OAuth, leave Bearer token env var empty. For API-key mode, see API-key setup for Codex.
After saving, roster appears in the MCP servers list. Keep the server toggle
enabled before starting a Roster-backed Codex task.
You can also edit ~/.codex/config.toml directly:
[mcp_servers.roster]url = "https://roster.example.com/mcp"For OAuth, run this if the browser login does not start automatically, or after
editing config.toml directly:
codex mcp login rosterCodex stores the OAuth grant locally after login. Restart Codex after changing
the configuration, then use /mcp to confirm that the roster server is
connected.
API-Key Setup For Codex
Section titled “API-Key Setup For Codex”Use API keys only for automation flows that should not open an OAuth browser flow. The key is a Roster API key for the acting identity; it is not the Roster server’s deployment secret. To obtain and use one:
- In Roster, an admin opens Identity and Access > API Keys.
- Create a key for the active identity that should own the Codex actions.
- Grant only the needed MCP scopes.
- Copy the one-time
rst_...token and store it in a secure environment variable, for example:
export ROSTER_MCP_BEARER_TOKEN="rst_..."- In the Codex UI, set Bearer token env var to that variable name:
Bearer token env var: ROSTER_MCP_BEARER_TOKENOr configure the same value in ~/.codex/config.toml:
[mcp_servers.roster]url = "https://roster.example.com/mcp"bearer_token_env_var = "ROSTER_MCP_BEARER_TOKEN"Codex sends the key as a bearer token to the MCP endpoint:
Authorization: Bearer rst_...Use a narrow key for resolve-only workflows:
mcp:resolve mcp:resolve-requests:read mcp:projects:read mcp:participants:readUse broader write scopes only when Codex is expected to create or update Roster data. API-key access is still limited by the key owner’s Roster permissions and the target resource rules.
Tool Selection
Section titled “Tool Selection”Adding the MCP server gives Codex access to Roster tools, but it does not guarantee Codex will choose Roster for every relevant prompt. A customer workspace can distribute a Roster instruction or skill so Codex knows Roster is the source of truth for approval routing, ownership, participants, delegations, projects, labels, and recent Resolve history.
Codex Skill
Section titled “Codex Skill”Use this skill instruction when packaging Roster behavior for a customer workspace:
---name: rosterdescription: Use live Roster MCP for approval routing, ownership, participants, delegated contacts, project membership, labels, and latest Resolve request retrieval. Use when the user asks who should approve, handle, review, own, or be contacted for a business task, even if the user does not mention Roster by name.---
# Roster
Use the live Roster MCP server as the source of truth for current operationalanswers. Do not reconstruct Roster data from files or stale examples whenMCP is available.
## Workflow
1. For open-ended routing or contact questions, call the Roster `resolve` tool.2. For latest Resolve history, call `list_resolve_requests`, choose the newest request, then call `get_resolve_request`.3. For exact project, participant, label, delegation, or membership checks, use the matching Roster lookup tools.4. Return only the fields or contacts the user asked for.Skill Distribution
Section titled “Skill Distribution”For customer or team distribution, package the skill as a Codex plugin. Keep the customer’s Roster MCP URL and authentication in their Codex MCP settings because those values are deployment-specific.
A small Roster plugin can be as simple as:
roster-codex-plugin/ .codex-plugin/ plugin.json skills/ roster/ SKILL.mdExample plugin.json:
{ "name": "roster", "version": "1.0.0", "description": "Roster approval-routing workflows for Codex.", "skills": "./skills/"}Customer rollout:
- Publish the customer-hosted Roster MCP endpoint with OAuth enabled.
- Ask users to add the MCP server and complete OAuth login.
- Distribute the Roster Codex skill or plugin.
Connection Check
Section titled “Connection Check”Ask Codex:
Use Roster to list my visible projects, then resolve who should handle vendorsecurity review for Atlas Operations.Then test implicit routing without naming Roster:
Who should approve vendor security review for Atlas?Codex should choose the Roster workflow and return the selected participants or contacts. If it does not, tighten the distributed instruction or skill description, then restart Codex if the updated skill is not detected.
If the server connects but tools return insufficient_scope, update the Roster
API key or OAuth grant to include the missing mcp:* scope.