# The MCP server

> Using emo mcp from an editor or coding agent that supports MCP: configuration, tool names, signing in with your Emolysis account and errors.

`emo mcp` runs the Emolysis engine as a Model Context Protocol (MCP) server, so an editor or coding agent that supports MCP can use Emolysis with one configuration entry.

## How it works

The server speaks MCP over standard input and output. Your editor or coding agent starts it as a local process; nothing listens on a network port. Each engine command, except the machine-token commands, is one MCP tool, and the tool's input schema is the command's parameter schema. That is why the tools are the same as the commands in the app and in [The emo CLI](https://emolysis.com/docs/cli).

## Tool names

A tool is named after its command id with the dot replaced by an underscore, because some MCP clients accept only letters, digits, underscores and hyphens in tool names. `query.run` becomes `query_run`, and `template.render` becomes `template_render`. Calls also accept the dotted id.

| Command id        | MCP tool name     |
| ----------------- | ----------------- |
| `query.run`       | `query_run`       |
| `dialect.lint`    | `dialect_lint`    |
| `template.list`   | `template_list`   |
| `template.render` | `template_render` |
| `template.test`   | `template_test`   |

## Adding it to your tool

Most MCP clients take a configuration entry like this one. The exact file and format depend on the client; check its documentation.

```json
{
  "mcpServers": {
    "emolysis": { "command": "emo", "args": ["mcp"] }
  }
}
```

Setup buttons on the web dashboard that write this entry for common editors and coding agents are planned. The public repository [emolysis/integrations](https://github.com/emolysis/integrations) holds the ready-made configs and skills. See [Editors and coding agents](https://emolysis.com/docs/editors).

## Signing in first

Like every use of Emolysis, the server needs an Emolysis account; the Free plan is one. Sign in once in the app or with `emo login` in a terminal, and the server uses that sign-in. On local files, CSV and Parquet, it works on DuckDB alone, with no platform connected. Signed in, you can read files, run SQL, render templates and run golden tests on local data; connecting a platform adds that platform's own sign-in.

## Signing in from your editor

When you are not signed in, or your sign-in has expired, a tool returns a short code and a link instead of a result. Confirm the code in the browser, sign in with your GitHub, Microsoft or Google account, and retry the tool call. The code expires after 15 minutes.

## Errors

A failed tool call returns an MCP error result that carries the same typed error as every other surface, with one of nine error codes, so your coding agent can tell a missing parameter from a platform failure. See [Error codes](https://emolysis.com/docs/error-codes) and [Troubleshooting](https://emolysis.com/docs/troubleshooting).

## Skills

The integrations include skills for common requests: a dashboard from a question, a pipeline for a shape, connecting a platform, migrating a table (planned) and explaining a pipeline. They call the same tools; they only save you from writing the request out in full.

## What the model sees

Your coding agent sends the tool results to its own model provider, under its own terms. Tool results can include schemas, query results and sample values. Point the agent at tables you are comfortable sharing that way. This is separate from your own model key, or a paid plan's model usage, that Emolysis's own agent uses; see [Model keys and credits](https://emolysis.com/docs/model-keys-and-credits) and [Data handling](https://emolysis.com/docs/data-handling).

## Troubleshooting

If your editor does not show the Emolysis tools, check that `emo` is on your path, that the entry runs `emo mcp`, and restart the client. `emo doctor` checks the engine itself.

---

Page: https://emolysis.com/docs/mcp-server. Emolysis is a product of Bandpey GmbH, Munich, Germany. It is in private development, and nothing is released yet.
