website/docs/guides/mcp.mdx
import VersionLabel from '@site/src/components/Docs/VersionLabel';
<VersionLabel version="1.37.0" header />Model Context Protocol (MCP) is an open standard that enables AI models to interact with external tools and services through a unified interface. The moon CLI contains an MCP server that you can register with your code editor to allow LLMs to use moon directly.
To use MCP servers in Claude Code, run the following command in your terminal:
claude mcp add moon -s project -e MOON_WORKSPACE_ROOT=/absolute/path/to/your/moon/workspace -- moon mcp
Or create an .mcp.json file in your project directory.
{
"mcpServers": {
"moon": {
"command": "moon",
"args": ["mcp"],
"env": {
"MOON_WORKSPACE_ROOT": "/absolute/path/to/your/moon/workspace"
}
}
}
}
To use MCP servers in Cursor, create a
.cursor/mcp.json file in your project directory, or ~/.cursor/mcp.json globally, with the
following content:
{
"mcpServers": {
"moon": {
"command": "moon",
"args": ["mcp"],
"env": {
"MOON_WORKSPACE_ROOT": "/absolute/path/to/your/moon/workspace"
}
}
}
}
Once configured, the moon MCP server should appear in the "Available Tools" section on the MCP settings page in Cursor.
To use MCP servers in VS Code, you must have the
Copilot Chat extension installed.
Once installed, create a .vscode/mcp.json file with the following content:
{
"servers": {
"moon": {
"type": "stdio",
"command": "moon",
"args": ["mcp"],
// >= 1.102 (June 2025)
"cwd": "${workspaceFolder}",
// Older versions
"env": {
"MOON_WORKSPACE_ROOT": "${workspaceFolder}"
}
}
}
}
Once your MCP server is configured, you can use it with GitHub Copilot’s agent mode:
To use MCP servers in Zed, create a .zed/settings.json file in your
project directory, or ~/.config/zed/settings.json globally, with the following content:
{
"context_servers": {
"moon": {
"command": {
"path": "moon",
"args": ["mcp"],
"env": {
"MOON_WORKSPACE_ROOT": "/absolute/path/to/your/moon/workspace"
}
}
}
}
}
Once your MCP server is configured, you'll need to enable the tools using the following steps:
The following tools are available in the moon MCP server and can be executed by LLMs using agent mode.
get_project - Get a project and its tasks by id.get_projects - Get all projects.get_task - Get a task by target.get_tasks - Get all tasks.get_changed_files - Gets changed files between base and head revisions.
<VersionLabel version="1.38.0" />sync_projects - Runs the SyncProject action for one or many projects by id.
<VersionLabel version="1.38.0" />sync_workspace - Runs the SyncWorkspace action. <VersionLabel version="1.38.0" />:::info
The
request and response shapes
for these tools are defined as TypeScript types in the
@moonrepo/types package.
:::