Connect Codex to TokenKit

MCP setup Codex declares MCP servers in its configuration file; the block below is all it needs.

Before you start

  • TokenKit installed on macOS 14 or later, and opened once.
  • Codex installed and working.

1. Add TokenKit to Codex

In TokenKit, open Connections and copy the setup for Codex. It is this, with the path of your copy of the app:

[mcp_servers.tokenkit]
command = "/Applications/TokenKit.app/Contents/MacOS/tokenkit"
args = ["mcp"]

Codex keeps this in ~/.codex/config.toml.

2. Authorise a folder

In TokenKit, open Permissions, press Add folder… and choose the folder the agent may use. Until you do, every call is answered with “not authorised”.

3. First test

Check that the agent sees TokenKit:

Start Codex and ask which tools it has.

Then ask for something in the folder you authorised, for example: “Which pages of the PDF in that folder mention payment terms?”

Troubleshooting

  • “TokenKit is not open”: open the app, or switch on “Open at login” in Settings (Mac App Store version).
  • “outside the authorised folders”: add the folder in Permissions.
  • “part of TokenKit Pro”: the tool or option is not in the free plan.
  • The agent does not list TokenKit: check the path in the setup and restart the agent.

Disconnect

Delete the [mcp_servers.tokenkit] block from ~/.codex/config.toml.

Revoke file access

Remove the folder in Permissions. The next call to anything inside it is refused. You do not need to disconnect the agent.

Tell us how it goes

If anything does not work as described here, write to us and we will help.