DocsOpen Moon AI
Browse the docs

MCP servers in Moon CLI

Give the agent new tools with MCP servers: a verified catalog, custom servers, signing in even without a browser, and confirmation before each tool runs.

On this page

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

  1. In the agent, type /mcp. The “Serveurs MCP” (MCP servers) window lists your “Serveurs configurés” (configured servers) with their status.
  2. 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).
  3. If the server needs you to sign in to your account with that service, the sign-in page opens in your browser.
  4. The server connects right away, without restarting Moon CLI.

CatalogLink to the Catalog section

ServerUseSign-in
Context7Up-to-date documentation for libraries and frameworks.None.
GitHubRepositories, issues, pull requests.GitHub token in the GITHUB_TOKEN variable.
LinearIssues, projects and cycles.Your account with the service, in the browser.
SentryErrors and performance of your applications.Your account with the service, in the browser.
NotionPages and databases.Your account with the service, in the browser.
AtlassianJira and Confluence.Your account with the service, in the browser.
Cloudflare docsCloudflare documentation.None.

Custom serverLink to the Custom server section

  1. Choose “Ajouter un serveur personnalisé (URL ou commande)” (add a custom server, URL or command).
  2. Enter the “Nom du serveur MCP” (MCP server name): letters, digits and hyphens. The server’s tools will be called <name>_<tool>.
  3. Enter the server’s address (https://…) or the command that starts it (for example npx -y @org/mcp-server).

Manage a serverLink to the Manage a server section

Select a server in the /mcp list:

ActionEffect
“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).

StatusMeaning
“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.

KeyEffect
cCopies the link. On WSL, it goes to the Windows clipboard.
oOpens the link in the browser again.
vPastes the address of the return page (http://127.0.0.1:19876/mcp/oauth/callback?code=…), when you signed in with the browser of another machine. Confirm with Enter.
EscCancels 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

Terminal
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
CommandEffect
moon mcp listLists the servers and their status.
moon mcp add <name> --url <url>Adds a remote server; --header KEY=VALUE adds a header.
moon mcp add <name>, then a double hyphen and the commandAdds a local server (example above); --env KEY=VALUE passes it a variable.
moon mcp auth [name]Connects a server to your account with the service.
moon mcp logout [name]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, ~/.config/moon/opencode.json (Windows: %USERPROFILE%\.config\moon\opencode.json), for all your projects. This is where /mcp writes;
  • in a project’s opencode.json file, for that project only. Moon CLI only loads it after your approval: see A repository’s configuration.

A server that runs on your computer:

opencode.json
{
  "mcp": {
    "my-server": {
      "type": "local",
      "command": ["npx", "-y", "mcp-package-name"],
      "enabled": true
    }
  }
}

A remote server with a token read from an environment variable:

opencode.json
{
  "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:

Project opencode.json
{
  "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.

See alsoLink to the See also section

Moon AI

Moon AI in action

0:00

Explore

Screenshots of chat.realmoon.ai taken on October 29, 2026, with fictional data.

Moon AI

Your preferences

Visits counted without cookies.

Our server counts visits without cookies or trackers. Your theme and your answer about ad measurement are remembered on this device.

Ad measurement

With your consent, our ad networks’ trackers (Google) measure our ads, from the visit to the sign-up and then to the first subscription and its amount, and may show you our ads. Your answer is valid for 13 months; you can change it here at any time.

No answer saved on this device.

After you decline, no tag is loaded anymore and the site deletes the cookies they had set on realmoon.ai. Those on the ad networks’ own domains are managed with them or in your browser.

The Moon AI app has its own privacy settings.