Use the xysq MCP server with OpenAI Codex CLI so Codex can call xysq tools for memory and identity-aware context. Codex CLI supports remote HTTP MCP servers natively as a stable feature — no wrapper required.Documentation Index
Fetch the complete documentation index at: https://docs.xysq.ai/llms.txt
Use this file to discover all available pages before exploring further.
Before You Connect
Sign in to your xysq account at app.xysq.ai.Step 1 — Generate Your API Key
- After logging in, click the Connect Agent button.
- Select the Codex tab (or any tab that exposes API keys — the key format is identical).
- Click Generate API Key. Copy the
xysq_...key — it won’t be shown again.
Step 2 — Export the Token
Codex CLI’s recommended pattern is to keep secrets out of the config file and reference them by environment variable:~/.zshrc, ~/.bashrc, or shell profile so it persists.
Step 3 — Edit Codex CLI Config
Codex CLI reads MCP servers from~/.codex/config.toml (TOML, not JSON).
Open the file (create it if it doesn’t exist):
bearer_token_env_var tells Codex to read the named env var and inject it as Authorization: Bearer <value> on every request.
If you’d rather use a static header (less safe):
Step 3 (alternative) — Use codex mcp add
Codex CLI ships an interactive command that writes the same block for you:
https://api.xysq.ai/mcp, and select Bearer token from env var when asked.
Step 4 — Verify
xysq listed with its status. From inside a Codex session, type /mcp to see live tools and connection state.
Step 5 — Use It
Start a Codex session:Pinning Codex to a team vault
To scope Codex to a specific team, change the URL:YOUR_TEAM_ID in Team Settings at app.xysq.ai. Team-pinned connections route all memory actions to the team vault and disable personal-only tools.
You can register multiple entries (xysq, xysq-acme, xysq-platform) and switch via the agent — no file editing required between contexts.
Approval flow
Codex CLI respects its global approval mode (Auto, Limited, Full Access) for MCP tool calls. If you’re being prompted on every memory call, raise the mode via/permissions inside a session.
Troubleshooting
| Problem | Fix |
|---|---|
codex mcp list doesn’t show xysq | Confirm the TOML block is under [mcp_servers.xysq] exactly (not [mcp_server.xysq] or [mcp-servers.xysq]). |
| Auth fails with 401 | Confirm XYSQ_MCP_TOKEN is exported in the shell that launched Codex. Run echo $XYSQ_MCP_TOKEN to check. |
| Connection times out | Bump startup_timeout_sec to 30. Some networks need longer for the OAuth handshake. |
| Tool calls hang | Bump tool_timeout_sec to 120 if you’re doing large recalls. |
| Wrong vault scope | Confirm the url is /mcp for personal or /mcp/team/<id> for a team. |