# Grok Web, Grok Build, and xAI API + Pear MCP guide

<!-- MCP_HOST_IDS: grok-web, grok-build, xai-api -->
<!-- MCP_HOST_COMPATIBILITY:START -->
## Connection and authentication

Use the authentication method shown for each client surface.

| Client surface | Authentication | Setup guide |
| --- | --- | --- |
| Grok web | OAuth with a registered Client ID | Setup guide available |
| Grok Build | API key via environment | Setup guide available |
| xAI API | API key | Setup guide available |
<!-- MCP_HOST_COMPATIBILITY:END -->

Choose the setup for the Grok surface you use:

- **grok.com web connector:** Pear's OAuth client is active in production and ready to connect with the public Client ID and PKCE values below.
- **Grok Build:** use a Pear API key through the Bearer header setup below.
- **xAI API:** pass a Pear API key through the remote MCP `authorization` field.

Pear server URL:

```text
https://pearmcp.com/api/mcp
```

## Grok Web OAuth setup

Pear's Grok Web OAuth client is active in production with `pear_oauth_grok_web` as its
stable public application ID. Open Grok's connector settings, create a Custom connector, and enter the
Pear server URL. Keep the authorization endpoint, token endpoint, and `mcp:` scopes
that Grok discovers. In the OAuth Credentials Required dialog, use:

- **Client ID:** `pear_oauth_grok_web`
- **Client Secret:** leave blank
- **Token Auth Method:** `None / PKCE only`
- **PKCE:** `S256` if Grok presents a PKCE choice

No Pear API key is needed for the Grok Web OAuth flow. Select Save & Connect, sign in
to Pear, approve the connection, and return to Grok. Pear uses Grok's registered
callback at `https://grok.com/connectors-oauth-exchange-code/` to complete the flow.

Leave Client Secret empty. Pear does not issue a Grok client secret because this is a
public OAuth client protected by PKCE. Never paste a `pear_sk_...` Pear API key into
Grok's Client ID or Client Secret fields. A Pear API key is a Bearer credential for the
separate Grok Build and xAI API paths below, not an OAuth client credential.

xAI's generic custom connector instructions are available in the
[Grok connector documentation](https://docs.x.ai/grok/connectors).

Grok Business and Enterprise workspaces require a team admin to provision Pear in the
cloud console before members can connect it. Adding or removing connectors requires
Team Read-Write permission.

## Grok Build setup

Store the Pear API key in the `PEAR_API_KEY` environment variable without committing
it. Then add Pear through Grok Build's documented static-header path:

```bash
grok mcp add --transport http pear https://pearmcp.com/api/mcp \
  --header 'Authorization: Bearer ${PEAR_API_KEY}'
grok mcp doctor pear
grok inspect
grok
```

Inside the Grok TUI, open `/mcps` to check Pear status. See xAI's
[Grok Build MCP server documentation](https://docs.x.ai/build/features/mcp-servers)
for configuration scopes, environment interpolation, and diagnostics.

## xAI API remote MCP setup

Keep the Pear key in your server environment and pass it through the remote MCP
tool's `authorization` field:

```javascript
const pearApiKey = process.env.PEAR_API_KEY;

if (!pearApiKey) throw new Error('Missing PEAR_API_KEY');

const pearMcpTool = {
  type: 'mcp',
  server_url: 'https://pearmcp.com/api/mcp',
  server_label: 'pear',
  server_description: 'Pear MCP connects Grok to Calendar, Tasks, Contacts, and Mail.',
  authorization: `Bearer ${pearApiKey}`,
};
```

Pass `pearMcpTool` in the xAI request's `tools` array. See xAI's
[Remote MCP Tools documentation](https://docs.x.ai/developers/tools/remote-mcp)
for the supported SDK and Responses API request shapes.

Available tools and write actions depend on the current Grok surface, workspace role,
connector configuration, and permission policy.

## Apple Reminders compatibility

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
iCloud or replacing the App-Specific Password cannot change that protocol limit.
Microsoft To Do uses Microsoft Graph and is unaffected. See the
[Apple Reminders compatibility note](./apple-reminders-compatibility.md).

## Use cases

- Once connected, ask Grok to read mail context, create a follow-up task, and schedule the next meeting.
- Use Grok Build to create Microsoft To Do follow-ups, or usable legacy Apple CalDAV
  reminders, while inspecting project instructions and MCP config.
- Use the xAI API remote MCP path when you want Pear tools in your own Grok-powered app.
