MCP integration
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.
Setup
Cursor
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.
VS Code
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"],
"env": {
"MOON_WORKSPACE_ROOT": "${workspaceFolder}"
}
}
}
}
Once your MCP server is configured, you can use it with GitHub Copilot’s agent mode:
- Open the Copilot Chat view in VS Code
- Enable agent mode using the mode select dropdown
- Toggle on moon's MCP tools using the "Tools" button
Zed
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:
- Open the Agent panel in Zed
- Click the Write/Ask toggle button and go to "Configure Profiles"
- Click "Customize" in the Ask section
- Click "Configure MCP Tools"
- Enable each tool under the "moon" section
Available tools
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 byid
.get_projects
- Get all projects.get_task
- Get a task bytarget
.get_tasks
- Get all tasks.
The
request and response shapes
for these tools are defined as TypeScript types in the
@moonrepo/types
package.