# Qwen Code MCP setup for iCloud and Microsoft 365

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

Use the authentication method shown for each client surface.

| Client surface | Authentication | Setup guide |
| --- | --- | --- |
| Qwen Code | API key | Setup guide available |
<!-- MCP_HOST_COMPATIBILITY:END -->

Connect Qwen Code to Pear with a private API-key header to use your connected calendar, mail, contacts, and supported tasks.

This guide covers the Qwen Code coding CLI. It does not establish a custom Pear connection in the consumer Qwen chat app or in a Qwen model used through another client.

## 1. Prepare your Pear account

[Sign in to Pear](https://pearmcp.com/login), connect iCloud or Microsoft 365, and create a personal Pear API key in Settings. Select only the provider permissions you need.

## 2. Add a private remote MCP connection

Open your personal `~/.qwen/settings.json` in a local editor. Merge the Pear entry into its existing `mcpServers` object, preserving other settings and servers. Keep this credential out of project-level `.qwen/settings.json`.

```json
{
  "mcpServers": {
    "pear": {
      "httpUrl": "https://pearmcp.com/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_PEAR_API_KEY"
      }
    }
  }
}
```

Use `httpUrl` for Streamable HTTP. Qwen Code uses `url` for legacy SSE, so those fields are not interchangeable.

Replace `YOUR_PEAR_API_KEY` only in your private configuration. This example stores a literal secret: do not paste it into chat, shell commands or shell history, screenshots, shared settings, or a committed file. It does not promise encrypted local header storage or environment expansion.

## 3. Verify access with a bounded read

Restart Qwen Code after editing the file and open `/mcp` to inspect Pear and its available tools.

Ask the agent to call `pear_provider_status`. Confirm the expected provider, account, and ready services. Then read one known event from a named calendar within an explicit date range and timezone. Compare the result with your calendar.

Keep client tool approvals enabled. For a change, request a draft through `pear_draft_write`, inspect the exact account, recipients, dates, and content, and approve only that action before `pear_execute_approved_write`. Check the receipt and provider result. A successful read does not prove writes work.

## Try a small planning task

“Check my work calendar tomorrow in my timezone and suggest a one-hour slot for code review. Do not create an event.”

Expand the workflow only after the account and first result match your expectations. Available tools depend on connected providers, scopes, plan, and client policy. Pear Free includes 50 counted provider actions per month; check [current plans](https://pearmcp.com/pricing) for your needs.

## Troubleshooting and removing access

If the server does not appear, check the user settings file and JSON syntax. If it uses the wrong transport, replace `url` with `httpUrl`. Keep confirmation prompts enabled; do not add `trust: true` for the initial test.

For authentication failures, check the complete `Bearer ` prefix and the active key in Pear. For unavailable services, repair the provider connection in Pear. An OAuth login prompt is not proof this API-key setup has connected.

To remove access, revoke the API key in Pear and delete the local Pear server entry. Removing the entry alone does not revoke a copied key. Revoke an exposed key before replacing it, and update any other clients that used that key.

Pear receives structured tool calls rather than your full chat transcript. Tool results enter the AI client and are subject to its data policies. Review [Pear data handling](https://pearmcp.com/data-handling) before sharing sensitive provider data.

## Provider limits and next steps

Pear supports iCloud and Microsoft 365. Its hosted CalDAV connection can access only legacy reminder data Apple still exposes, not the upgraded Apple Reminders store. Reconnecting cannot change this limit. Microsoft To Do is unaffected. Google Workspace is coming soon.

- [iCloud setup](https://pearmcp.com/icloud-mcp-server)
- [iCloud Mail](https://pearmcp.com/ai-icloud-mail)
- [Microsoft 365 setup](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)

## Sources and compatibility status

Documentation checked on 26 September 2026. Setup guide available; authenticated Pear testing in Qwen Code, including authentication, tool discovery, a read, an approved write, and revocation, remains pending. This guide is not an official marketplace listing or an endorsement by the client vendor.

- [Official Qwen Code MCP documentation](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/)
- [HTML setup guide](https://pearmcp.com/guides/qwen-code)
