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

# 程序化使用文档

> 将 LangChain 文档连接到您的 AI 工具和流程

我们希望使我们的文档尽可能易于访问。我们提供了多种方法，让您通过 AI 助手、代码编辑器和直接集成（例如模型上下文协议 (MCP)）以编程方式使用这些文档。

## 快速访问选项

在我们文档的任何页面上，您都会在右上角找到一个上下文菜单下拉框：

<img className="block dark:hidden" src="https://mintcdn.com/hhh-8c10bf0c/1xJTbE4Z922F2hsr/images/copy-page-light.png?fit=max&auto=format&n=1xJTbE4Z922F2hsr&q=85&s=8f0d6e2785b9f7af7a327b14be47f361" alt="复制页面浅色模式" width="1584" height="942" data-path="images/copy-page-light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/hhh-8c10bf0c/1xJTbE4Z922F2hsr/images/copy-page-dark.png?fit=max&auto=format&n=1xJTbE4Z922F2hsr&q=85&s=6da550852da99cc44c285901a05c87c0" alt="复制页面深色模式" width="1578" height="942" data-path="images/copy-page-dark.png" />

这包括我们的 `llms.txt`、MCP 服务器连接以及其他快速访问选项，如 ChatGPT 和 Claude。

## 使用我们的 MCP 服务器

我们的文档包含一个内置的 **模型上下文协议 (MCP) 服务器**，允许 AI 应用程序实时查询最新文档。

LangChain 文档 MCP 服务器位于：

```txt theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
https://docs.langchain.com/mcp
```

连接后，您可以向 AI 助手询问有关 LangChain、LangGraph 和 LangSmith 的问题，它将搜索我们的文档以提供准确、最新的答案。

### 与 Claude Code 连接

如果您正在使用 Claude Code，请在终端中运行此命令以将服务器添加到当前项目：

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
claude mcp add --transport http docs-langchain https://docs.langchain.com/mcp
```

<Note>
  **项目（本地）范围**

  上述命令仅将 MCP 服务器添加到您当前的项目/工作目录。若要全局添加 MCP 服务器并在所有项目中访问它，请通过向命令添加 `--scope user` 来添加用户范围：

  ```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  claude mcp add --transport http docs-langchain --scope user https://docs.langchain.com/mcp
  ```
</Note>

### 与 Claude Desktop 连接

1. 打开 Claude Desktop
2. 转到设置 > 连接器
3. 添加我们的 MCP 服务器 URL：`https://docs.langchain.com/mcp`

### 与 Codex CLI 连接

如果您正在使用 OpenAI Codex CLI，请在终端中运行此命令以全局添加服务器：

```sh theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
codex mcp add langchain-docs --url https://docs.langchain.com/mcp
```

### 与 Cursor 连接

将以下内容添加到您的 MCP 设置配置文件中：

```json theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "mcpServers": {
    "docs-langchain": {
      "url": "https://docs.langchain.com/mcp"
    }
  }
}
```

### 与 VS Code 连接

将以下内容添加到您的 MCP 设置配置文件中：

```json theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "servers": {
    "docs-langchain": {
      "url": "https://docs.langchain.com/mcp"
    }
  }
}
```

### 与 Antigravity 连接

将以下内容添加到您的 MCP 设置配置文件中：

```json theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "mcpServers": {
    "docs-langchain": {
      "serverUrl": "https://docs.langchain.com/mcp"
    }
  }
}
```

## 了解更多

有关使用 Mintlify MCP 服务器的更多信息，请参阅 [官方 Mintlify 文档](https://www.mintlify.com/docs/ai/model-context-protocol)。

有问题或反馈吗？请在我们的 [社区论坛](https://forum.langchain.com/) 中告诉我们。

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\use-these-docs.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
