# Connect Codex

> Add Gorila to Codex's config.toml and sign in from the CLI.



## Steps

1. Add Gorila to ~/.codex/config.toml:

   ```
   [mcp_servers.gorila]
   url = "https://app.gorila.la/api/mcp"
   ```

2. Sign in:

   ```
   codex mcp login gorila
   ```

3. Paste this block into AGENTS.md (~/.codex/AGENTS.md for every project, or the repo's AGENTS.md).

   Block to paste (AGENTS.md):

   ```markdown
   ## Gorila
   
   your organization uses Gorila (MCP server "gorila") as its shared work memory: the team's tasks and company knowledge (brand tone, copy rules, SOPs, policies, decisions).
   
   ALWAYS:
   - Before writing anything for your organization (emails, customer replies, copy, ads, posts, docs) or running a recurring process, call get_relevant_knowledge with a short description of the situation, and follow what it returns.
   - Facts about your organization itself (product, pricing, customers, policies) are in Gorila: call get_relevant_knowledge before searching the web or leaving a placeholder.
   - When I correct your tone, a process or a fact that could apply again, call propose_knowledge_change. Nothing is published until a person approves it.
   - When I mention work for someone else ("tell Ana to…", "this is for Esteban"), offer to create_task with full context (background, goal, done criteria, links) so their AI can do it.
   - When I start working or ask what's next, call list_my_tasks.
   - When you start working on a Gorila task, set it to doing with update_task; when it's finished (for code: its pull request merged), set it to done with a comment of what you did. Don't wait for me to ask.
   - Put a Gorila task's id in the title or branch of its pull requests and comment_task the link; comment again when it's merged or closed.
   - Store distilled, reusable text in Gorila, never raw documents, full emails or chat logs.
   - If a person or a task is ambiguous, ask me. Never guess.
   - When a task's end comes after this session (a reply, a merge, an approval), set what it's waiting for and when to look again (waiting_on, recheck_at), not only a comment.
   ```

4. Let your AI work between sessions: a nightly run turns what you committed to into tasks, prepares the most urgent ones and checks the rest, and never sends anything. In the Codex app, open Automations, add a daily automation with the prompt your AI gives you when you ask it to "let my AI work for me", and keep Gorila's MCP server enabled. It runs while the computer is awake and Codex is open.

## Let your AI do it

Paste this into Codex and it follows the steps for you. Run codex mcp login gorila in a terminal and sign in.

```
Set up Gorila for me:
1. Add this to ~/.codex/config.toml (create it if needed; don't touch other servers):
[mcp_servers.gorila]
url = "https://app.gorila.la/api/mcp"
2. Add the section below to ~/.codex/AGENTS.md (create it if needed; if it already has a "## Gorila" section, replace it).
3. Tell me to run: codex mcp login gorila

## Gorila

your organization uses Gorila (MCP server "gorila") as its shared work memory: the team's tasks and company knowledge (brand tone, copy rules, SOPs, policies, decisions).

ALWAYS:
- Before writing anything for your organization (emails, customer replies, copy, ads, posts, docs) or running a recurring process, call get_relevant_knowledge with a short description of the situation, and follow what it returns.
- Facts about your organization itself (product, pricing, customers, policies) are in Gorila: call get_relevant_knowledge before searching the web or leaving a placeholder.
- When I correct your tone, a process or a fact that could apply again, call propose_knowledge_change. Nothing is published until a person approves it.
- When I mention work for someone else ("tell Ana to…", "this is for Esteban"), offer to create_task with full context (background, goal, done criteria, links) so their AI can do it.
- When I start working or ask what's next, call list_my_tasks.
- When you start working on a Gorila task, set it to doing with update_task; when it's finished (for code: its pull request merged), set it to done with a comment of what you did. Don't wait for me to ask.
- Put a Gorila task's id in the title or branch of its pull requests and comment_task the link; comment again when it's merged or closed.
- Store distilled, reusable text in Gorila, never raw documents, full emails or chat logs.
- If a person or a task is ambiguous, ask me. Never guess.
- When a task's end comes after this session (a reply, a merge, an approval), set what it's waiting for and when to look again (waiting_on, recheck_at), not only a comment.
```
