# How to Connect Kimi Code to MewCP

Kimi Code is Moonshot AI's command-line coding agent. It connects to remote MCP servers over HTTP, set up in one JSON file, and signs in with OAuth from the terminal. Add MewCP once, and Kimi Code can use every app you have connected in MewCP: Gmail, Calendar, Slack, GitHub and the rest. There is no API key to paste.

---

## Before you start

- **Kimi Code** installed
- **A MewCP account** with **at least one app connected** under [Apps](https://mewcp.com/dashboard/apps)

---

## Set up MewCP

<Stepper>

1. **Open your config**

   Edit `~/.kimi-code/mcp.json`. Create it if it does not exist. For one repository only, use `.kimi-code/mcp.json` in that project instead.

1. **Add the server**

   An entry with a `url` is an HTTP server:

   ```json
   {
     "mcpServers": {
       "mewcp": {
         "url": "https://gateway.mewcp.com/personal/mcp"
       }
     }
   }
   ```

1. **Sign in to MewCP**

   Start a new Kimi Code session, since servers added mid-session only join new ones. Then run this and approve access in the browser:

   ```
   /mcp-config login mewcp
   ```

</Stepper>

This is the entire configuration. One entry reaches every app you have connected, and connecting another app later needs no change here.

---

## Check it works

Ask:

```
List the tools you can use from MewCP.
```

`/mcp` shows the connection status.

You will see four tools, not the tools of every app: `search`, `get_schema`, `manage_connections` and `call_tool`. That is expected. Kimi Code uses them to find and run the right tool for whatever you ask. See [How MewCP works](/mewcp/getting-started#how-mewcp-works).

---

## Troubleshooting

### MewCP is missing from the session

Servers added mid-session only join new sessions. Start a new Kimi Code session.

### Sign-in has expired or failed

Run `/mcp-config login mewcp` again. See [OAuth Sign-In](/mewcp/authentication/oauth-sign-in#troubleshooting) for errors on the sign-in page.

### A `403` says your plan's billing period has ended

Your MewCP plan needs renewing under [Billing](https://mewcp.com/dashboard/billing).

---

_Last updated on 29 November 2026._
