Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions docs/content/docs/mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,58 @@ Each catalog entry includes a link to the server's documentation for setup detai
- You can sync a single MCP server to multiple agents at once — no need to configure each one separately.
- Environment variables with credential keys are highlighted in the modal so you know what to fill in.
- Click **Refresh** to re-detect installed agents if you've installed a new CLI since opening Emdash.

---

## Emdash as an MCP Server

Emdash can also act as an MCP server itself, letting external AI agents (like Claude Code running in your terminal) create tasks inside Emdash.

### Enabling the built-in MCP endpoint

1. Open **Settings → Integrations**
2. Find the **MCP Server** section and toggle it on
3. The MCP URL appears below the toggle — copy it from there

The server only listens on `127.0.0.1` and is restarted automatically when Emdash starts (if enabled). It tries port 17823 first; if that port is in use, it falls back to 17824–17827 and then an ephemeral port. The exact URL is always shown in Settings after the server starts.

### Connecting Claude Code

Copy the MCP URL from **Settings → Integrations → MCP Server**, then add it to your Claude Code config (`.claude/mcp.json` in your project or `~/.claude/mcp.json` globally):

```json
{
"mcpServers": {
"emdash": {
"type": "http",
"url": "<paste MCP URL from Settings here>"
}
}
}
```

### Available tools

| Tool | Description |
| --------------- | ------------------------------------------------------------------ |
| `list_projects` | Returns all projects in Emdash (id, name, path) |
| `list_tasks` | Lists active tasks for a project |
| `create_task` | Queues a new task with a prompt, optional name, and optional agent |

Tasks created via MCP run exactly like tasks you create manually — Emdash opens a git worktree and starts the agent automatically.

### Standalone MCP package

A lightweight stdio bridge is available in the `mcp/` directory of the Emdash repository. It reads the port and token written by the desktop app and proxies calls over the REST API. **Emdash must still be running** — the bridge is just an alternative MCP transport, not a standalone server.

```json
{
"mcpServers": {
"emdash": {
"type": "stdio",
"command": "npx",
"args": ["tsx", "/path/to/emdash/mcp/src/index.ts"]
}
}
}
```
21 changes: 21 additions & 0 deletions mcp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@emdash/mcp",
"version": "0.1.0",
"description": "Standalone MCP server for Emdash (alternative to the built-in HTTP endpoint)",
"type": "module",
"bin": {
"emdash-mcp": "./src/index.ts"
},
"scripts": {
"start": "tsx src/index.ts",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"tsx": "^4.19.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.3"
}
}
Loading
Loading