Connect Contextick to Claude Code or Codex CLI
For Claude Code and Codex CLI the simplest connection is OAuth: no API key, no config file. You approve a browser sign-in once and it's connected. An API key is the fallback for headless or CI setups. What differs between the two is the exact command and field names, so the snippets below aren't interchangeable. Pick your tool.
What you'll need
- Claude Code or Codex CLI installed.
- Nothing else for the OAuth path — you'll approve the connection in your browser.
Prefer OAuth where it's offered: there's no key to create, store, or leak, and the command is a single line. Use an API key only when a browser sign-in isn't possible (CI, headless).
How the connection works
Contextick is a standard remote MCP server over streamable HTTP. Each tool needs the endpoint
https://contextick.ai/mcp and a name for the server. Over OAuth that's all you supply —
the tool handles sign-in and there's no key or header. Over the API-key fallback you
add one more thing: an Authorization: Bearer <your API key> header. Anything else in
the snippets is that tool's own spelling of these.
Claude Code
Two commands, no key, no file editing. Register the server, then sign in — the second command opens
your browser to approve. (claude mcp add only registers the server; the OAuth sign-in is
claude mcp login.)
claude mcp add --transport http contextick https://contextick.ai/mcp
claude mcp login contextick
Check it with claude mcp list. On a headless or SSH box, run
claude mcp login contextick --no-browser — it prints a URL to open elsewhere and paste the
result back. For unattended CI, use the API-key method instead.
Codex CLI
One command. Codex detects that Contextick supports OAuth and starts the browser sign-in itself — no key, no file editing:
codex mcp add contextick --url https://contextick.ai/mcp
The --url flag registers a remote streamable-HTTP server; with no bearer token, Codex
takes the OAuth path automatically. Check it with codex mcp list. No browser available
(CI, headless)? Use the API-key method instead.
Connecting with an API key
Use a key when a browser sign-in isn't possible — CI or a headless server. Create one at your account page under MCP connection → API keys → Create API key.
Two things about the key. It's shown once, right after you create it — copy it then, because you can't view it again. And the name you give the key becomes the origin recorded on everything saved through it, so name it after the tool you're connecting.
The snippets below read the key from CONTEXTICK_API_KEY, so set it in your shell first:
export CONTEXTICK_API_KEY="your-api-key"
Claude Code with a key
Pass the header on the same command:
claude mcp add --transport http contextick https://contextick.ai/mcp \
--header "Authorization: Bearer $CONTEXTICK_API_KEY"
Or write it into .mcp.json by hand:
{
"mcpServers": {
"contextick": {
"type": "http",
"url": "https://contextick.ai/mcp",
"headers": {
"Authorization": "Bearer ${CONTEXTICK_API_KEY}"
}
}
}
}
"type": "http" is required here. Claude Code reads an entry with no
type as a local stdio server, so omitting it is a hard error rather than a silent fallback —
you'll see "has a url but no type". This is the one field people copy away from other tools'
docs and lose.
Codex CLI with a key
Codex uses TOML, not JSON. Add this to ~/.codex/config.toml (or
.codex/config.toml in a project):
[mcp_servers.contextick]
url = "https://contextick.ai/mcp"
bearer_token_env_var = "CONTEXTICK_API_KEY"
Two things to notice: the table is mcp_servers in snake_case, not
mcpServers. And Codex takes the name of the environment variable holding your key
rather than the key itself — so the key never lands in the file.
Check it worked
Test it in two parts, and make the second part a new session. If you ask in the same one, the tool can answer from what you just said without ever calling Contextick — so a broken connection would still look like it worked.
- Save something you'd actually want back. At the end of a session where you worked something out, say: "Save the migration steps we just worked out to Contextick."
- Quit, start a new session, and ask: "What are the migration steps we worked out?"
If it comes back in the new session, you're connected — and you've just seen the point of it: you didn't have to explain it again. That note is also available in Claude, ChatGPT, or any other AI you connect to Contextick, and anything you saved from a chat app is readable here too.
If it doesn't show up
- Claude Code errors about a url with no type. Add
"type": "http". See above. - The tool starts but has no Contextick tools. Restart it — these tools read their config at startup. Then check the file is valid JSON or TOML.
- You connected via OAuth and calls fail with an auth error. The sign-in can expire
or be revoked. Re-run that tool's add/login command to authorize again (for Codex,
codex mcp login contextick). - The API-key method fails with an auth error. Check
CONTEXTICK_API_KEYis actually set in the shell you launched the tool from:echo $CONTEXTICK_API_KEY. Note that a key set in your shell profile won't reach an app launched from a desktop icon. - You lost the key. Keys are shown once. Create a new one and delete the old one from your account page.