MewCPMewCP
  • AstheTech
  • Contact Us
  • Documentation
  • MewCP Auth API
Have a question?
  • ✉ Contact us - our dev team will reach out as soon as possible

© 2026 MewCP. All rights reserved.

githubx
Getting Started
Connect AI Apps
    Claude DesktopClaude CodeVS CodeCursorCodexOpenCodeOpenClawAntigravityHermesDeepSeek Harness
Frameworks & SDKs
Authentication
Auth API Guides
powered by Zudoku
Connect AI Apps

How to Connect OpenCode to MewCP

Add MewCP to OpenCode once, and OpenCode can use every app you have connected in MewCP: Gmail, Calendar, Slack, GitHub and the rest. OpenCode connects to MewCP directly over HTTP, so there is nothing to install.


Before you start

  • OpenCode installed (install guide)
  • A API Key from Dashboard → API Keys, see API Key
  • At least one app connected in the dashboard under Servers

Set up MewCP

  1. Open the config file

    OpenCode reads its config from these files and merges them:

    FileMewCP loads in
    ~/.config/opencode/opencode.jsonEvery project
    opencode.json in a project rootThat project only, for everyone who opens it from git

    Create the file if it does not exist.

  2. Add MewCP

    Paste this into the file and replace API_KEY with your key:

    Code
    { "$schema": "https://opencode.ai/config.json", "mcp": { "mewcp": { "type": "remote", "url": "https://gateway.mewcp.com/personal/mcp", "enabled": true, "oauth": false, "headers": { "Authorization": "Bearer API_KEY" } } } }

    Already have an mcp section? Add only the "mewcp": { ... } entry inside it.

    Keep "oauth": false. MewCP signs in with your key, not OAuth, and without this line OpenCode tries to start an OAuth sign-in whenever MewCP answers 401.

  3. Restart OpenCode

    Quit OpenCode and start it again so it loads the new server.

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

Keep the key out of the file

OpenCode can read the key from an environment variable or a file instead. Use either value for the header:

Code
"Authorization": "Bearer {env:MEWCP_API_KEY}"
Code
"Authorization": "Bearer {file:~/.secrets/mewcp-key}"

For {env:MEWCP_API_KEY}, set export MEWCP_API_KEY="API_KEY" in your shell profile. For {file:...}, the file holds the key alone. Either way, a project's opencode.json can then go into git without your key.


Check it works

Run:

TerminalCode
opencode mcp list

mewcp should be listed. To test the connection itself, run opencode mcp debug mewcp.

You will see four tools, not the tools of every app: search, get_schema, list_accounts and call_tool. That is expected. OpenCode uses them to find and run the right tool for whatever you ask. See How MewCP works.

Then ask for something from an app you have connected. Adding use mewcp tells OpenCode which tools to reach for:

Code
What is on my calendar tomorrow? use mewcp

Troubleshooting

OpenCode asks you to sign in, or opens a browser for MewCP

OpenCode starts an OAuth sign-in when a server answers 401. Add "oauth": false to the mewcp entry, then fix the key as below.

MewCP returns 401 or 403

MewCP rejected the key.

  • Check the header reads Bearer followed by the whole key, which starts with mcp_live_.
  • With {env:MEWCP_API_KEY}, check the variable is set in the terminal you start OpenCode from: echo $MEWCP_API_KEY. OpenCode replaces an unset variable with an empty string, so MewCP receives no key.
  • A 403 that says the billing period is not active means your MewCP plan needs renewing in the dashboard.

MewCP's tools do not load on a slow connection

OpenCode waits 5 seconds for a server's tools. Raise the limit with timeout, in milliseconds:

Code
"mewcp": { "type": "remote", "url": "https://gateway.mewcp.com/personal/mcp", "enabled": true, "oauth": false, "timeout": 15000, "headers": { "Authorization": "Bearer API_KEY" } }

A change to the config does nothing

OpenCode merges the global and project files, and the project's opencode.json wins for the same key. If MewCP is defined in both, edit the project's entry. Run opencode debug config to see the config OpenCode actually uses.


Last checked against OpenCode's documentation on 13 October 2026.

Last modified on October 15, 2026
CodexOpenClaw
On this page
  • Before you start
  • Set up MewCP
    • Keep the key out of the file
  • Check it works
  • Troubleshooting
    • OpenCode asks you to sign in, or opens a browser for MewCP
    • MewCP returns 401 or 403
    • MewCP's tools do not load on a slow connection
    • A change to the config does nothing
JSON
JSON
JSON
JSON