> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/ai/mcp/servers.md).

# MCP servers

Commerce Layer provides purpose-built MCP servers for the Core API, Metrics API, and developer documentation. They give AI agents structured access to live commerce data, analytics, and docs through a consistent tool-based interface.

## Model Context Protocol

The **Model Context Protocol (MCP)** is an [open standard](https://modelcontextprotocol.io/) that defines how AI models discover and invoke external tools. It is supported by **Claude**, **ChatGPT**, **Cursor**, and a growing list of AI clients and IDEs, according to a simple yet powerful workflow:

1. The MCP server exposes a set of typed tools.
2. The AI client calls those tools to interact with your systems, keeping context across a session.

Commerce Layer's MCP servers go beyond thin API wrappers — they embed schema metadata, preflight validation, and documentation retrieval directly into the agent's tool loop, so every call is grounded in how the platform actually works, not in whatever the model remembered from training.

### Available MCP servers

At the moment you can leverage three MCP servers, each targeting a different layer of the platform.

* The [Core MCP](/ai/mcp/servers/core.md) is the primary integration for agents that need to read and write commerce data.
* The [Metrics MCP](/ai/mcp/servers/metrics.md) focuses on analytics and reporting.
* The [Documentation MCP](/ai/mcp/servers/docs.md) provides real-time access to the full developer docs and is a good starting point for coding assistants and IDE integrations.

<table><thead><tr><th width="213.08203125">Server</th><th width="171.15625">API</th><th>Best for</th></tr></thead><tbody><tr><td><strong>Core MCP</strong></td><td><a href="/spaces/-LgByaSP8eKjad-MIuHE">Core API</a></td><td>Operational queries, schema discovery, docs-aware writes, and agent-driven order workflows.</td></tr><tr><td><strong>Metrics MCP</strong></td><td><a href="/spaces/ASSiAvbL4nFnkl8plQy2">Metrics API</a></td><td>Order, cart, and returns analytics in natural language.</td></tr><tr><td><strong>Documentation MCP</strong></td><td><a href="/spaces/XD42JVYENWrharWaLF3W">Developer docs</a></td><td>Real-time documentation access for AI assistants and coding tools.</td></tr></tbody></table>

{% hint style="success" icon="book" %}
Each server is documented in the following pages. To test and debug connections without configuring an AI client first, use the [MCP inspector](/ai/mcp/inspector.md). Before using them, read the [security guidelines](/ai/mcp/security.md) for best practices and optimal methods.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/ai/mcp/servers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
