# Model Context Protocol

Integrations connect your **app** to a service. **MCP** connects the **agent** to one instead. The Model Context Protocol is an open standard for giving an AI agent extra tools and data to work with as it builds your app.

## What MCP Adds

An MCP server exposes a set of **tools** and, sometimes, **data** the agent can use while it builds your app. Where an OAuth connection lets the finished app act with a service, MCP works one level up: it expands what the agent can do while it's working on your behalf.

That's useful when you want the agent to:

- **Read live documentation or references** for a library or API as it writes code.
- **Query a system or database** to inform what it builds.
- **Reach a specialized capability** that a particular MCP server provides.

> [!NOTE]
> MCP servers are scoped to a single project. They give the agent extra tools for that project and don't affect your other apps.

## Adding an MCP Server

1. **Open the MCP Servers dialog**: From **My Project**, open the ** More…** menu and click ** MCP Servers**. Alternatively, right-click the project or click **the ellipsis** in the Agent Chat to find this option.
2. **Add your server**: Add an entry under `mcpServers`, keyed by a server name, with the details that server needs.
3. **Save**: Click **Save** to write the file.
4. **Use it in a prompt**: With the server added, the agent can call its tools while it works on your project. Describe what you want, and the agent reaches for the new tools when they help.

### Configuring a Server

Each entry under `mcpServers` defines how its server is reached. Its **type** must be `stdio`, `sse`, or `http`:

- **A server name** as the key, so you can recognize it in the config.
- **A `stdio` server** is local: it declares a `command` to run, with optional `args`, `env`, and `cwd`.
- **An `sse` or `http` server** is remote: it declares a `url` (http or https) and may include `headers`, such as an authorization token.

Check the server's own documentation for the exact values it expects. The configuration is stored with the project in `.mcp.json`, so it stays with the app rather than needing set up again each time.

## Using It in a Prompt

The agent calls a tool when your prompt makes it the obvious way to get something done. To make that more likely:

- **Name the source in your prompt**: "Use the records from my database MCP server to seed the list" is clearer than hoping the agent reaches for it.
- **Describe the goal, not the mechanics**: Say what you want built; let the agent decide which tool fits.
- **Check the result**: If the agent didn't use a connected tool, say so and point it at the server explicitly.

## MCP vs OAuth

MCP and an OAuth integration solve different problems, and an app can use both. An **OAuth integration** connects your finished app to a service so the running app can act as you, reading and writing that service's data on your behalf. **MCP** works one level up: it connects the **agent** to extra tools and data while it builds, expanding what the agent itself can do as it writes your app. In short, OAuth extends your app's reach; MCP extends the agent's.
