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

# Cursor

> 将 miniDesk 连接到 Cursor 及其他编辑器。

当您希望在修复 bug 时，把报告该 bug 的会话放在眼前，这个功能很有用。

## 先获取 Token

在仪表板中，前往 **Settings → MCP** 并创建一个凭证。

## Cursor

**1. 打开 MCP 设置**

**Settings → Cursor Settings → MCP → Add new global MCP server**。这会打开 `~/.cursor/mcp.json`。

**2. 添加服务器**

```json theme={null}
{
  "mcpServers": {
    "minidesk": {
      "url": "https://api.minidesk.ai/mcp",
      "headers": {
        "Authorization": "Bearer mdsk_mcp_YOUR_TOKEN"
      }
    }
  }
}
```

**3. 确认状态为绿色**

回到 MCP 设置，`minidesk` 应显示为已连接，并列出其工具。如果没有，请点击刷新。

如果只想用于单个项目，请改为将相同的 JSON 放入仓库根目录的 `.mcp.json`。

> [!WARNING]
>
> 项目级的 `.mcp.json` 包含有效 Token。提交任何内容之前，请先将其加入 `.gitignore`。

## VS Code

将其添加到 `.vscode/mcp.json`：

```json theme={null}
{
  "servers": {
    "minidesk": {
      "type": "http",
      "url": "https://api.minidesk.ai/mcp",
      "headers": {
        "Authorization": "Bearer mdsk_mcp_YOUR_TOKEN"
      }
    }
  }
}
```

然后在 Copilot Chat 中选择 **Agent** 模式，工具即可使用。

## 试一试

> 读取工单 ACME-1042，告诉我哪个文件最可能是问题所在。

> 本周客户反馈最多的问题是什么？

> 为 ACME-1042 起草一条回复，说明修复将于明天发布。

## 让 Token 不进入 git

两个编辑器都支持在配置值中读取环境变量，因此可以将密钥排除在文件之外：

```json theme={null}
{
  "mcpServers": {
    "minidesk": {
      "url": "https://api.minidesk.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${env:MINIDESK_MCP_TOKEN}"
      }
    }
  }
}
```

然后在 shell 配置文件中导出 `MINIDESK_MCP_TOKEN`。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.