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

# ClickSend集成

> 通过 ClickSend 的通信平台，从 LangChain 智能体发送短信、电子邮件和语音消息。

[ClickSend](https://www.clicksend.com/) 是一个基于云的通信平台，使开发者能够通过统一的 API 发送短信、电子邮件、语音、传真和邮政消息。

## 概述

### 集成详情

| 类 | 包 | 可序列化 | [Python 支持](https://langchain-docs-zh.mintlify.site/langchain/oss/javascript/integrations/tools/clicksend.md) | 版本 |
| :- | :- | :-: | :-: | :-: |
| `ClickSendTools` | [@clicksend/langchain-clicksend-mcp](https://www.npmjs.com/package/@clicksend/langchain-clicksend-mcp) | ❌ | ❌ | ![npm 版本](https://img.shields.io/npm/v/@clicksend/langchain-clicksend-mcp?style=flat-square\&label=%20) |

### 工具功能

* **短信消息**：向全球手机号码发送文本消息
* **电子邮件**：发送事务性电子邮件和营销电子邮件
* **语音**：发送自动语音消息和电话
* **MCP 集成**：通过模型上下文协议连接，实现无缝智能体集成

## 设置

集成位于 `@clicksend/langchain-clicksend-mcp` 包中。

```bash theme={null}
npm install @clicksend/langchain-clicksend-mcp
```

### 凭证

您需要一个带有 API 凭证的 ClickSend 账户。在 [clicksend.com](https://www.clicksend.com/) 注册以获取您的用户名和 API 密钥。

```typescript Set credentials theme={null}
import dotenv from 'dotenv';
dotenv.config();
```

## 实例化

通过连接到 ClickSend MCP 服务器来初始化 ClickSend 工具：

```typescript Initialize ClickSend theme={null}
import { ClickSendTools } from "@clicksend/langchain-clicksend-mcp";

const tools = await ClickSendTools.fromHTTP({
  url: "https://mcp.clicksend.com",
  username: process.env.CLICKSEND_USERNAME,
  apiKey: process.env.CLICKSEND_API_KEY,
});

console.log(`Loaded ${tools.length} ClickSend tools`);
```

## 调用

在您的 LangChain 智能体中使用工具发送通信：

```typescript Use with an agent theme={null}
import { ChatOpenAI } from "@langchain/openai";
import { createAgent } from "langchain";

// Create agent with tools
const agent = await createAgent({
  model: new ChatOpenAI({ 
    model: "gpt-4o-mini",
    temperature: 0 
  }),
  tools,
});

// Use the agent
const result = await agent.invoke({
  messages: [
    { role: "user", content: "Send an SMS to +1234567890 saying 'Hello from LangChain!'" },
  ],
});

console.log(result);
```

## API 参考

有关所有功能和配置的详细文档，请参阅 [API 参考](https://www.npmjs.com/package/@clicksend/langchain-clicksend-mcp)。

有关 ClickSend 服务和定价的更多信息，请访问 [clicksend.com](https://www.clicksend.com/)。

***

> 官方原文：[src/oss/javascript/integrations/tools/clicksend.mdx](https://github.com/langchain-ai/docs/blob/main/src/oss/javascript/integrations/tools/clicksend.mdx) · 非官方翻译，译文由 AI 生成，以英文原文为准。


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