> ## Documentation Index
> Fetch the complete documentation index at: https://ai.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Remote MCP to your API

> Two lines of code and your customers' harness can ask about their data on your API.

This is what you offer **your customers**. They stay in their assistant — Claude Desktop, Cursor, Claude Code, and the rest — and ask about *their* data on *your* API.

* Tell me about customer ALFKI.
* When was the last order on that account?
* Find customers who have not created a new project in 45 days.

Your OData API does not change. MCP is a sibling at `{yourRoute}/mcp`. Customers point their harness at that URL.

## Add it

```bash theme={null}
dotnet add package Microsoft.OData.Mcp.AspNetCore
```

```csharp theme={null}
builder.Services
    .AddControllers()
    .AddOData(options => options.AddRouteComponents("odata", GetEdmModel()));

builder.Services.AddODataMcp();

var app = builder.Build();
app.MapControllers();
app.UseODataMcp();
```

Customers point the harness at `https://your-host/odata/mcp`. OData at `/odata` is unchanged.

**OData 8**

`AddRouteComponents` + `MapControllers`, then `UseODataMcp`.

**Restier**

```csharp theme={null}
builder.Services.AddODataMcp();

var app = builder.Build();
app.MapRestier(routes => routes.MapApiRoute<MyApi>("odata", "odata"));
app.UseODataMcp();
```

No extra Restier package. Attributes such as `[McpTask]` come from `Microsoft.OData.Mcp.Core`.

**Several APIs**

Each OData prefix gets its own MCP endpoint: `/odata/mcp`, `/reporting/mcp`, `/api/v1/mcp`. Hide one with [advanced setup](https://ai.easyaf.dev/odata-mcp/guides/remote/advanced.md).

Call `UseODataMcp` **after** your OData routes exist. That is the whole on switch.

## What the harness gets

Named tools from your model: `list_customers`, `get_customer`, `create_order`, `action_order_ship`. Generic `odata_*` tools cover everything else. Type cards are compact, so the model spends tokens on the question instead of your `$metadata`.

Answers come back as the same JSON your API already returns. A bad create or a missing key fails with a readable message before it ever hits your controllers.

Give the assistant a one-line preface about your product in [advanced setup](https://ai.easyaf.dev/odata-mcp/guides/remote/advanced.md). If an action opens a browser for the operator, see [Tasks](https://ai.easyaf.dev/odata-mcp/guides/remote/tasks.md) and [Elicitations](https://ai.easyaf.dev/odata-mcp/guides/remote/elicitations.md). Lock `/mcp` the same way you lock the API in [authentication](https://ai.easyaf.dev/odata-mcp/guides/remote/authentication.md).


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