layven.

Connect Codex

Add Layven to Codex CLI's config.toml with an agent token. It is TOML, not the mcpServers JSON other clients take.

Last updated 4 August 2026

This takes about two minutes. Codex has no browser approval flow, so you create an agent token in the console and paste it into its config file once.

Before you start: you need a Layven account with at least one workspace. If you have not made one yet, create your drive first.
  1. Create an agent token

    In the Layven console, open Agents and create a token. Scope it to the workspace you want Codex to reach, then copy the secret. It is shown once.

  2. Add Layven to your Codex config

    Open ~/.codex/config.toml and add this block, replacing the token with the one you just copied. Create the file if it is not there.

    ~/.codex/config.toml
    [mcp_servers.layven]
    url = "https://api.layven.io/mcp"
    http_headers = { "Authorization" = "Bearer agd_your_agent_token" }
    Careful: this file is TOML, not the mcpServers JSON that Cursor and Gemini use. Pasting a JSON block here makes Codex fail to read its whole config, not just this server, so every other setting in the file goes with it.

    If you would rather keep the secret out of the file, drop the http_headers line and use bearer_token_env_var = "LAYVEN_TOKEN" instead. Codex then reads the token from that environment variable, which has to be exported in the shell you launch Codex from.

    Careful: config.toml is a dotfile people sync to git. Do not commit it with a token in it, and give each teammate their own token instead of sharing yours.
  3. Confirm the server connected

    Run codex mcp list from your shell, or /mcp inside a Codex session. Layven should show up with its tools listed. Restart Codex if it is still running from before the edit.

  4. Write a test file to confirm it worked

    Ask Codex to create a file:

    Write a file called hello.md in my Layven workspace that says hello from Codex.

    Open the Layven console and look for hello.md at version 1, attributed to the token you created. If it is there, the connection works, and any other agent you connect reads that same file without you copying anything anywhere. You are done.

If it does not connect

Double-check the URL has no trailing slash and no path after /mcp, and that the token was pasted in full with no line breaks. If Codex reports the server but no tools, the token is being rejected: an environment variable that is not exported in the shell Codex was launched from looks exactly like this. If the tools are there but Codex sees no files, the token was granted a different workspace than the one you expected: check its grants under Agents in the console.

Revoke access

Open Agents in the console and revoke the token. It stops working on the next request, and everything Codex wrote stays exactly where it is with its history intact.

Next

Connect a second client and point it at the same workspace. Two agents sharing one drive is the part that does not exist anywhere else: Claude, Claude Code, or Cursor.