An MCP server adds tools to the agent: query a service, drive an app on your computer, read documentation. In Moon CLI, you add them from the agent, from the terminal or in a configuration file.
The connectors you have connected in Moon AI, including your Chat MCP servers and those of your organization, do not need to be added here: since Moon CLI 0.6.0, they come in on their own. See Moon AI connectors in Moon CLI.
Add a server from the agentLink to the Add a server from the agent section
- In the agent, type
/mcp. The “Serveurs MCP” (MCP servers) window lists your “Serveurs configurés” (configured servers) with their status. - Under “Ajouter” (add), choose “Ajouter depuis le catalogue” (add from the catalog) or “Ajouter un serveur personnalisé (URL ou commande)” (add a custom server, URL or command).
- If the server needs you to sign in to your account with that service, the sign-in page opens in your browser.
- The server connects right away, without restarting Moon CLI.
CatalogLink to the Catalog section
| Server | Use | Sign-in |
|---|---|---|
| Context7 | Up-to-date documentation for libraries and frameworks. | None. |
| GitHub | Repositories, issues, pull requests. | GitHub token in the GITHUB_TOKEN variable. |
| Linear | Issues, projects and cycles. | Your account with the service, in the browser. |
| Sentry | Errors and performance of your applications. | Your account with the service, in the browser. |
| Notion | Pages and databases. | Your account with the service, in the browser. |
| Atlassian | Jira and Confluence. | Your account with the service, in the browser. |
| Cloudflare docs | Cloudflare documentation. | None. |
Custom serverLink to the Custom server section
- Choose “Ajouter un serveur personnalisé (URL ou commande)” (add a custom server, URL or command).
- Enter the “Nom du serveur MCP” (MCP server name): letters, digits and hyphens. The server’s tools will be called
<name>_<tool>. - Enter the server’s address (
https://…) or the command that starts it (for examplenpx).-y @org/ mcp-server
Manage a serverLink to the Manage a server section
Select a server in the /mcp list:
| Action | Effect |
|---|---|
| “Se connecter (navigateur)” (sign in, browser) | Starts the sign-in to your account with the service again. |
| “Connecter” (connect), “Déconnecter” (disconnect) | Turns the server on or off. |
| “Supprimer” (delete) | Removes the server from your personal configuration and erases its credentials, after the confirmation “Supprimer « nom » ?” (delete “name”?). |
Servers declared somewhere other than your personal configuration (in a project, for example) are marked “non modifiable ici” (cannot be changed here).
| Status | Meaning |
|---|---|
| “connecté” (connected) | The server’s tools are available. |
| “à authentifier” (needs sign-in) | The server is waiting for you to sign in to your account with the service. |
| “désactivé” (off) | The server is turned off. |
| “erreur” (error) | The server could not start; the reason follows. |
| “connexion impossible (client non enregistré)” (cannot connect, client not registered) | The service does not accept automatic registration of Moon CLI. |
/mcps turns your servers on or off, and /status shows their status.
Signing in when the browser does not openLink to the Signing in when the browser does not open section
On WSL, over SSH or on a server without a display, the sign-in window shows the link as soon as it is ready.
| Key | Effect |
|---|---|
| c | Copies the link. On WSL, it goes to the Windows clipboard. |
| o | Opens the link in the browser again. |
| v | Pastes the address of the return page (http://), when you signed in with the browser of another machine. Confirm with Enter. |
| Esc | Cancels the sign-in. |
If the server does not respond, Moon CLI gives up after 30 seconds and says why. The window shows the elapsed time.
From the terminalLink to the From the terminal section
moon mcp list
moon mcp add context7 --url https://mcp.context7.com/mcp
moon mcp add my-server -- npx -y mcp-package-name
moon mcp auth linear| Command | Effect |
|---|---|
moon | Lists the servers and their status. |
moon | Adds a remote server; --header adds a header. |
moon , then a double hyphen and the command | Adds a local server (example above); --env passes it a variable. |
moon | Connects a server to your account with the service. |
moon | Erases a server’s saved credentials. |
Declaring a server in a fileLink to the Declaring a server in a file section
You can also declare a server under the mcp key of the agent configuration:
- in your personal configuration,
~/(Windows:.config/ moon/ opencode.json %USERPROFILE%\.config\moon\opencode.json), for all your projects. This is where/mcpwrites; - in a project’s
opencode.jsonfile, for that project only. Moon CLI only loads it after your approval: see A repository’s configuration.
A server that runs on your computer:
{
"mcp": {
"my-server": {
"type": "local",
"command": ["npx", "-y", "mcp-package-name"],
"enabled": true
}
}
}A remote server with a token read from an environment variable:
{
"mcp": {
"my-service": {
"type": "remote",
"url": "https://example.com/mcp",
"headers": { "Authorization": "Bearer {env:MY_SERVICE_TOKEN}" },
"enabled": true
}
}
}Restart Moon CLI after editing the file, then type /mcp to check the server’s status. All keys: MCP servers in the configuration.
Moon CLI’s MCP servers are separate from those added in the web chat (“Connectors” › “MCP servers”, see MCP servers). Since Moon CLI 0.6.0, the web chat’s servers also come into the agent, with your other Moon AI connectors: see Moon AI connectors in Moon CLI.
Tool confirmationLink to the Tool confirmation section
Each MCP server tool asks for your approval before it runs, like a command. You can choose to always allow it. In automatic approval mode, tools run without asking: see Permission modes.
To allow all of a server’s tools in advance in a project, add a rule to the project configuration:
{
"permission": { "context7_*": "allow" }
}Your data and MCP serversLink to the Your data and MCP servers section
- What a tool returns goes through Moon Blur before it is sent to the model, like the rest of the conversation.
- What a tool receives contains the real values: Moon CLI puts masked values back in clear text before the call, so that the tool works. With Moon Guard on, a call that would send a real secret to an MCP tool is blocked.
- A local server runs on your machine with your permissions. Only add servers whose publisher you know.
- A remote server receives whatever the agent sends it. Check what you allow it to do.