---
name: encore-mcp
description: Connect an AI coding tool to Encore's MCP servers. The local server (`encore mcp`) gives the agent the app on this machine. The Encore Cloud server (`https://api.encore.dev/mcp`) gives it deployed environments. Covers Claude Code, Cursor, VS Code, and other MCP hosts, with OAuth or an API key for Encore Cloud.
when_to_use: >-
  User wants to add, install, connect, or set up Encore's MCP server, give the agent access to the app's services, traces, or databases, or connect the agent to Encore Cloud to read deploys, build logs, production traces, metrics, or infrastructure. Also use when an Encore MCP server doesn't show up, doesn't connect, needs authentication, or lists no tools. Trigger phrases: "Encore MCP", "encore mcp", "local MCP", "Cloud MCP", "api.encore.dev/mcp", "encore-local", "encore-cloud", "connect Claude Code to Encore", "connect Cursor to Encore", "MCP server", "production traces from the agent", "Encore API key".
title: encore-mcp
canonical_url: https://skilld.dev/gh/encoredev/skills/mcp
last_updated: 2026-10-27T15:20:19.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install encoredev/skills/mcp`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/mcp`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/encoredev/skills/mcp) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/mcp`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/mcp --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/mcp --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Connecting Encore's MCP Servers

## Instructions

### Pick the servers

| Server | Gives the agent | Needs |
|--------|-----------------|-------|
| Local (`encore-local`) | The app on this machine: services and endpoints, calling endpoints, local traces, database schemas and queries, Pub/Sub, buckets, caches, cron jobs, and Encore docs | The Encore CLI (`encore-install`) and an Encore app |
| Encore Cloud (`encore-cloud`) | Deployed apps: environments, deploys and build logs, traces, metrics, database schemas and queries, infrastructure, secrets metadata, and the deployed source | An Encore Cloud account, and a person to approve access, or an API key |

Most agents benefit from both: local while building, Encore Cloud for deploys and production. Set up the ones the user asked for. If they didn't say, ask.

Most tools load MCP servers when they start. After adding one, ask the user to restart or reload their tool, then check that it's connected.

### Local server

1. From the app's root directory, get the app's ID:

   ```bash
   encore mcp start
   ```

   It prints `MCP stdio Command: encore mcp run --app=<app-id>` and an SSE URL. Use this ID, not the `id` in `encore.app`: apps that aren't on Encore Cloud have an empty `id` there and a local ID here.

2. Add the server to the user's tool:

   - **Claude Code:** run from the app's root directory:

     ```bash
     claude mcp add --transport stdio encore-local -- encore mcp run --app=<app-id>
     ```

     This adds it for this project, for this user. Add `--scope project` to share it with the team through `.mcp.json`.
   - **Cursor:** add to `.cursor/mcp.json`:

     ```json
     {
       "mcpServers": {
         "encore-local": {
           "command": "encore",
           "args": ["mcp", "run", "--app=<app-id>"]
         }
       }
     }
     ```

   - **VS Code:** add to `.vscode/mcp.json`. VS Code uses `servers`, not `mcpServers`:

     ```json
     {
       "servers": {
         "encore-local": {
           "command": "encore",
           "args": ["mcp", "run", "--app=<app-id>"]
         }
       }
     }
     ```

   - **Other tools:** a stdio server with the command `encore mcp run --app=<app-id>`, or an SSE server at `http://localhost:9900/sse?app=<app-id>`.

   If `encore` isn't on the tool's PATH, which is common for editors started from the dock or start menu, use the full path from `which encore` as the command. Write it out in full, such as `/Users/<user>/.encore/bin/encore`: config files don't expand `~`.

3. Check it: `claude mcp list` in Claude Code, or the tool's MCP settings, should show `encore-local` as connected. Then call its `get_services` tool.

The app doesn't need to be running. `call_endpoint` starts it, and the database tools start the local databases, which needs Docker. Traces exist only for requests the local app has served.

### Encore Cloud server

The server is at `https://api.encore.dev/mcp`, over HTTP. It isn't tied to one app: with OAuth, it sees every app the user can access.

1. Add the server to the user's tool:

   - **Claude Code:**

     ```bash
     claude mcp add --transport http --scope user encore-cloud https://api.encore.dev/mcp
     ```

     `--scope user` makes it available in every project. Leave it out to add it to this project only.
   - **Cursor:** add to `~/.cursor/mcp.json` for every project, or `.cursor/mcp.json` for one:

     ```json
     {
       "mcpServers": {
         "encore-cloud": {
           "url": "https://api.encore.dev/mcp"
         }
       }
     }
     ```

   - **VS Code:** add to `.vscode/mcp.json`:

     ```json
     {
       "servers": {
         "encore-cloud": {
           "type": "http",
           "url": "https://api.encore.dev/mcp"
         }
       }
     }
     ```

   - **Other tools:** an HTTP (streamable HTTP) server at `https://api.encore.dev/mcp`.

2. Ask the user to authenticate. The agent can't do this step, because a person approves access in a browser:

   - **Claude Code:** the user runs `/mcp`, selects `encore-cloud`, and chooses **Authenticate**.
   - **Cursor, VS Code, and other tools:** the user starts the sign-in for `encore-cloud` from the tool's MCP settings, or from the prompt the tool shows.

3. Check it: call the `app_list` tool. It lists the user's apps.

### Encore Cloud without a person: API key

For CI or when nobody can approve access in a browser, use an API key.

1. Ask the user to create one in the Cloud Dashboard: the app's **Settings** > **Access** > **API Keys**. API keys start with `enpk_`. They're different from the auth keys under **Auth Keys**, which log in the CLI (`encore-login`). A key belongs to one app, and the server only lists the tools its scopes allow, so pick scopes for the tools the agent needs.
2. Have the user put it in an environment variable, such as `ENCORE_API_KEY`, and add the server with an `Authorization` header:

   ```bash
   claude mcp add --transport http encore-cloud https://api.encore.dev/mcp \
     --header "Authorization: Bearer $ENCORE_API_KEY"
   ```

   In other tools, add `"headers": {"Authorization": "Bearer <api-key>"}` to the server's entry, in a config file that isn't committed, such as a user-level one.
3. Check it with a tool the key's scopes allow.

## Troubleshooting

- **The server doesn't appear:** the tool hasn't reloaded its MCP config. Ask the user to restart it.
- **`encore-local` fails to start:** run `encore mcp run --app=<app-id>` in a terminal to see the error. Usually `encore` isn't on the tool's PATH (use the full path), or the app ID is wrong (run `encore mcp start` again).
- **`encore-cloud` says authentication is required:** the user hasn't finished OAuth (step 2), or the API key is wrong, expired, or deleted.
- **`encore-cloud` lists few or no tools with an API key:** the key's scopes don't cover them. Ask the user to add scopes or create a new key.

## Guidelines

- Never ask the user to paste an API key into the chat, and never commit one. Keep it in an environment variable or a config file outside the repository.
- MCP tools can query databases and call endpoints. The user's tool asks before running them, depending on its approval settings.
- `encore llm-rules init --llm-rules=<tool>` sets up the local server together with Encore's coding rules for `cursor`, `claudecode`, `vscode`, or `zed`, for apps that are on Encore Cloud. Use it when the user also wants the rules files.
- Docs: https://encore.dev/docs/mcp and https://encore.dev/docs/platform/cloud-mcp
