Setting up a coding agent¶
Claude Code, Codex and Cursor can run Factorial's models directly, without writing code. That takes two things in the agent's configuration: the tools (an MCP server) and a skill (a Markdown file saying what Factorial can do and how to call it). You can set them up by hand, or have the installer do it.
Nothing here is needed to use the API itself - see the Quickstart.
By hand¶
You need uv and an API key.
-
Install the client - the
factorialcommand, as its own isolated tool:uv tool install factorial-compute -
Sign in - redeems your invitation and saves the key to
~/.config/factorial/credentials, readable only by you. It asks before touching any agent; answernto keep it to the key alone.factorial login inv_...Already have a key? Set
FACTORIAL_API_KEYinstead and skip this step. -
Add the tools - for Claude Code, for one project only:
claude mcp add factorial -- uvx --from factorial-compute@latest factorial mcpor for every project, with
--scope user. For Codex:codex mcp add factorial -- uvx --from factorial-compute@latest factorial mcp. For Cursor, add the same command to.cursor/mcp.json. -
Add the skill (optional - the tools work without it; the skill makes the agent reach for them unprompted):
factorial install claude --skill-onlyThat writes one file,
~/.claude/skills/factorial-compute/SKILL.md. Read it first - it is published word for word.
With the installer¶
curl -LsSf https://api.factorialcompute.com/install.sh | sh -s -- inv_...
Read the script before running
it. It first lists what it will do and asks before doing any of it; with
--project after the invitation, the agents are set up for the current folder
only. In order, it:
- installs uv if this machine does not have it;
- installs the
factorialcommand withuv tool install factorial-compute; - runs
factorial login inv_... --yes, which redeems the invitation and saves the key to~/.config/factorial/credentials; then, for each of Claude Code, Codex and Cursor that it finds installed:- writes the skill to that agent's user folder -
~/.claude/skills/,~/.codex/skills/or~/.cursor/skills/- underfactorial-compute/SKILL.md; - creates an API key just for that agent (named
claude-code,codexorcursor), so its usage shows separately and it can be revoked on its own; - registers the tools for your user:
claude mcp add --scope user,codex mcp add, or an entry merged into~/.cursor/mcp.json(every other server in it kept).
- writes the skill to that agent's user folder -
Without --project it writes nothing into any project: these are user-wide
settings, so the tools are available in every folder. With --project, the skill
and the tools go into the current folder instead - .claude/skills/, .mcp.json,
.cursor/ - and nothing user-wide. (Codex keeps its tools per user only, so it is
left alone then.) factorial install --project does the same on a machine that is
already signed in.
Undoing it¶
claude mcp remove --scope user factorial # or: codex mcp remove factorial
rm -r ~/.claude/skills/factorial-compute # and ~/.codex/skills/..., ~/.cursor/skills/...
factorial logout # deletes the saved key
uv tool uninstall factorial-compute
The agents' own keys can be revoked with factorial keys revoke or
DELETE /v1/keys/{key_id}.