# Already connected through MCP?

Keep using Mochi through MCP for the tasks that your existing MCP connection supports. You can install the Mochi
skill to help an AI agent find the current documentation without reconnecting:

```bash
npx skills add TheMochiApp/mochi-cli --skill mochi-api
```

Installing the skill does not grant access, reconnect MCP, or expose credentials. It only helps the agent read
[`/llms.txt`](https://themochi.app/docs/llms.txt), select the smallest relevant guide, and inspect the generated
[OpenAPI contract](https://themochi.app/docs/api/openapi.json) for exact details.

## Read lead handovers and sync changes

Use `get_lead_crm_detail` with a Mochi lead ID to read team notes with their authors and dates, current tags with
application dates, and dated funnel movements. Each collection contains `items` and `next_after_id`. To read more,
request that section by name and pass its `next_after_id` as `after_id`. Tag dates are null where no application
date was recorded. To build a chronological timeline, combine `stage_history` with `stage_relocations` (moves
caused by retiring a funnel stage) and sort by `at`. Conversation summaries remain available through
`get_conversation_detail`.

Mochi operations can enable change tracking for an individual workspace with
`python manage.py enable_lead_crm_sync <organization_uuid>` after applying the database migration. The tool can
start issuing checkpoints once writes already in progress finish. Lead detail is available independently.

To sync your workspace:

1. Call `list_updated_leads` without arguments for an initial import. For a date-based start, pass an inclusive
   UTC date or a timestamp with a time zone in `updated_since`. Historical matches depend on the records Mochi
   still holds. An initial full import covers leads whose older changes have no surviving dated record.
2. For each returned `lead_id` in `lead_ids`, fetch its detail and upsert it in your CRM. Replace the local set of
   tags after reading all tag pages so removed tags disappear. A lead can occur again after a change or retry.
3. Persist `next_cursor` after saving the page, including empty pages. If `has_more` is true, continue immediately.
   Otherwise pass the saved cursor on your next scheduled poll. Use the same workspace and member for the cursor.
   A long-running database transaction can delay new changes across workspaces. Keep polling with the returned
   cursor so late commits are included.

The feed tracks changes to visible leads, their notes, tag assignments and funnel movements. It returns IDs for
records you can still read. Use a full import to reconcile deleted leads, changes in member visibility, or changes
to shared labels such as renamed tags and author names.

## Do not move an MCP credential

Never export, copy, exchange, or convert an MCP token. MCP/Zapier and the Public API share underlying OAuth
infrastructure, but they are separate authorization boundaries: a legacy empty-resource MCP grant does not authorize
`/v1/`.

If a task needs a Public API-specific operation, it needs an API key or separate exact-resource consent when that
controlled path is available. Do not assume that an MCP tool, token, or prior Zapier connection grants the operation.

## Browser sign-in is not approval

An existing signed-in Mochi browser session can avoid password re-entry during a new approval flow. It does not skip
organization or scope consent. The person approving the connection must still select the organization and explicitly
approve the requested Public API scopes.

See [Connect an AI agent](https://themochi.app/docs/api/common-tasks/connect-ai-agent) for the safest connection choice. If an MCP task fails, use the
existing MCP reconnect screen only when that connection is invalid; do not troubleshoot by exposing its token.
