Skip to content

Guide

Codex is the ChatGPT route into Foundry VTT.

The ChatGPT app connects through its Codex tab, not the Chat tab you type in every day, and no amount of digging through the Chat tab will turn a Foundry connector up. Codex is OpenAI's own agent, and every ChatGPT plan including Free has that tab. Codex talks to Familiar, and that module has to be switched on in the Foundry world you host. Your existing plan covers the AI side.

Two ways to connect, on camera

Codex registers Familiar from one pasted prompt

The Codex CLI card in Familiar's MCP settings tab in Foundry, at its last step, Verify Connection: the instruction to ask Codex for a Familiar tool, a copy box holding that line, and under it the Stuck? and Rather not do the steps yourself? paragraphs with their Copy help prompt and Copy setup prompt buttons.

Demo clip coming

What the clip will show
  1. Familiar's MCP tab in Foundry, the Codex CLI card open, and Copy setup prompt pressed.
  2. A PowerShell window: codex starts, and the prompt goes in as one paste.
  3. Codex checks Node and its own version, then asks to run the add command. The approval happens on camera.
  4. It appends the Familiar note to AGENTS.md and says to start a new conversation.
  5. A new conversation, one line: Use Familiar's get-world-info tool. It answers with the name of the world.
  6. Back in Foundry, the card's status rows read Connected.

The ChatGPT desktop app, one form and no terminal

The ChatGPT desktop app card in Familiar's MCP settings tab in Foundry, at its Add Familiar step: the menu path to the app's add-server form, the Name value, the line telling you to keep Type on STDIO, the Command to launch box, the Arguments boxes, and the Environment variables Key and Value boxes, each with its own Copy button.

Demo clip coming

What the clip will show
  1. Familiar's MCP tab in Foundry, the ChatGPT desktop app card open, every field with its own copy button.
  2. In the app: the top-left switcher goes to Codex, then Settings, Plugins, the MCPs tab, Add MCP server.
  3. The form fills from the card. The name, Type on STDIO, the command alone in its field, then one row per argument.
  4. The secret goes under Environment variables as a key and a value, not the passthrough list under it.
  5. Save, then the app is quit fully and reopened.
  6. A new conversation, the same one-line ask, and it names the world.

Why the route runs through Codex

Codex is the piece that speaks MCP, so the wire runs Codex to Familiar to your game, and the chat window you normally type into is not on it. Familiar holds the Foundry end: your scenes, sheets and journals for Codex to read, and the tools to change them while the session is running.

The account does not change. You sign in to Codex with the ChatGPT login you already use, so there is no second product to sign up for and no key to buy on this route.

Codex is a developer tool and you are pointing it at a game. It comes as a terminal command or as a tab in the ChatGPT desktop app rather than the chat window you know, and it is the door OpenAI opens for this.

Wiring Codex to your Foundry game

Codex itself is the one install to do first, as the CLI or as the tab already sitting in the ChatGPT desktop app, and either runs on any ChatGPT plan, Free included. The CLI comes from npm on Node 20 or later, and running codex once walks you through signing in with your ChatGPT account. Until that is done, there is nothing for Familiar to attach to.

Then four steps, and the wizard in Familiar's MCP tab hands you the finished command.

  1. Have Familiar listening

    Familiar installed and enabled in the world you run as GM, with its MCP setup tab open in Foundry. That tab is where the finished command comes from, and where you watch the connection land.

  2. Add Familiar to Codex

    On the CLI that is the single command below. In the desktop app you fill in its own add-server form, and the wizard card lists the command and its arguments as separate values, because that form does not split a pasted line. Take the values the wizard generated either way: they carry the real secret, and on Windows npx becomes npx.cmd. The wizard also hands you a short note for ~/.codex/AGENTS.md; paste that in too, or a fresh conversation will not know Familiar exists. On the CLI you can hand the whole step over instead: that card carries a Copy setup prompt button, and the desktop form does not.

  3. Authorise, then ask it something

    Approve the connection, then send it the verify line from the section below. If nothing comes back in your Foundry window, the fault is in the config rather than in Foundry.

  4. Import the module it will run

    A signed-in agent with a live connection still has nothing to run. Import the published adventure first, so your world holds its journals, sheets and statblocks; hand Codex a chapter out of that and it referees and voices that chapter. It has no story of its own to fall back on.

Codex CLI, the ChatGPT desktop app and the Codex IDE extension all read the same file, ~/.codex/config.toml, so setting Familiar up once covers every Codex surface. The desktop app only reads it at startup: quit it fully, reopen, then check Settings, Plugins, MCPs.

Codex CLI
codex mcp add familiar --env FAMILIAR_WS_SECRET=<your-secret> -- npx -y familiar-vtt

What to type first

With Familiar enabled and Codex signed in, keep the first ask small. The verify line below is the smallest one there is, the same one the wizard's card sends you off with: if Codex names your world back, the wiring holds. Then work up.

  • The verify ask
    Use Familiar's get-world-info tool
  • Read the scene
    Read the scene I have open and tell me who is standing in it.
  • Roll a check
    Roll a stealth check for <character> against DC 15.
  • Find a name in your journals
    Search my journals for <NPC name> and give me the passages that mention them.
  • Run a monster's turn
    It's <monster>'s turn. Take it and tell me what it did.

The game happens in Foundry, not in Codex

Ask for a scene change, a token move or a line spoken aloud, and it happens in the Foundry tab in your browser. What comes back to Codex is a short line of text saying so. Your table sees the change; the terminal sees the receipt.

Pictures are the exception. A generated image returns inline, and so does a screenshot of the live battlemap, an annotated frame with numbered badges on the tokens and a legend naming each one. Codex CLI reasons over that picture without ever showing it to you, because a terminal cannot draw it. The desktop app can.

A few conveniences in Familiar's own chat window never reach an MCP client at all, whichever client it is. The list is short, and worth reading before you go hunting for one of them mid-session.

  • Scenes & Tokens
  • Voice & Image Generation

When Codex says no

None of these need a reinstall. Each one is particular to Codex, which is why the fix is rarely where you would look first. The failures every client shares live on the connect guide, linked below.

  • /mcp lists familiar with no tools under it

    A display quirk, not a dead link. Codex keeps MCP tools behind its own tool search, so nothing loads until something calls one. Ask it to use a Familiar tool and watch your Foundry window instead; the list is not the test.

  • It opens a browser, or says it has no Foundry tools

    The note for AGENTS.md is missing, or this conversation started before you saved it. Codex does not announce its tools to the model, so it has to be told in that file. Paste it from the wizard card, then start a new conversation: Codex reads the file at the start of one and never again.

  • The first run times out

    That first start downloads the helper program, and Codex waits only a few seconds. Get the download out of the way: run npx -y familiar-vtt once in a terminal and let it finish, where a complaint about the secret is the expected ending rather than a fault. Or raise the wait with startup_timeout_sec = 60 under [mcp_servers.familiar] in config.toml, which is the one setting the desktop form has no field for.

  • The desktop app shows the server as failed after you save

    Saving does not start it. The form has no restart button, so the server is only picked up on the next launch, and if it still reads failed after you have quit and reopened, do that once more with a minute in between.

  • It worked in one window, then not in the next

    Normal, and nothing is broken. Every thread starts its own copy of the helper, and they share one port: the first copy holds it and the rest attach to that one as peers, so each thread still reaches your game. If a thread does come up without them, start a new conversation, give it a few seconds, and ask for a Familiar tool by name rather than asking whether it is connected.

  • Nothing you type reaches Foundry at all

    Check which surface you are typing in. The Chat tab, ChatGPT Classic and a Codex session running in the cloud all run on OpenAI's machines, and none of them can reach a program on yours. Use the Codex side of the desktop app, or the terminal.

Or skip Codex and paste an OpenAI key

Codex is a developer tool, and not every GM wants one on the machine. Skipping it takes an OpenAI API key instead: put one in Familiar's settings and the model answers from a panel inside the Foundry window rather than a terminal. OpenAI bills that key by the token. The dial for how hard it thinks sits on this route too, and the rungs on offer vary by model family.

One trap before you pay for anything. Your ChatGPT plan and an OpenAI API balance are separate pools, so topping up one does nothing for the other. Familiar's own subscription is a third line, outside both pools. Pick a lane.

More in Connect your assistant

New to Familiar? I'm Ryan, the person who built it. The Discord is small and brand new, so if you join now I'll help you get set up myself.