nika-is-nika-coupler-io

TotalClaw 作者 totalclaw

通过 Coupler.io 的 MCP 服务器进行只读数据访问。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~nika-is-nika-coupler-io
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~nika-is-nika-coupler-io/file -o nika-is-nika-coupler-io.md
## 概述(中文)

通过 Coupler.io 的 MCP 服务器进行只读数据访问。

## 技能正文

# Coupler.io

通过 Coupler.io 的 MCP 服务器进行只读数据访问。

**Author:** Coupler.io Team
**Homepage:** [coupler.io](https://coupler.io)

## 前提条件

- 已安装 [mcporter](https://github.com/openclaw/mcporter) CLI 并加入 PATH
- 拥有 Coupler.io 账户,且至少配置了一个指向 OpenClaw 目标的数据流(data flow)

## 快速参考

```bash
mcporter call mcp-coupler-io-mcp.list-dataflows
mcporter call mcp-coupler-io-mcp.get-dataflow dataflowId=<uuid>
mcporter call mcp-coupler-io-mcp.get-schema executionId=<exec-id>
mcporter call mcp-coupler-io-mcp.get-data executionId=<exec-id> query="SELECT * FROM data LIMIT 10"
```

---

## 连接设置

> **端点验证:** 此技能连接到 `auth.coupler.io`(OAuth)和 `mcp.coupler.io`(MCP 数据)。这些是 Coupler.io 的官方端点。你可以通过你的 Coupler.io 账户(AI integrations 页面)进行验证。

> **传输方式:** 此 MCP 使用 **streamable HTTP**,而非 SSE。如果你在输出中看到 "SSE error",请忽略这个误导性的标签——它实际上仍然是 HTTP。

### 1. 一步完成认证并添加服务器

**不要**先使用 `mcporter config add` 再单独执行 `mcporter auth`——这会创建一个不含认证元数据的配置项,并导致 401 循环。相反,请用一条命令完成全部操作:

```bash
mcporter auth --http-url https://mcp.coupler.io/mcp --persist config/mcporter.json
```

这会自动检测 OAuth,打开浏览器进行 Coupler.io 登录(PKCE 流程),并在成功后保存服务器定义和令牌。

如需重新认证或清除过期令牌:

```bash
mcporter auth --http-url https://mcp.coupler.io/mcp --persist config/mcporter.json --reset
```

### 2. 确保配置中包含 `"auth": "oauth"`

认证后,检查 `config/mcporter.json`。除非该配置项包含 `"auth": "oauth"`,否则 mcporter 不会使用缓存的令牌。它应该如下所示:

```json
{
  "mcpServers": {
    "mcp-coupler-io-mcp": {
      "baseUrl": "https://mcp.coupler.io/mcp",
      "auth": "oauth"
    }
  }
}
```

如果缺少 `"auth": "oauth"`,请手动添加。

### 3. 验证

```bash
mcporter list mcp-coupler-io-mcp
```

应返回 4 个工具:`get-data`、`get-schema`、`list-dataflows`、`get-dataflow`。

> **注意:** 服务器名称由 URL 自动生成为 `mcp-coupler-io-mcp`。在后续所有命令中均使用此名称。

---

## 令牌刷新

mcporter 会在出现 401 错误时自动处理令牌刷新。无需手动干预。

如果需要强制获取新令牌:`mcporter auth mcp-coupler-io-mcp --reset`

---

## MCP 工具

### list-dataflows

列出所有以 OpenClaw 为目标的数据流。

```bash
mcporter call mcp-coupler-io-mcp.list-dataflows --output json
```

### get-dataflow

获取数据流详情,包括 `lastSuccessfulExecutionId`。

```bash
mcporter call mcp-coupler-io-mcp.get-dataflow dataflowId=<uuid> --output json
```

### get-schema

获取列定义。列名位于 `columnName` 中(例如 `col_0`、`col_1`)。

```bash
mcporter call mcp-coupler-io-mcp.get-schema executionId=<exec-id>
```

### get-data

在数据流的数据上运行 SQL。表名始终为 `data`。

```bash
mcporter call mcp-coupler-io-mcp.get-data executionId=<exec-id> query="SELECT col_0, col_1 FROM data WHERE col_2 > 100 LIMIT 50"
```

**务必先采样**(`LIMIT 5`),在执行更大的查询前先了解数据结构。

---

## 典型工作流

```bash
# 1. List flows, find ID
mcporter call mcp-coupler-io-mcp.list-dataflows --output json

# 2. Get execution ID
mcporter call mcp-coupler-io-mcp.get-dataflow dataflowId=<id> --output json

# 3. Check schema
mcporter call mcp-coupler-io-mcp.get-schema executionId=<exec-id>

# 4. Query
mcporter call mcp-coupler-io-mcp.get-data executionId=<exec-id> query="SELECT * FROM data LIMIT 10"
```

---

## 约束

- 只读:无法修改数据流、数据源或数据
- 仅可见以 OpenClaw 为目标的数据流
- 令牌将在 2 小时后过期(mcporter 会自动刷新)