# MCP Server Documentation - Relex

> Relex MCP Server — give your AI agent access to the entire Relex Legal AI API with just two tools (search and execute) in ~1,000 tokens.

[Home](/) / [Docs](/docs/a2a) / MCP Server

### Connectors

- [All agents](/docs/connectors)
- [Claude](/docs/connectors/claude)
- [GPT](/docs/connectors/gpt)
- [Grok](/docs/connectors/grok)
- [Gemini](/docs/connectors/gemini)

### MCP Server

- [Overview](/docs/mcp/)
- [Quickstart](/docs/mcp/quickstart/)

### A2A Protocol

- [Overview](/docs/a2a)

#### On this page

- [What the agent does — and what it never does](#clause-2)
- [Two tools](#clause-3)
- [Clause enforceability — agree with Relex before you rely on a clause](#clause-4)
- [The PII boundary](#clause-5)
- [Connect](#clause-6)
- [Claude quick path](#clause-7)
- [Typical loop](#clause-8)

# Relex MCP Server

The Relex MCP (Model Context Protocol) server lets a reasoning agent — Claude
(Claude Code or Claude desktop) or any MCP client — **work on your Relex cases**
through two tools and about **1,000 tokens** of context, **without ever seeing**
**your clients' personal data**.

## What the agent does — and what it never does

The agent is **reasoning, not operations**. Over the API it can:

- **Read** your cases, drafts, timeline, and structure — always de-identified
(it sees labels like `[Party 1]`, never real names or IDs).
- **Reason** about the matter and **draft** documents.
- **Record** its work back to the case (notes, drafts, structure).

The agent **cannot** add your know-how, create parties, upload documents, or
handle personal data. Those are done by **you, in Relex**, in your browser —
where personal data is extracted, encrypted with a password only you know, and
stored encrypted. When something needs to be added, the agent **points you to**
**the right place in Relex** instead of doing it itself.

## Two tools

The whole API is reachable through two tools, so the context footprint stays
fixed no matter how large the API is:

| Tool        | Arguments                       | Purpose                                                                                                                                                                                                               |
| ----------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **search**  | { query?, tag?, method? }       | Discover endpoints. Returns { method, path, summary, tags, params } — params shows each call's required/optional fields, enums and defaults, so the agent never guesses a field or asks you for one the API defaults. |
| **execute** | { method, path, query?, body? } | Call an endpoint. The server validates it, enforces the PII guard, runs it with your auth, and returns { status, body }.                                                                                              |

Both take **plain arguments** — there is no code to write. `path` is relative to
`/v1` (for example `/cases`, `/cases/{id}`), with no percent-encoding.

search({ query: "cases" }) execute({ method: "GET", path: "/onboarding/status" }) // Open a case — never set the tier or name yourself; Relex's eval agent decides // the tier from the matter. Create the case, then drive the eval agent: execute({ method: "POST", path: "/cases", body: {} }) execute({ method: "POST", path: "/agent", body: { type: "eval\_req", caseId: "", payload: { prompt: "" } } }) // The eval agent returns its question or the tier + offer; relay any question, // repeat until it returns the offer, then read the case back with GET /cases?caseId=.

## Clause enforceability — agree with Relex before you rely on a clause

When you review or draft a clause-bearing document, **check enforceability with**
**Relex** before treating any clause as sound. Relex's case agent grounds each
verdict in the jurisdiction's mandatory law; you bring your own read; together you
reach an explicit, question-driven agreement — and where you disagree, a human
lawyer decides.

search({ query: "enforceability" }) execute({ method: "POST", path: "/cases/{caseId}/draft/{draftId}/enforceability-advisory", body: { clauseText: "", clauseContext: "employment, governing law X", claudeVerdict: "unenforceable" } })

Relex returns its grounded `verdict` (enforceable / questionable / unenforceable /
void), the deciding `doctrine`, a compliant alternative, and the **open questions**
that must be answered first. When your verdict and Relex's **disagree** — or Relex's
not-enforceable verdict is **ungrounded** — the response is `status: "needs_human"`:
both verdicts are recorded as an internal comment, the clause is flagged, and **the**
**human professional is the tiebreaker**. Neither agent auto-resolves; the gate's job
is to _stop and ask_. A clause left flagged unenforceable/void blocks the draft from
being sent for signature until a human resolves or overrides it. Send only
de-identified clause text — the PII boundary below still applies.

## The PII boundary

Personal data — names, national IDs, contact details, and document content — is
**end-to-end encrypted** and only ever decrypted in your browser. The server
**refuses** any call that would move plaintext PII (reading or writing parties,
uploading or reading document content) and instead returns a **deep link** so you
do that step securely in Relex. The agent works with de-identified labels and
anonymized counts only.

## Connect

The agent signs in over **OAuth** — there is no key to paste. **One MCP URL**
powers every host:

```
https://relex.legal/api/mcp
```

| Agent           | Package                                                           | Guided install                              |
| --------------- | ----------------------------------------------------------------- | ------------------------------------------- |
| Claude          | [relexyou/relex-claude](https://github.com/relexyou/relex-claude) | [Claude connector](/docs/connectors/claude) |
| ChatGPT / Codex | [relexyou/relex-gpt](https://github.com/relexyou/relex-gpt)       | [GPT connector](/docs/connectors/gpt)       |
| Grok            | [relexyou/relex-grok](https://github.com/relexyou/relex-grok)     | [Grok connector](/docs/connectors/grok)     |
| Gemini          | [relexyou/relex-gemini](https://github.com/relexyou/relex-gemini) | [Gemini connector](/docs/connectors/gemini) |
| Any MCP client  | [relexyou/relex-mcp](https://github.com/relexyou/relex-mcp)       | [Generic MCP](/docs/connectors/mcp)         |

Full hub (personal vs Team for every product): **[AI Connectors](/docs/connectors)**.

### Claude quick path

1. Claude Code: `/plugin marketplace add relexyou/relex-claude` then
`/plugin install relex-legal@relex`.
2. On the first tool call, your browser opens to sign in to Relex (Google or
Apple) and approve.

In Claude desktop / claude.ai, add a custom connector with the URL above, then
click **Connect**. On **Pro / Max** you add it yourself under **Customize →**
**Connectors → Add custom connector**; on **Team / Enterprise** an owner or admin
adds it once in the **organisation's settings → Connectors**, and each member
connects it from **Customize → Connectors → available connectors**. The same
admin-installs / members-connect pattern applies to ChatGPT Team, Gemini
Enterprise, and similar managed plans. A static API key from **Settings → API**
**Keys** is supported as a CI/headless fallback.

See the [Quickstart](/docs/mcp/quickstart/) for the exact steps and the prompt to
paste.

## Typical loop

| You want to…                  | The agent…                                                                                                                                                                                        |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Start a matter                | execute POST /cases, then POST /agent eval\_req with the matter — Relex's eval agent sets the tier; on payment it deep-links you to billing. The agent never asks you the tier or quotes a price. |
| Bring in the people/documents | points you into Relex to add parties and upload documents (encrypted in your browser)                                                                                                             |
| Understand the matter         | reads the case, timeline, and drafts (de-identified) and reasons over them                                                                                                                        |
| Produce or fix a draft        | drafts/redlines in your style, grounded in your know-how, and records it via POST /cases/{id}/draft                                                                                               |
| Capture a firm position       | builds a non-confidential playbook (POST /playbooks) the redline path reuses                                                                                                                      |
| Export with real details      | points you to Relex, where the document is re-identified locally                                                                                                                                  |

---

_[View this page on relex.legal](https://relex.legal/docs/mcp)_
