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

# MCP server and /ask on your domain

> Dedica serves an MCP server at /mcp on your domain with your approved agent tools, and an /ask endpoint that answers questions from your agent pages.

While your site is in [autopilot](https://docs.getdedica.com/guides/serving-modes.md), Dedica serves two endpoints for agents on your own domain: an MCP server at `/mcp` with the agent tools you approved, and `/ask`, which answers questions from your agent pages. The middleware proxies both to Dedica.

To try both before your middleware is connected, use the [preview](https://docs.getdedica.com/serving/preview.md).

## MCP server

Agents connect to `https://<your domain>/mcp`. It is a stateless Streamable HTTP MCP server that answers with JSON.

Its tools are the agent tools you approved and haven't disabled. There are two kinds:

| Kind | What a call does |
| - | - |
| HTTP tool | Sends one request to your site's own API with the agent's arguments and returns your API's answer. |
| Link tool | Fills in a URL on your domain (a checkout link, for example) and returns it. No request is made. |

Each tool tells agents whether it is read-only, and HTTP `DELETE` tools are marked destructive.

### What calls can reach

* Calls are **anonymous**. No agent or user credentials are sent, so only public endpoints work. Forms protected by a CSRF token usually fail.
* Calls are plain requests, not a browser. If your bot protection challenges them (a Cloudflare "Just a moment..." page, for example), every call fails. Allow the user agent `DedicaAgentGateway/0.1 (+https://getdedica.com/bot)`.
* Calls only go to your own domain, never to private network addresses.
* Each call has a 20-second timeout, and long responses are cut at 256 KB.
* The middleware limits each visitor to 30 requests a minute.

> [!WARNING]
>
> `/mcp` passes through to your site until you approve your first tool. After that, Dedica's `/mcp` replaces any `/mcp` your site already had.

To stop serving one tool, disable it. You can't rename a tool once it is approved, because agents depend on its name.

## /ask

`/ask` answers a question in a few sentences, using only your agent pages, and lists its sources.

```bash theme={null}
curl "https://example.com/ask?q=How+much+does+the+pro+plan+cost"
```

```json theme={null}
{
  "question": "How much does the pro plan cost",
  "answer": "...",
  "found": true,
  "sources": ["https://example.com/pricing.md"]
}
```

When no page matches, the answer points the agent at `llms.txt`.

`POST /ask` speaks [NLWeb](https://github.com/nlweb-ai/NLWeb) v0.55. Send `{"query": {"text": "..."}}`, and add `"prefer": {"streaming": true}` or `Accept: text/event-stream` for server-sent events.

`/ask` is available once at least one agent page is served.

## How agents find them

`llms.txt` gets "Agent tools" and "Ask" sections, and Dedica serves an MCP server card and `/.well-known/mcp.json`. See [Discovery files](https://docs.getdedica.com/serving/discovery-files.md).


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