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

# APIXO MCP 故障排查：OAuth 认证与远程连接

> 排查 Codex、Claude Code 和 Cursor 连接 APIXO 远程 MCP 或通过浏览器完成 OAuth 认证时遇到的问题。

添加远程 MCP 连接，名称填 **`apixo-mcp`**，地址填 **`https://mcp.apixo.ai/mcp`**，传输方式选 **Streamable HTTP**。然后通过 **apixo.ai 的浏览器 OAuth** 登录。整个流程无需 Node.js 或 API 密钥。

## 浏览器 OAuth 未打开或完成

* 从客户端的 MCP 连接设置开始登录。Claude Code 使用 `/mcp`，Cursor 打开 **Cursor Settings → MCP**。如果使用的 Codex 版本支持登录命令，运行 `codex mcp login apixo-mcp`。
* 如果客户端显示登录链接，在浏览器中打开链接，登录 APIXO 并批准连接。
* 浏览器确认授权完成后，返回客户端。如有需要，刷新 MCP 连接。
* 如果登录已过期或登录失败，请从客户端重新发起 OAuth 登录。

## 远程连接返回 401

在客户端的 OAuth 设置中重新登录 `apixo-mcp`，并确认浏览器登录的是要使用的 APIXO 账户。排查远程 OAuth 连接时，请勿将 API 密钥粘贴到对话中。

## 客户端中没有列出工具

* 确认 URL 填写为 `https://mcp.apixo.ai/mcp`，传输方式为 Streamable HTTP。
* 确认已启用并登录 `apixo-mcp`。客户端须支持远程 MCP 和 OAuth。
* 更改配置后，请刷新连接或重新启动客户端。
* 查看客户端连接日志中是否有网络或身份验证错误，并确认当前网络能访问远程端点。
* 对于 Codex，使用以下命令检查注册情况：

  ```bash theme={null}
  codex mcp get apixo-mcp
  ```

连接后，使用 `list_models`、`get_model_schema` 和 `get_profile` 进行验证。这些是免费的只读工具。请参阅[安装](https://apixo.ai/docs/zh/integrations/mcp/installation.md#step-3-verify-with-free-tools)。

## 缺少 Chat 或 LLM 模型

检查混凝土 ID 是否在支持的模型列表中，并调用 `list_models` 且设置 `integration_type: llm_gateway`。如果远程连接早于 LLM 发现，请直接使用文档中的 API 或 SDK 配置。[支持的 LLM 模型](https://apixo.ai/docs/zh/llm/supported-models.md) · [官方 SDK](https://apixo.ai/docs/zh/llm/official-sdks.md)

## CLI 未在 PATH 中找到

**症状。** 步骤 1 的 [安装](https://apixo.ai/docs/zh/integrations/mcp/installation.md#step-1-add-the-remote-connection) 失败，Windows 系统出现 `codex : 无法将"codex"项识别为 cmdlet…`，macOS 或 Linux 系统出现 `command not found: codex`（或 `claude`）。

以下步骤以 Windows 上的 Codex 为例。对于 Claude Code，找到其安装目录，将其添加到 PATH 环境变量，然后打开一个新终端。

![PowerShell 提示找不到 Codex 命令](https://mintcdn.com/gravity-5d102d7e/20MVoji7DqRucvXD/images/integrations/mcp/installation/windows/troubleshoot-01-codex-not-found.png?fit=max\&auto=format\&n=20MVoji7DqRucvXD\&q=85\&s=2d88c98c5bc6e4366616d75266e1489c)

### 确认 Codex 已安装（Windows）

通过完整路径运行可执行文件。用户级 Codex 安装通常位于 `%LOCALAPPDATA%\OpenAI\Codex\bin`：

```powershell theme={null}
& "C:\Users\YOUR_USER\AppData\Local\OpenAI\Codex\bin\codex.exe" --version
```

若输出版本号，则说明二进制文件已安装，仅缺少 PATH 配置。

![使用完整路径检查 Codex](https://mintcdn.com/gravity-5d102d7e/20MVoji7DqRucvXD/images/integrations/mcp/installation/windows/troubleshoot-02-codex-fullpath-version.png?fit=max\&auto=format\&n=20MVoji7DqRucvXD\&q=85\&s=4ceb1ae193440b95ced6f394b589b4bb)

### 将 Codex bin 目录添加到用户的 PATH 环境变量（Windows）

```powershell theme={null}
$codexBin = "C:\Users\YOUR_USER\AppData\Local\OpenAI\Codex\bin"
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
if ($userPath -notlike "*$codexBin*") {
  [Environment]::SetEnvironmentVariable('Path', "$userPath;$codexBin", 'User')
}
```

![将 Codex 的 bin 目录添加到 PATH](https://mintcdn.com/gravity-5d102d7e/20MVoji7DqRucvXD/images/integrations/mcp/installation/windows/troubleshoot-03-add-codex-path.png?fit=max\&auto=format\&n=20MVoji7DqRucvXD\&q=85\&s=1f8f4f4b9171ed0e5e432b75d1b33ed6)

关闭终端，打开一个新终端，并验证：

```powershell theme={null}
codex --version
```

![在新的终端窗口验证 Codex](https://mintcdn.com/gravity-5d102d7e/20MVoji7DqRucvXD/images/integrations/mcp/installation/windows/troubleshoot-04-new-terminal-version.png?fit=max\&auto=format\&n=20MVoji7DqRucvXD\&q=85\&s=b33fa9a0f4eaccae6c72a222ef3bff86)

然后重复[步骤1](https://apixo.ai/docs/zh/integrations/mcp/installation.md#step-1-add-the-remote-connection)。

## 从旧的本地包迁移

如果您的客户端仍通过 `npx` 运行 `@apixo/mcp-server`，该软件包已不再推荐使用。

1. 从客户端的 MCP 配置中移除该条目。
2. 按照[安装](https://apixo.ai/docs/zh/integrations/mcp/installation.md)添加远程连接。
3. 更新任何已保存的提示或脚本，以使用 [远程工具名称](https://apixo.ai/docs/zh/integrations/mcp#tools-exposed-by-the-remote-connection)，例如 `list_models` 而不是 `apixo_list_models`。
4. 如不再使用这把 MCP 设备密钥，请到[控制台的 API Keys 页面](https://apixo.ai/dashboard/api-keys)撤销。只删除本地凭证文件，密钥仍然有效。

远程连接不包含批处理工具，需使用 [批次 API](https://apixo.ai/docs/zh/api-reference/batch-generate.md) 来处理批处理工作流。

## 仍不清楚吗？

重新阅读[安装](https://apixo.ai/docs/zh/integrations/mcp/installation.md)并确认您可以在浏览器中登录APIXO。请联系 [APIXO 支持](https://apixo.ai/dashboard)，提供您的客户端名称、版本和相关连接错误。切勿包含 API 密钥、OAuth 令牌或凭证文件内容。


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