> ## 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.

> [!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.

![](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` |

### Tools

| Group | Tools |
| - | - |
| Project | `get_clone_info`, `get_settings`, `update_settings`, `list_versions` |
| Files | `list_files`, `read_file`, `edit_file`, `write_file`, `delete_file` |
| Compile | `compile`, `get_compile_log`, `get_output_file_link`, `word_count` |
| Comments | `list_comments`, `reply_to_comment`, `resolve_comment`, `reopen_comment` |

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

### 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.
* Reviewers can also reply to comments, and resolve or reopen the comments they started.
* Viewers who joined with a link cannot see the comments, as in the editor.

### 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.


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