# OpenCode MCP setup for iCloud and Microsoft 365

<!-- MCP_HOST_IDS: opencode -->
<!-- MCP_HOST_COMPATIBILITY:START -->
## Connection and authentication

Use the authentication method shown for each client surface.

| Client surface | Authentication | Setup guide |
| --- | --- | --- |
| OpenCode | API key via environment | Setup guide available |
<!-- MCP_HOST_COMPATIBILITY:END -->

Configure Pear in OpenCode v1 or v2 with an environment-backed API key for iCloud and Microsoft 365. Setup documented; host testing remains open.

## 1. Connect your provider in Pear


Sign in to Pear, connect Apple iCloud or Microsoft 365, and copy your Pear API key from Settings. Supply it as PEAR_API_KEY in the environment that starts OpenCode. The key authenticates your Pear account, not your model provider.



## 2. Use the configuration for your OpenCode version


Check your installed major version first. OpenCode v1 puts named servers directly under mcp. OpenCode v2 puts them under mcp.servers. Merge the matching entry into your existing configuration.


### OpenCode v1


```json
{
  "mcp": {
    "pear": {
"type": "remote",
"url": "https://pearmcp.com/api/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:PEAR_API_KEY}"
}
    }
  }
}
```


### OpenCode v2


```json
{
  "mcp": {
    "servers": {
"pear": {
"type": "remote",
"url": "https://pearmcp.com/api/mcp",
"oauth": false,
"headers": {
  "Authorization": "Bearer {env:PEAR_API_KEY}"
}
}
    }
  }
}
```


Keep the literal environment reference in the file. oauth: false selects the API-key path. Pear does not offer automatic dynamic client registration, so a generic OAuth example is not a replacement for this configuration.



## 3. Check the connection before using your data


Open your MCP connection list and confirm Pear is connected. In v1, use opencode mcp list. Ask OpenCode to call pear_provider_status and report which accounts and services are ready. An empty tool list is a setup issue to resolve before requesting calendar or mail work.



## If OpenCode cannot connect


A configuration error can mean the v1 and v2 structures were mixed. An authentication error can mean PEAR_API_KEY was absent when OpenCode started. Restart your own OpenCode session after changing its environment. Never paste your key into a chat to diagnose the error.


## Provider limits and next steps

Start with a read such as provider status, a known event, or a known message. Specify the account and timezone. Available tools depend on the connected provider, account, and client permissions.

- [iCloud setup](https://pearmcp.com/icloud-mcp-server)
- [iCloud Mail](https://pearmcp.com/ai-icloud-mail)
- [Microsoft 365](https://pearmcp.com/microsoft-365-mcp-server)
- [Outlook Mail](https://pearmcp.com/outlook-mail-mcp)
- [Microsoft To Do](https://pearmcp.com/microsoft-to-do-mcp)
- [Data handling](https://pearmcp.com/data-handling)
- [Plans](https://pearmcp.com/pricing)

Pear's hosted CalDAV connection cannot access Apple's upgraded Reminders store. It can use only the legacy reminder data Apple still exposes through CalDAV. Reconnecting cannot change this limit. Microsoft To Do is unaffected. Google Workspace is coming soon.

Review recipients, dates, and content before approving writes. Pear exposes permitted tools; the AI client controls when it calls them.

## Sources and status

Documentation checked on 9 September 2026. Setup guidance is not proof of a completed Pear connection in OpenCode.

- [Official OpenCode documentation](https://opencode.ai/docs/mcp-servers/)
- [OpenCode v2 configuration](https://opencode.ai/v2/docs/mcp-servers)
