> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profy.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Use the Profy MCP Server in Cursor, Codex, and other IDEs

Profy provides an MCP (Model Context Protocol) Server that lets you manage the full Expert lifecycle from within Cursor, Codex, or any MCP-compatible IDE — without leaving your editor.

## Quick Connection

Create or edit a `.mcp.json` file in your project root:

```json theme={null}
{
  "mcpServers": {
    "profy": {
      "url": "https://mcp.profy.cn/mcp"
    }
  }
}
```

<Note>
  The MCP Server authenticates using your Profy browser session. On first use, your IDE will prompt you to log in to Profy in the browser.
</Note>

## Available Tools (22)

The Profy MCP Server provides 22 tools covering the complete workflow from Expert creation to monetization. All tools are lightweight proxies to existing Profy services and introduce no new business logic.

### Identity (2)

| Tool                  | Description                                 | Parameters                                   |
| --------------------- | ------------------------------------------- | -------------------------------------------- |
| `get_creator_profile` | Get your creator profile and status         | None                                         |
| `apply_creator`       | Apply to become a Profy marketplace creator | `displayName`, `bio`, `email`, `accountType` |

### Expert Config (4)

| Tool                | Description                              | Parameters                                         |
| ------------------- | ---------------------------------------- | -------------------------------------------------- |
| `create_expert`     | Create a new Expert draft                | `name`, `description?`, `category?`                |
| `update_expert`     | Update Expert configuration fields       | `identifier`, `name?`, `description?`, `category?` |
| `get_expert_detail` | Get detailed information about an Expert | `identifier`                                       |
| `list_my_experts`   | List all Experts you created             | None                                               |

### Skills (3)

| Tool                      | Description                               | Parameters                |
| ------------------------- | ----------------------------------------- | ------------------------- |
| `install_skill`           | Install a marketplace skill for an Expert | `identifier`, `skillName` |
| `list_expert_skills`      | List skills installed on an Expert        | `identifier`              |
| `list_marketplace_skills` | Browse the skill marketplace              | `keyword?`                |

### Billing & Publish (3)

| Tool                    | Description                                            | Parameters                                                                |
| ----------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------- |
| `set_billing`           | Set the Expert's pricing model and trial configuration | `identifier`, `billingType`, `price?`, `freeTrialPerUser?`, `allowTrial?` |
| `publish_expert`        | Submit an Expert for review and publication            | `identifier`                                                              |
| `get_submission_status` | Check the Expert's review status                       | `identifier`                                                              |

### Distillation (2)

| Tool                    | Description                                                                  | Parameters             |
| ----------------------- | ---------------------------------------------------------------------------- | ---------------------- |
| `start_distillation`    | Start a distillation conversation to inject your expertise into an AI Expert | `topic?`, `materials?` |
| `continue_distillation` | Continue the distillation conversation by answering the AI's questions       | `sessionId`, `message` |

<Warning>
  Distillation tools use a synchronous SSE collection mode and may take \~30 seconds to complete. Please wait patiently for the response.
</Warning>

### Testing (2)

| Tool               | Description                                      | Parameters              |
| ------------------ | ------------------------------------------------ | ----------------------- |
| `test_expert`      | Send a test message to an Expert and get a reply | `identifier`, `message` |
| `open_expert_chat` | Get the browser chat page URL for an Expert      | `identifier`            |

### Navigation (1)

| Tool              | Description               | Parameters                                               |
| ----------------- | ------------------------- | -------------------------------------------------------- |
| `open_profy_page` | Generate a Profy page URL | `page` (studio/chat/marketplace/earnings), `identifier?` |

### Evolution (3)

| Tool                         | Description                               | Parameters     |
| ---------------------------- | ----------------------------------------- | -------------- |
| `list_evolution_suggestions` | List AI-generated improvement suggestions | `identifier`   |
| `accept_evolution`           | Accept an evolution suggestion            | `suggestionId` |
| `get_evolution_stats`        | Get evolution statistics for an Expert    | `identifier`   |

### Earnings (2)

| Tool                 | Description                                                                    | Parameters                                    |
| -------------------- | ------------------------------------------------------------------------------ | --------------------------------------------- |
| `get_earnings`       | Get the creator's earnings summary (diamond balance, pending withdrawal, etc.) | None                                          |
| `browse_marketplace` | Browse published Experts on the marketplace                                    | `keyword?`, `category?`, `page?`, `pageSize?` |

## Typical Workflows

### Creating an Expert from Scratch

```
You: Use create_expert to create an Expert named "Code Review Assistant"
AI: [Calls create_expert] Created with identifier code-review-helper

You: Start distillation — I'm a code review expert with 10 years of experience
AI: [Calls start_distillation] Distillation started, AI is asking questions...

You: (Answer the AI's questions)
AI: [Calls continue_distillation] Continuing conversation...

You: Set billing to METERED with 5 free trials
AI: [Calls set_billing] Done

You: Publish to the marketplace
AI: [Calls publish_expert] Submitted for review
```

### Reviewing and Optimizing an Expert

```
You: List all my Experts
AI: [Calls list_my_experts] You have 3 Experts...

You: Check evolution suggestions for code-review-helper
AI: [Calls list_evolution_suggestions] There are 2 suggestions...

You: Accept the first suggestion
AI: [Calls accept_evolution] Accepted; skill updated

You: Check my earnings
AI: [Calls get_earnings] This month's earnings...
```

## Authentication

The MCP Server uses Profy's Session authentication (Browser Cookie / Bearer Token).

* **Cursor / Codex IDE plugins**: The IDE handles authentication automatically, prompting a browser login on first use
* **Manual configuration**: If your IDE does not handle it automatically, ensure you are logged in at `app.profy.cn` in your browser

## Profy Plugin (IDE Plugin)

Profy provides IDE plugins for Cursor and Codex that include a pre-configured MCP Server and 4 dedicated Skills:

| Skill                | Description                                  |
| -------------------- | -------------------------------------------- |
| **distillation**     | Guided distillation workflow                 |
| **quick-start**      | Quickly create and configure an Expert       |
| **publish-and-earn** | Publish to the marketplace and start earning |
| **evolution**        | View and manage Expert evolution             |

The plugin's MCP configuration (`.mcp.json`) points to `mcp.profy.cn/mcp`, identical to the manual configuration method.

## Transport Protocol

The Profy MCP Server uses **Streamable HTTP** transport (stateless mode), built on the `@modelcontextprotocol/server` SDK's `WebStandardStreamableHTTPServerTransport`.

Key characteristics:

* **Stateless**: No session management; each request is handled independently
* **CORS**: Supports cross-origin requests (with MCP-required headers)
* **Timeout**: 300-second server timeout (to accommodate time-consuming operations like distillation)
* **Path**: All MCP requests are sent to `/mcp`

## Notes

<AccordionGroup>
  <Accordion title="Distillation tools are slow">
    `start_distillation` and `continue_distillation` internally call the invoke endpoint synchronously via the SSE Collector, which may take 20–60 seconds. This is expected — distillation involves multiple rounds of AI interaction.
  </Accordion>

  <Accordion title="test_expert is also synchronous">
    `test_expert` also waits synchronously for the Expert's reply via the SSE Collector. Simple conversations typically complete within 5–15 seconds.
  </Accordion>

  <Accordion title="Creator status required">
    Most tools require a logged-in Profy account. Creating and publishing Experts requires first applying for creator status via `apply_creator`.
  </Accordion>

  <Accordion title="All write operations require authentication">
    Except for `browse_marketplace` and `list_marketplace_skills`, all tools require authentication. Calling without being logged in will return an authentication error.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/en/developers/quickstart">
    Make your first API call
  </Card>

  <Card title="App Development Guide" icon="grid-2" href="/en/developers/app-development">
    Build a complete Profy App
  </Card>
</CardGroup>
