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

# Documentation MCP

> 将只读的 Ayrshare Documentation MCP 服务器连接到你的 AI 代理，以搜索 Ayrshare 的 API 文档

<Info>
  这是只读的 **Documentation MCP**（用于搜索 Ayrshare 的 API 文档）。如需让 AI 代理 **驱动** Ayrshare API，请参见 [MCP Server](/additional/mcp-action-server)（Action MCP）。
</Info>

Model Context Protocol (MCP) 是一个开放标准，可让应用程序与大语言模型（LLM）共享上下文和工具。
通过将 Ayrshare API 文档 MCP 服务器连接到 Cursor 或 Claude Desktop 等 AI 开发工具，你可以让 AI 代理直接访问 Ayrshare 的文档。

这一集成让你的 AI 代理能够：

<ul className="custom-bullets">
  <li>搜索 Ayrshare 的 API 文档</li>
  <li>理解可用的端点和参数</li>
  <li>生成能够正确使用 Ayrshare API 的代码</li>
  <li>在处理 Ayrshare 服务时提供符合上下文的准确建议</li>
</ul>

这意味着 AI 助手可以直接参考文档，而无需你手动查阅 API 细节，从而更高效地帮助你实现 Ayrshare 相关功能。

## 如何开始

Ayrshare 的 MCP 服务器地址为 `https://www.ayrshare.com/docs/mcp`。

### Claude Desktop

1. 进入 Claude 设置中的 Connectors（连接器）页面。
2. 选择「Add custom connector」（添加自定义连接器）。
3. 将 MCP 服务器名称设置为 `Ayrshare MCP`（或任意你喜欢的名称），MCP 服务器 URL 设置为 `https://www.ayrshare.com/docs/mcp`。
4. 点击「Add」。
5. 在使用 Claude 时，点击附件按钮（加号图标）。
6. 选择你的 MCP 服务器。

### Claude Code

```bash theme={"system"}
claude mcp add --transport http ayrshare https://www.ayrshare.com/docs/mcp
```

### VS Code

[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge\&logo=visual-studio-code\&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode:mcp/install?%7B%22type%22%3A%22http%22%2C%22name%22%3A%22Ayrshare-MCP%22%2C%22url%22%3A%22https%3A%2F%2Fwww.ayrshare.com%2Fdocs%2Fmcp%22%7D)

1. 创建 .vscode/mcp.json 文件。
2. 在 mcp.json 中配置你的服务器：

```json theme={"system"}
{
  "servers": {
    "Ayrshare MCP": {
      "type": "http",
      "url": "https://www.ayrshare.com/docs/mcp"
    }
  }
}
```

### Cursor

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=Ayrshare-MCP\&config=eyJ1cmwiOiJodHRwczovL3d3dy5heXJzaGFyZS5jb20vZG9jcy9tY3AifQ==)

1. 使用 Command + Shift + P（Windows 上为 Ctrl + Shift + P）打开命令面板。
2. 搜索 "Open MCP settings"。
3. 选择「Add custom MCP」（添加自定义 MCP）。这会打开 mcp.json 文件。
4. 在 mcp.json 中配置你的服务器：

```json theme={"system"}
{
  "mcpServers": {
    "Ayrshare MCP": {
      "url": "https://www.ayrshare.com/docs/mcp"
    }
  }
}
```

## 使用 MCP 服务器连接

重启应用以应用更改。

在 Cursor 中，你可以输入 `How do you publish a post in Ayrshare. Use the MCP server.` 来测试 MCP 连接器。

<img src="https://mintcdn.com/ayrshare-docs/Nmrhj2Gh7WSf62Bh/images/additional/running-mcp.webp?fit=max&auto=format&n=Nmrhj2Gh7WSf62Bh&q=85&s=ed7d62f1a649cf531b6c3d1a1c2bc788" class="center" width="70%" data-path="images/additional/running-mcp.webp" />

你将看到「Run tool」的请求，Cursor 会通过 MCP 服务器获取响应。
