# For AI agents

> Evictions API has an MCP server, so an AI agent can read about the service and work with eviction cases for the person it is helping.

Source: https://evictionsapi.com/docs/agents

After you submit a case, we engage a licensed attorney in the property’s state for it and confirm by email. Nothing is served on a tenant or filed in court until that attorney has reviewed the case. Evictions API is operated by Future Cities LLC. It is not a law firm and does not give legal advice.

## The MCP server

The server speaks the Model Context Protocol over Streamable HTTP at https://evictionsapi.com/mcp. The tools that describe the service need no key. The tools that work with cases need the person’s API key, sent by the client as `Authorization: Bearer eak_...`. A test key is free: https://evictionsapi.com/signup?next=/app/get-started

## Set up a client

### Claude

1. On the web or in the desktop app, open Customize, then Connectors. On a Team or Enterprise plan an owner adds the connector under Organization settings, then Connectors.
2. Choose Add custom connector, give it a name and paste the server URL: https://evictionsapi.com/mcp
3. The tools that need no key work with no sign-in. For the tools that work with cases, add your key in the connector’s authentication settings as a request header, `Authorization` with the value `Bearer eak_test_...`.

### Claude Code

1. Run this in a terminal. Leave the `--header` line out to use only the tools that need no key.
2. Check the connection with `claude mcp list`, or `/mcp` inside Claude Code.

```sh
claude mcp add --transport http evictions-api https://evictionsapi.com/mcp \
  --header "Authorization: Bearer eak_test_..."
```

### ChatGPT

1. In ChatGPT’s settings, open the connectors section, then its advanced settings, and turn on Developer mode. It is offered on paid plans.
2. Create a connector: give it a name, paste https://evictionsapi.com/mcp as the MCP server URL and choose no authentication.
3. ChatGPT connects to a server with OAuth or with no authentication, and this server takes an API key, so in ChatGPT the tools that need no key are the ones that work.

### Cursor

1. Put this in `.cursor/mcp.json` in a project, or in `~/.cursor/mcp.json` for every project. Leave `headers` out to use only the tools that need no key.
2. Keep a real key out of a file you commit.

```json
{
  "mcpServers": {
    "evictions-api": {
      "url": "https://evictionsapi.com/mcp",
      "headers": {
        "Authorization": "Bearer eak_test_..."
      }
    }
  }
}
```

### VS Code

1. Put this in `.vscode/mcp.json` in a workspace. VS Code asks for the key the first time the server starts and stores it; the key is not written into the file.
2. Leave `headers` and `inputs` out to use only the tools that need no key.

```json
{
  "servers": {
    "evictions-api": {
      "type": "http",
      "url": "https://evictionsapi.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:evictions-api-key}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "evictions-api-key",
      "description": "Evictions API key (eak_test_...)",
      "password": true
    }
  ]
}
```

## Tools

| Tool | What it does | API key |
| --- | --- | --- |
| `get_service_overview` | What Evictions API is, what is available today, how a real case is handled, and who operates it. No key needed. | Not needed |
| `get_pricing` | The platform fee, the costs that are separate from it, and the refund rule, in the site’s own words. No key needed. | Not needed |
| `list_states` | The 50 states and DC, each with its two-letter code, its slug and its page on the site. No key needed. | Not needed |
| `get_state_eviction_facts` | The verified, sourced facts published for one state, such as the notice for nonpayment of rent and the court, each with its source link and the date it was checked. General information, not legal advice. No key needed. | Not needed |
| `get_started` | How a person or an agent gets an API key: the sign-up link, what test and live keys are, and where the docs are. No key needed. | Not needed |
| `resolve_jurisdiction` | Whether a jurisdiction is served, and its notice rules, from the property’s state and, when known, its county and city. Needs an API key. | Needed |
| `create_case` | Creates a draft case from the facts the person gives: the ground, where the case starts, the property, the parties and the person’s attestations. Nothing is submitted. Documents are uploaded through the REST API or the site, not this server. Pass an `idempotencyKey` and reuse it if you repeat the call, so a retry never makes a second case. The result is the case, with `state` and `nextAction` (who it is waiting on and for what). Needs an API key. | Needed |
| `update_case` | Changes the facts of a draft case. Send only the fields to change; each one replaces the stored value. The result is the case, with `state` and `nextAction` (who it is waiting on and for what). Needs an API key. | Needed |
| `get_case` | One case by its id. The result is the case, with `state` and `nextAction` (who it is waiting on and for what). Needs an API key. | Needed |
| `list_cases` | The cases of the key’s organization and mode, newest first, a page at a time. Needs an API key. | Needed |
| `validate_case` | Runs the submission checks on a draft and says what is missing. Changes nothing. Needs an API key. | Needed |
| `submit_case` | Submits a draft that passes every check. A live case moves to `submitted`, its platform fee becomes a due charge, and a licensed attorney in the property’s state is engaged for it; nothing is served or filed until that attorney has reviewed it. With a live key this acts on a real case. Confirm with the person first, then pass `confirmedByPerson: true`. The case’s attestations must be the person’s own statements; never fill them in yourself. Needs an API key. | Needed |
| `get_case_events` | What has happened on a case, oldest first. Needs an API key. | Needed |
| `list_case_charges` | The charges on a case, oldest first, and whether online payment is available. Needs an API key. | Needed |
| `get_payment_link` | Opens a hosted checkout for one due charge and returns its URL. Give the URL to the person: paying is theirs to do, and no tool takes card details. Needs an API key. | Needed |
| `list_case_messages` | The messages on a case, the person’s own and ours, oldest first. Needs an API key. | Needed |
| `send_case_message` | Sends us a message about a live case, in the person’s name. Send only what the person asked to say. Needs an API key. | Needed |
| `withdraw_case` | Withdraws a case. A live case with an attorney already engaged goes on hold instead and is withdrawn once the attorney has confirmed that all work has stopped. With a live key this acts on a real case. Confirm with the person first, then pass `confirmedByPerson: true`. Needs an API key. | Needed |

## Acting for a person

An agent with a key acts for the person the key belongs to. A live key can be created only by an owner of the organization, signed in on the site, and giving it to an agent is that person’s authorization for the agent to act on real cases. A test key acts only on fictional test cases.

- Confirm with the person before calling `submit_case` or `withdraw_case` with a live key: both act on a real case.
- A case’s attestations are the person’s own statements. An agent passes on what the person has confirmed and never fills them in itself.
- Paying is the person’s to do. `get_payment_link` returns the address of a hosted checkout for the person to open; no tool takes card details.
- Documents are uploaded through the REST API or the site, not through this server.

After you submit a case, we engage a licensed attorney in the property’s state for it and confirm by email. Nothing is served on a tenant or filed in court until that attorney has reviewed the case.

## The REST API instead

- Quickstart: https://evictionsapi.com/docs.md
- API reference: https://evictionsapi.com/docs/api.md
- OpenAPI document: https://evictionsapi.com/openapi.json
- A short description of the site for a model: https://evictionsapi.com/llms.txt
