Skip to content

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.

  1. Install the client - the factorial command, as its own isolated tool:

    uv tool install factorial-compute
    
  2. Sign in - redeems your invitation and saves the key to ~/.config/factorial/credentials, readable only by you. It asks before touching any agent; answer n to keep it to the key alone.

    factorial login inv_...
    

    Already have a key? Set FACTORIAL_API_KEY instead and skip this step.

  3. Add the tools - for Claude Code, for one project only:

    claude mcp add factorial -- uvx --from factorial-compute@latest factorial mcp
    

    or 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.

  4. Add the skill (optional - the tools work without it; the skill makes the agent reach for them unprompted):

    factorial install claude --skill-only
    

    That 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:

  1. installs uv if this machine does not have it;
  2. installs the factorial command with uv tool install factorial-compute;
  3. 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/ - under factorial-compute/SKILL.md;
    • creates an API key just for that agent (named claude-code, codex or cursor), 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).

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}.