> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Connect AI clients such as Claude Code or Codex to a project through its MCP server.

Each project has an MCP server, so AI clients such as Claude Code, Codex, Cursor, VS Code or Gemini CLI can work on it: read and edit its files, compile it, read the LaTeX log, download the PDF and answer comments. From v6.3.3 they can also look through the history and restore versions, review tracked changes, add comments, use the project chat and move files.

> [!NOTE]
>
> This feature is developed by [ayaka-notes/ayakaleaf-pro](https://github.com/ayaka-notes/ayakaleaf-pro). It is introduced from v6.3.1 and later. The tools for history, tracked changes, project chat, new comments and moving files are introduced from v6.3.3 and later, see [New in v6.3.3](https://ayakaleaf-pro.mintlify.site/on-premises/user-guide/users/mcp-server.md#new-in-v6.3.3).

![](https://mintcdn.com/ayakaleaf-pro/75JEUzv4DcYJF7Z-/images/on-premises/8b4eca630b3083da54177b4e7a431571.png?fit=max\&auto=format\&n=75JEUzv4DcYJF7Z-\&q=85\&s=73546d80edf492bf43df53303023ca29)

![](https://mintcdn.com/ayakaleaf-pro/z0f8sws6lnhMSWO4/images/on-premises/img-c48f4f64.png?fit=max\&auto=format\&n=z0f8sws6lnhMSWO4\&q=85\&s=b6f33a465bae9952ce7be3bcb15c57c5)

### Setup

The MCP server comes with the Git integration: enable [git-bridge](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/overleaf-toolkit/integrations/git-integration.md), and the MCP server is available too. There is nothing else to configure.

### Connect an AI client

1. In **Account Settings**, generate a Git authentication token. The same token is used for the MCP server and for Git.
2. In the editor, open **Integrations** and click **MCP server**. It shows the address of the project's MCP server, `https://<your-overleaf>/project/<project_id>/mcp`, and how to add it to each AI client: copy the command, and replace `<token>` with your token.

The token is sent as the HTTP header `Authorization: Bearer <token>`. For example, the command for Claude Code is:

```bash theme={null}
claude mcp add --transport http overleaf \
  https://<your-overleaf>/project/<project_id>/mcp \
  --header "Authorization: Bearer <token>"
```

### Usage

Once connected, ask the AI client in plain words. For example:

| You ask | The AI client uses |
| - | - |
| *Fix the typos in the introduction.* | `read_file`, `edit_file`: the edits show live in the editor |
| *Compile the project and fix the LaTeX errors.* | `compile`, `get_compile_log`, `edit_file` |
| *Answer the open comments, then resolve them.* | `list_comments`, `reply_to_comment`, `resolve_comment` |
| *Switch to XeLaTeX and download the PDF.* | `update_settings`, `compile`, `get_output_file_link` |
| *Rewrite the abstract as a tracked change.* | `read_file`, `edit_file` with `trackChanges` (v6.3.3) |
| *What changed since the submitted version?* | `list_versions`, `list_changes`, `diff` (v6.3.3) |
| *Move the chapters into a folder called chapters.* | `move_file` (v6.3.3) |

### Tools

| Group | Tools |
| - | - |
| Project | `get_clone_info`, `get_settings`, `update_settings` |
| Files | `list_files`, `read_file`, `edit_file`, `write_file`, `delete_file`, `move_file`, `create_folder` |
| Compile | `compile`, `get_compile_log`, `get_output_file_link`, `word_count` |
| Comments | `list_comments`, `reply_to_comment`, `resolve_comment`, `reopen_comment`, `add_comment`, `edit_comment_message`, `delete_comment_message` |
| Tracked changes | `list_tracked_changes`, `accept_tracked_changes`, `reject_tracked_changes` |
| History | `list_versions`, `list_changes`, `diff`, `create_version`, `delete_version`, `restore_file`, `restore_project` |
| Chat | `list_chat_messages`, `send_chat_message` |

v6.3.3 has 33 tools, or 31 with `OVERLEAF_DISABLE_CHAT=true`, which removes the chat tools. v6.3.1 and v6.3.2 have the other 17: everything above except `move_file`, `create_folder`, `add_comment`, `edit_comment_message`, `delete_comment_message`, the tracked changes tools, the chat tools, and the history tools other than `list_versions`. In v6.3.3, `read_file` also reads a file at a version of the history, `edit_file` and `write_file` take `trackChanges`, and `update_settings` also sets the spell check language.

Edits made with `edit_file`, `write_file` and `move_file` show live in the editor and merge with those of collaborators. For many files at once or binary files, the AI client can also clone the project with Git and push.

With `trackChanges`, an edit of an existing file is a tracked change of the token's user, even when track changes is off in the project; a new file never is. Without it, edits follow the track changes setting of the project.

### Permissions

The MCP server follows the project's sharing settings, like Git:

* Everyone who can view the project can read it, compile it and download its output.
* Only the owner and editors can change its files and settings, restore versions, and accept or reject tracked changes.
* Reviewers can also add comments and reply to them, resolve, reopen or delete the comments they started, and save versions. They cannot edit files, not even as tracked changes.
* Everyone edits only their own comment messages, and reviewers delete only their own.
* Only the owner deletes versions that others saved.
* Viewers who joined with a link cannot see the comments, tracked changes, history or chat, as in the editor. Invited viewers can see them and use the chat.
* If the project owner does not have **Full project history**, the history tools show only the changes of the last 24 hours, as the history panel does. Admins see all of them.

The user guide has a table of what each role may do, see [Who may do what](https://ayakaleaf-pro.mintlify.site/on-premises/user-guide/users/mcp-server.md#who-may-do-what).

### Q\&A

> [accordion] I don't see Integrations or MCP server in the editor
>
> **Answer:** The MCP server has no environment variable of its own. It is enabled with `GIT_BRIDGE_ENABLED=true` in `config/overleaf.rc`, see [Git integration](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/overleaf-toolkit/integrations/git-integration.md). After changing it, run `bin/up -d`. Without the git-bridge, the editor does not show the **Integrations** tab in its left rail.

> [accordion] The AI client says "Track changes is off for this project"
>
> **Answer:** The client asked for a tracked change, but the project owner's account does not have track changes. Click **Admin**, then **Manage Users**, open the owner, and on the **Features** tab switch on **Track changes**, see [Features](https://ayakaleaf-pro.mintlify.site/on-premises/user-guide/administrators/user-management.md#features). Edits without `trackChanges` still work.

> [accordion] The AI client sees only the changes of the last 24 hours
>
> **Answer:** The project owner's account does not have full project history, so the history tools show what the history panel shows: the changes of the last 24 hours. Click **Admin**, then **Manage Users**, open the owner, and on the **Features** tab switch on **Full project history**, see [Features](https://ayakaleaf-pro.mintlify.site/on-premises/user-guide/administrators/user-management.md#features).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.