Connect an AI agent
last updated: October 16, 2026
// what it is
Clause runs its own MCP server, so an AI client you already use (Claude, ChatGPT, Claude Code, Cursor, and any other MCP client) can work on your LaTeX projects with you: read and edit the same live documents your collaborators see, compile them, and hand you the PDF. Once connected, the agent can:
- Read, create, rename, edit and delete files in the projects you can open — your own, those shared with you, and those in your groups
- Create projects, copy existing ones, and create a project inside a group you belong to, which every member of that group can then open
- Compile projects and fetch the PDFs
- See your groups and the names of the people in them, and create new groups
- Stay connected for up to 30 days after it was last used, unless you remove it from your AI client
It cannot invite or remove people, or delete projects or groups — that stays in the Clause app.
// connect
- Claude: add Clause from the connectors directory, or add a custom connector with the URL https://mcp.clause.studio/mcp.
- Claude Code: claude mcp add --transport http clause https://mcp.clause.studio/mcp, then /mcp to sign in.
- Other clients: open any project in Clause and choose "connect your agent"; it shows the exact steps for your client, including a paste-ready configuration.
Every connection goes through a Clause sign-in and a consent screen that lists what the agent will be able to do. Nothing is connected until you approve it.
// how it works
- The agent acts with your account, on the projects you can open: your own, those shared with you, and those in your groups. It reaches nothing else.
- Edits land in the live document. Collaborators see them as they happen, under your name marked "(via AI Agent)", and the agent sees their edits in turn.
- Compiling waits about fifteen seconds for the build; a longer build returns an id the agent checks with get_compile_status. The PDF arrives as a link that expires.
- In AI clients that support MCP Apps, the agent can open the Clause editor beside the chat. What you type there is yours, not the agent’s; the editor shares with the model only the project name, the open file, and the text you select.
- An image you attach in the chat can be added to a project as a file; the agent downloads it from the chat and uploads it to Clause.
- An agent you stop using disconnects by itself after 30 days; removing the connector in your AI client ends its access within an hour.
// the 24 tools
This list is generated from the server, so it is always the set a connected agent sees. A parameter marked with ? is optional.
list_groups
List groups · reads onlyList the Clause groups the user belongs to. A group is a shared workspace: every member can open and edit every project in it, with no per-project invite.
create_group
Create group · adds or changesCreate a Clause group owned by the user, who is its only member until they invite people in the Clause app. Use only when the user asked for a new group.
- name: string — The group name (1-60 characters).
list_group_members
List group members · reads onlyList a Clause group's members by name, and which one owns it.
- groupId: string — The group id (UUID), from list_groups.
list_projects
List projects · reads onlyList the Clause projects the user can open, each with the group it lives in, if any.
get_project
Get project · reads onlyGet one Clause project by id: its name, owner, number of direct members (group members are not counted), group, timestamps, and whether the user owns it, was added directly, or reaches it through a group.
- projectId: string — The project id (UUID).
create_project
Create project · adds or changesCreate a new Clause project owned by the user, with a starter main.tex. Refuses a name already used, ignoring case, by a project in the same place unless allowDuplicate is set. Returns the created project.
- name: string — The project name (1-100 characters).
- description?: string — Optional project description.
- groupId?: string — Create the project inside this group (id from list_groups). Every member of the group can read and edit it from the moment it exists, and no tool here takes it back out. Pass it only when the user asked for the project to live in that group.
- allowDuplicate?: boolean — Set true to create even when a project with the same name exists.
duplicate_project
Duplicate project · adds or changesCopy a Clause project the user can open into a new project they own: the whole file tree and contents, not its members or compiled PDFs. The copy is personal even when the source lives in a group, and no tool here moves it into one.
- projectId: string — The source project id (UUID).
- name?: string — Name for the copy; omit for a server-generated default.
list_files
List files · reads onlyList the files and folders of a Clause project, one per line: path, type (doc, asset or folder) and id, sorted by path.
- projectId: string — The project id (UUID).
read_file
Read file · reads onlyRead a document's current text in a Clause project, including collaborators' edits still in progress, as numbered lines: each line is its number, a tab, then the text; the numbers and tabs are not part of the document. Pass startLine and endLine for a window; a long document is cut at a line and says where to continue. For a non-text asset (an image, a PDF), returns a short-lived download URL instead of text. A folder id is refused.
- projectId: string — The project id (UUID).
- fileId: string — The file id (from list_files).
- startLine?: integer — First line to return (1-based).
- endLine?: integer — Last line to return (inclusive).
create_file
Create file or folder · adds or changesCreate an empty document or a folder in a Clause project and return it. A name already taken in that folder is suffixed, e.g. "name (2).tex". Images and other binary assets need their bytes, so they cannot be created here. For images use upload_image or prepare_image_upload.
- projectId: string — The project id (UUID).
- name: string — The file or folder name, e.g. "chapter2.tex".
- type: string — doc or folder.
- parentId?: string — Parent folder id; omit for the project root.
delete_file
Delete file or folder · can delete or overwriteDelete a file or folder from a Clause project, and everything inside a folder. Irreversible.
- projectId: string — The project id (UUID).
- fileId: string — The file or folder id (from list_files).
rename_file
Rename or move file · can delete or overwriteRename a file or folder in a Clause project, move it to another folder, or both; contents are untouched. A name already taken in the destination is suffixed.
- projectId: string — The project id (UUID).
- fileId: string — The file or folder id (from list_files).
- name?: string — New name, without path separators.
- parentId?: object — New parent folder id, or null for the project root.
upload_image
Upload image from attachment · adds or changesAdd an image the user attached in the chat to a Clause project, in hosts that hand the agent a file reference with a temporary download URL (ChatGPT does). Pass that reference, not a local path or an invented URL. Clause downloads and saves the bytes; the image appears live in connected editors, and a taken name is suffixed. In Claude and other hosts without such references, use prepare_image_upload then complete_image_upload instead.
- projectId: string — Project id (UUID).
- name: string — Destination file name with image extension, e.g. figure.png. PNG, JPEG, GIF, WebP, BMP and SVG; up to 25 MiB.
- parentId?: string — Folder id from list_files; omit for the project root.
- file: object
prepare_image_upload
Prepare image upload · adds or changesPrepare an upload of a local image to Clause. Returns a signed S3 PUT URL, required headers and uploadToken, valid for 15 minutes. You must have access to the file bytes and perform the HTTP PUT yourself, without a Clause bearer token; then call complete_image_upload. No file is added to the project until completion. Use upload_image for host-provided attachment references.
- projectId: string — Project id (UUID).
- name: string — Destination file name with image extension, e.g. figure.png. PNG, JPEG, GIF, WebP, BMP and SVG; up to 25 MiB.
- parentId?: string — Folder id from list_files; omit for the project root.
- sizeBytes: integer — Exact size of the local image in bytes, at most 25 MiB.
complete_image_upload
Complete image upload · adds or changesAfter PUTting an image to the URL from prepare_image_upload, validate it and add it to the project. Pass the original projectId and uploadToken. Returns the file id and final path (a taken name is suffixed). Safe to retry with the same unexpired token if the response was lost. The image appears live in connected editors.
- projectId: string — Project id (UUID).
- uploadToken: string — Opaque uploadToken returned by prepare_image_upload; do not modify it.
edit_file
Replace file content · can delete or overwriteReplace a document's whole text in a Clause project with the given content (not a diff). The new text appears live for connected editors; anything changed since your last read is overwritten, and anything the content leaves out is deleted, so a long document read in windows must be read in full first.
- projectId: string — The project id (UUID).
- fileId: string — The file id (from list_files).
- content: string — The whole new text of the document, without read_file's line numbers and tabs.
search_text
Search text in file · reads onlyFind literal (non-regex) occurrences of a string in a document and return their UTF-16 ranges {from, to} in the live text, usable as edit positions, with the line of each; the first 50 and the total. Pass occurrence (1-based) for just that match.
- projectId: string — The project id (UUID).
- fileId: string — The file id (from list_files).
- query: string — The literal text to find.
- occurrence?: integer — 1-based match to return; omit for the first 50.
insert_text
Insert text · adds or changesInsert text at a UTF-16 offset in a document; the change merges with concurrent edits and appears live. The offset is a hint: expectedBefore anchors the position, so a collaborator's edits elsewhere shift it instead of splitting a command.
- projectId: string — The project id (UUID).
- fileId: string — The file id (from list_files).
- at: integer — UTF-16 offset to insert at (a hint).
- text: string — The text to insert.
- expectedBefore: string — Roughly 40-80 characters of the exact text immediately BEFORE the insertion point, copied from your last read_file without its line numbers and tabs. Use "" only when inserting at the very start of the file.
- expectedAfter?: string — The exact text immediately AFTER the insertion point. Worth adding when the preceding text is boilerplate like \item or \hline and may not be unique.
replace_range
Replace text range · can delete or overwriteReplace the text in the UTF-16 range [from, to) of a document, up to 8,192 characters; the change merges with concurrent edits and appears live. Text a collaborator moved is found and replaced at its new position; the call fails when the text itself changed or became ambiguous.
- projectId: string — The project id (UUID).
- fileId: string — The file id (from list_files).
- from: integer — Start UTF-16 offset (a hint).
- to: integer — End UTF-16 offset (exclusive).
- text: string — The replacement text.
- expectedText: string — The exact text currently occupying [from, to), copied from your last read_file (without its line numbers and tabs) or search_text. Must be exactly to - from characters.
replace_text
Replace text · can delete or overwriteReplace one literal occurrence of a string in a document, the first unless occurrence says otherwise; fails when the text is not found. The change merges with concurrent edits and appears live.
- projectId: string — The project id (UUID).
- fileId: string — The file id (from list_files).
- query: string — The literal text to replace.
- replacement: string — The replacement text.
- occurrence?: integer — 1-based occurrence to replace; default 1.
compile_project
Compile project · adds or changesCompile a Clause project and wait up to about 15 seconds for the result: whether the LaTeX built, with its errors and warnings; a build still running after that returns its compilation id to poll. With wait false, only queues the build and returns its id.
- projectId: string — The project id (UUID).
- entryFile?: string — Entry .tex file (default 'main.tex').
- wait?: boolean — Wait for the build to finish and return its errors (default true). Pass false to only queue the compile and get a compilation id back.
get_compile_status
Get compile status · reads onlyGet the status and diagnostics of a compilation started earlier, by its id: the first 20 diagnostics, errors first. allDiagnostics lists every one Clause kept (up to 200); includeLog appends the tail of the raw LaTeX log, and diagnostics that would push it past the result size are left out and counted.
- projectId: string — The project id (UUID).
- compilationId: string — The compilation id returned by compile_project.
- allDiagnostics?: boolean — List every diagnostic instead of the first 20.
- includeLog?: boolean — Append the last 6,000 characters of the raw LaTeX log.
get_pdf
Get PDF link · reads onlyGet a short-lived download URL for a Clause project's latest successfully compiled PDF; none until a build has succeeded, or once the last success is older than 30 days.
- projectId: string — The project id (UUID).
open_editor
Open editor · reads onlyOpen the Clause editor for a project the user can access, so they can watch and edit it beside the chat. It opens on the compiled PDF, with the source one tab away; pass fileId to make that source the file you are about to change. The other tools keep working on the same live document. Clients that cannot show the editor still get the project id back.
- projectId: string — The project id (UUID).
- fileId?: string — Optional file id to show as the source behind the PDF — the file you are about to change. Omit to let the editor choose.
// troubleshooting
- The agent says it cannot reach Clause, or asks you to sign in again: remove the connector in your AI client and add it back. Sign-in and consent run again and the agent is connected afresh.
- "Still compiling": the build outlived the wait. Ask the agent to check the compilation it started; it gets the errors as soon as the build ends.
- A file came back cut short: long documents are read in windows. Ask the agent for the lines it needs, or to search the file for the text it is after.
- Anything else, including a security concern: write to admin@clause.studio. That address reaches the person who runs Clause.
// your data
What reaches your AI client, what Clause stores for a connection, and how to disconnect are set out in the Privacy Policy, in the section on connected AI agents.