> For the complete documentation index, see [llms.txt](https://docs.graph.build/EGeX4aTAJLlpg9Hh8kfl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graph.build/EGeX4aTAJLlpg9Hh8kfl/graph.build-studio/mcp-server.md).

# MCP Server

Graph.Build Studio includes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server so AI assistants can explore the ontologies published on your instance, read the projects you can open, and edit ontology designs.

The MCP server runs on the **Studio Node** process (the backend), not the Studio UI. If the UI is at `http://localhost:9600`, the MCP endpoint is:

```
http://localhost:9601/mcp
```

Replace the host and port with the URL of your Studio Node.

### What it does

The MCP server is an ontology assistant. It lets an AI client:

* List ontologies available in Studio
* Search classes and properties by keyword
* Browse class and property hierarchies
* Read the Turtle source of an ontology, or a Concise Bounded Description (CBD) for a class or property
* Follow guided prompts to explore an ontology, explain a class, or suggest a mapping for a source field name
* Read your Studio projects: list their models, uploaded files and SQL connections, preview a file, inspect SQL tables, run a read-only query, and read an ontology design
* Edit an ontology design, or create one in a project, in the same formats as the AI Assistant

Project tools see only what the token's user can open in Studio, and change only what that user can change. A model that is open for editing in Studio cannot be changed over MCP.

It does **not** change SQL or semi-structured mapping designs, run Transformers, or write data to a graph database.

See [Editing designs](/EGeX4aTAJLlpg9Hh8kfl/graph.build-studio/mcp-server/editing-designs.md) for how to change a model from an assistant, and [Tools, resources, and prompts](/EGeX4aTAJLlpg9Hh8kfl/graph.build-studio/mcp-server/tools-resources-and-prompts.md) for the full catalogue.

### Connecting an AI assistant

You will need:

* A running Graph.Build Studio Node
* The Studio Node URL (not the UI URL)
* An MCP-capable client, such as Cursor or Claude
* A Graph.Build API token (`gb_`) for an **Admin** or **Super Admin** user

Generate the token in Studio **Admin Panel** (key icon on the user). It is shown once. The same token is used for `/api`.

{% hint style="info" %}
Every request to `/mcp` must include `Authorization: Bearer gb_<your-token>`. A missing or invalid token returns HTTP 401 before the MCP session starts.
{% endhint %}

{% tabs %}
{% tab title="Cursor" %}
Add a Streamable HTTP MCP server that points at your Studio Node. In Cursor MCP settings, or in `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "graphbuild": {
      "url": "http://localhost:9601/mcp",
      "headers": {
        "Authorization": "Bearer gb_<your-token>"
      }
    }
  }
}
```

Use your Studio Node host instead of `localhost` if the Node is not running on your machine. Restart Cursor or reload MCP servers, then confirm **graphbuild** is connected.
{% endtab %}

{% tab title="Claude Code" %}
Add the server with HTTP transport and the API token header:

```
claude mcp add --transport http graphbuild http://localhost:9601/mcp --header "Authorization: Bearer gb_<your-token>"
```

Use your Studio Node URL if it is not on localhost.
{% endtab %}
{% endtabs %}

The client starts a session against `/mcp`. After that, it can list tools, read resources, and call them on your behalf.

### Using it

Once connected, ask the assistant things like:

* What ontologies are available?
* Explore the schema.org ontology
* Which property in this ontology should `customer_name` map to?
* Explain the class `https://schema.org/Person`
* Add a `Product` class to the Shop model in my Retail project
* Create an Orders ontology in my Retail project from the uploaded orders file

The assistant will call the MCP tools. Edits are saved on the Studio Node, so they are there the next time you open the model. If your client supports MCP prompts, you can also run:

* `explore-ontology` — walk an ontology from the top down
* `map-source-to-ontology` — suggest a class or property for a source field name
* `explain-class` — explain one class, including its hierarchy

When a tool asks for `ontology_id`, use the ontology URI, for example `https://schema.org/`.

For the HTTP methods on `/mcp` and how to create an API token, see [Studio API Endpoints](/EGeX4aTAJLlpg9Hh8kfl/graph.build-studio/studio-api-endpoints.md).
