Skip to main content
Glama
PipesHub MCP Server

PipesHub MCP Server

Official

将 MCP 客户端连接到 PipesHub MCP 服务器

本指南介绍如何使用静态 OAuth 凭据或 Bearer 令牌,将 PipesHub 的远程 MCP 服务器连接到 Cursor、Claude Code、Gemini CLI、Codex CLI、Claude.ai(网页版) 和 LibreChat。

PipesHub 通过 Streamable HTTP 在 /mcp 端点暴露远程 MCP 服务。MCP 客户端直接连接到此端点——无需本地 npm 包或 stdio 进程。

正在使用编码代理? 请从面向编码代理开始。使用 npx skills add pipeshub-ai/mcp-server 将技能安装到用户的仓库中(参见 skills/pipeshub)。在本仓库中工作的贡献者:请阅读 AGENTS.md。

正在查找工具参考? 请参阅 TOOLS.md,了解 MCP 服务器暴露的每个工具(pipeshub_chat、pipeshub_search、pipeshub_get_record_content、pipeshub_download_record、pipeshub_directory、pipeshub_sources、pipeshub_agents)的描述、参数和决策指南。

正在使用 QM? QM 无法挂载第三方 MCP 端点——它是其自身框架的 MCP 服务器,而非客户端。请按照将 PipesHub 与 QM 结合使用操作。qm/ 中的部署层捆绑包为代理在其沙箱内提供了 pipeshub 命令;此包将该命令作为第二个 bin 发布。

前置条件

  • 一个正在运行的 PipesHub 实例(自托管或云端)

  • 在 PipesHub 中创建的 OAuth 应用(参见步骤 1)

Related MCP server: ai-assistant

步骤 1:在 PipesHub 中创建 OAuth 应用

  1. 以管理员身份登录你的 PipesHub 实例

  2. 导航到 设置 > 开发者设置 > OAuth 应用

  3. 点击 创建 OAuth 应用

  4. 填写应用详情:

    • 名称:例如 MCP Integration

    • 重定向 URI:添加你计划使用的所有客户端的重定向 URI:

      客户端

      重定向 URI

      Cursor

      cursor://anysphere.cursor-mcp/oauth/callback

      Claude Code

      http://localhost:<PORT>/callback(例如 http://localhost:8080/callback)

      Claude.ai(网页版)

      https://claude.ai/api/mcp/auth_callback

      Gemini CLI

      http://localhost:7777/oauth/callback

      LibreChat

      http://localhost:3080/api/mcp/<server-identifier>/oauth/callback

重要提示:MCP_SCOPES 中的作用域必须与你授予 OAuth 应用的作用域匹配——不匹配将导致授权错误。

  1. 保存应用并复制 客户端 ID 和 客户端密钥

自定义默认作用域

默认情况下,PipesHub 在其 /.well-known/oauth-protected-resource/mcp 发现端点中暴露一些默认作用域。你可以通过在你的 PipesHub 实例上设置 MCP_SCOPES 环境变量来自定义暴露哪些作用域。这对于像 Claude Code 这样会自动请求所有暴露作用域的客户端非常有用。

占位符

在以下所有配置中替换这些内容:

占位符

描述

示例

PIPESHUB_INSTANCE_URL

你的 PipesHub 实例 URL

https://app.pipeshub.com

YOUR_CLIENT_ID

OAuth 应用客户端 ID

clid_abc123...

YOUR_CLIENT_SECRET

OAuth 应用客户端密钥

clsec_xyz789...

远程 MCP 端点 URL 为:PIPESHUB_INSTANCE_URL/mcp


远程 MCP 设置

Cursor 通过 mcp.json 中的 auth 对象支持远程 MCP 服务器的静态 OAuth。

配置

打开 Cursor 设置 > 工具与集成 > 新建 MCP 服务器,或编辑你项目的 .cursor/mcp.json:

{
  "mcpServers": {
    "pipeshub": {
      "url": "PIPESHUB_INSTANCE_URL/mcp",
      "auth": {
        "CLIENT_ID": "YOUR_CLIENT_ID",
        "CLIENT_SECRET": "YOUR_CLIENT_SECRET",
        "scopes": [
          "org:read", "org:write", "org:admin",
          "user:read", "user:write", "user:invite", "user:delete",
          "usergroup:read", "usergroup:write",
          "team:read", "team:write",
          "kb:read", "kb:write", "kb:delete", "kb:upload",
          "semantic:read", "semantic:write", "semantic:delete",
          "conversation:read", "conversation:write", "conversation:chat",
          "agent:read", "agent:write", "agent:execute",
          "connector:read", "connector:write", "connector:sync", "connector:delete",
          "config:read", "config:write",
          "document:read", "document:write", "document:delete",
          "crawl:read", "crawl:write", "crawl:delete"
        ]
      }
    }
  }
}

Cursor 将通过 PipesHub 的 /.well-known/oauth-protected-resource/mcp 元数据自动发现授权端点和令牌端点。

注意: 如果省略 scopes 字段,Cursor 会获取 /.well-known/oauth-protected-resource/mcp 并请求其中列出的所有 scopes_supported。要限制访问范围,请仅显式列出你需要的范围。你还可以在服务端控制暴露哪些作用域——参见自定义默认作用域。

使用环境变量

使用 Cursor 的 ${env:VAR} 插值将密钥保留在配置文件之外:

{
  "mcpServers": {
    "pipeshub": {
      "url": "${env:PIPESHUB_INSTANCE_URL}/mcp",
      "auth": {
        "CLIENT_ID": "${env:PIPESHUB_CLIENT_ID}",
        "CLIENT_SECRET": "${env:PIPESHUB_CLIENT_SECRET}",
        "scopes": [
          "kb:read", "kb:write",
          "semantic:read", "semantic:write",
          "conversation:read", "conversation:write", "conversation:chat",
          "agent:read", "agent:write", "agent:execute",
          "connector:read", "connector:write",
          "config:read", "user:read"
        ]
      }
    }
  }
}

重定向 URI

Cursor 对所有 MCP 服务器使用固定的重定向 URI:

cursor://anysphere.cursor-mcp/oauth/callback

在 PipesHub 中创建 OAuth 应用时,将此注册为允许的重定向 URI。

OAuth 登录故障排除

如果 Cursor 的内部浏览器无法加载 OAuth 登录页面,请从内部浏览器复制授权 URL,粘贴到你的常规浏览器中完成登录流程。

Claude Code 通过 --client-id、--client-secret 和 --callback-port 支持带有静态 OAuth 凭据的远程 HTTP MCP 服务器。

PipesHub 在 /.well-known/oauth-protected-resource/mcp 暴露发现端点,因此 Claude Code 会自动发现授权端点和令牌端点。

重要提示: Claude Code 不支持配置特定作用域。它会获取 /.well-known/oauth-protected-resource/mcp,读取 scopes_supported 列表,并请求所有作用域。你在 PipesHub 中的 OAuth 应用必须有权访问发现端点中列出的所有作用域,否则授权请求将失败。要限制暴露的作用域,请参见自定义默认作用域。

使用 CLI 添加

claude mcp add --transport http \
  --client-id YOUR_CLIENT_ID \
  --client-secret \
  --callback-port 8080 \
  pipeshub PIPESHUB_INSTANCE_URL/mcp

不带值的 --client-secret 会提示输入掩码。要跳过提示,请设置 MCP_CLIENT_SECRET 环境变量:

MCP_CLIENT_SECRET=YOUR_CLIENT_SECRET claude mcp add --transport http \
  --client-id YOUR_CLIENT_ID \
  --client-secret \
  --callback-port 8080 \
  pipeshub PIPESHUB_INSTANCE_URL/mcp

要使其在所有项目中可用:

claude mcp add --transport http --scope user \
  --client-id YOUR_CLIENT_ID \
  --client-secret \
  --callback-port 8080 \
  pipeshub PIPESHUB_INSTANCE_URL/mcp

使用 JSON 添加

claude mcp add-json pipeshub '{
  "type": "http",
  "url": "PIPESHUB_INSTANCE_URL/mcp",
  "oauth": {
    "clientId": "YOUR_CLIENT_ID",
    "callbackPort": 8080
  }
}' --client-secret

项目级作用域(.mcp.json)

在项目根目录创建 .mcp.json 文件。此文件可以提交到版本控制(密钥通过环境变量保持在外):

{
  "mcpServers": {
    "pipeshub": {
      "type": "http",
      "url": "${PIPESHUB_INSTANCE_URL}/mcp",
      "oauth": {
        "clientId": "${PIPESHUB_CLIENT_ID}",
        "callbackPort": 8080
      }
    }
  }
}

在启动 Claude Code 之前设置环境变量:

export PIPESHUB_INSTANCE_URL="https://app.pipeshub.com"
export PIPESHUB_CLIENT_ID="your-client-id"

注意: 客户端密钥存储在系统钥匙串中,而非配置文件中。首次通过 /mcp 进行身份验证时,系统会提示你输入。

身份验证

添加服务器后,在 Claude Code 中运行 /mcp 并按照浏览器登录流程操作。令牌会安全存储并自动刷新。

验证

claude mcp list
claude mcp get pipeshub

Gemini CLI 通过 dynamic_discovery(默认)支持带有 OAuth 的远程 MCP 服务器,该模式会从 PipesHub 的 /.well-known/oauth-protected-resource/mcp 自动发现授权端点和令牌端点。

选项 A:设置文件

编辑 ~/.gemini/settings.json:

{
  "mcpServers": {
    "pipeshub": {
      "url": "PIPESHUB_INSTANCE_URL/mcp",
      "oauth": {
        "clientId": "YOUR_CLIENT_ID",
        "clientSecret": "YOUR_CLIENT_SECRET",
        "scopes": [
          "org:read", "org:write", "org:admin",
          "user:read", "user:write", "user:invite", "user:delete",
          "usergroup:read", "usergroup:write",
          "team:read", "team:write",
          "kb:read", "kb:write", "kb:delete", "kb:upload",
          "semantic:read", "semantic:write", "semantic:delete",
          "conversation:read", "conversation:write", "conversation:chat",
          "agent:read", "agent:write", "agent:execute",
          "connector:read", "connector:write", "connector:sync", "connector:delete",
          "config:read", "config:write",
          "document:read", "document:write", "document:delete",
          "crawl:read", "crawl:write", "crawl:delete"
        ]
      }
    }
  }
}

注意: 调整 scopes 列表以匹配你的 OAuth 应用被授予的作用域。如果你只需要一部分工具,可以相应地限制作用域。

选项 B:CLI 命令

gemini mcp add --transport http pipeshub PIPESHUB_INSTANCE_URL/mcp

然后编辑 ~/.gemini/settings.json,按上述方式添加 oauth 块。

身份验证

在 Gemini CLI 内部,使用 /mcp auth 命令:

# List servers and their auth status
/mcp auth

# Authenticate with PipesHub (opens browser for login)
/mcp auth pipeshub

# Re-authenticate if tokens expire
/mcp auth pipeshub

首次连接时,Gemini 会自动检测 401 响应、发现 OAuth 端点并打开浏览器进行登录。令牌安全存储在 ~/.gemini/mcp-oauth-tokens.json 中并自动刷新。

管理服务器

# List all configured servers
gemini mcp list

# Remove the server
gemini mcp remove pipeshub

# Temporarily disable/enable
gemini mcp disable pipeshub
gemini mcp enable pipeshub

OAuth 配置属性

属性

必需

描述

clientId

是

来自 PipesHub 的 OAuth 2.0 客户端 ID

clientSecret

否

OAuth 2.0 客户端密钥(用于机密客户端)

scopes

否

要请求的 OAuth 作用域

authorizationUrl

否

覆盖授权端点(默认自动发现)

tokenUrl

否

覆盖令牌端点(默认自动发现)

redirectUri

否

覆盖重定向 URI(默认为 http://localhost:7777/oauth/callback)

注意: OAuth 需要本地浏览器。在无头环境、没有 X11 转发的远程 SSH 或没有浏览器访问权限的容器中无法工作。

Codex CLI(OpenAI Codex)通过 Streamable HTTP 连接远程 MCP 服务器,在 ~/.codex/config.toml(或项目根目录下的 .codex/config.toml 以限定项目范围)中配置 [mcp_servers.<name>] 表。Codex 的 HTTP 传输使用从环境变量读取的 bearer 令牌 进行身份验证,因此请传入 PipesHub JWT bearer 令牌。

[mcp_servers.pipeshub]
url = "PIPESHUB_INSTANCE_URL/mcp"
bearer_token_env_var = "PIPESHUB_BEARER_TOKEN"

bearer_token_env_var 是保存令牌的环境变量的名称——在启动 Codex 之前导出它:

export PIPESHUB_BEARER_TOKEN="YOUR_BEARER_TOKEN"

令牌是原始 JWT,不带 Bearer 关键字。

或者使用 CLI 添加:

codex mcp add pipeshub \
  --url PIPESHUB_INSTANCE_URL/mcp \
  --bearer-token-env-var PIPESHUB_BEARER_TOKEN

--bearer-token-env-var 接受保存令牌的环境变量的名称,而非令牌值本身。

验证

# List configured MCP servers
codex mcp list

# Inside the Codex TUI, view server status and available tools
/mcp

Claude.ai 通过远程 MCP 服务器支持自定义连接器。这让你无需任何本地设置即可直接在 Claude.ai 网页界面中使用 PipesHub 工具。

注意: 此功能目前处于测试阶段。免费计划用户仅限于一个自定义连接器。

Claude.ai 连接器设置

Claude.ai 添加自定义连接器对话框

对于个人用户(Pro / Max 计划)

  1. 前往 claude.ai 并导航到 设置 > 连接器

  2. 点击连接器部分底部的 添加自定义连接器

  3. 输入 MCP 服务器 URL:

    PIPESHUB_INSTANCE_URL/mcp
  4. 点击 高级设置 并输入你的 OAuth 凭据:

    • OAuth 客户端 ID:YOUR_CLIENT_ID

    • OAuth 客户端密钥:YOUR_CLIENT_SECRET

  5. 点击 添加

  6. 你将被重定向到 PipesHub 的登录页面进行身份验证并授予权限

  7. 身份验证完成后,连接器将处于活动状态,PipesHub 工具将在你的 Claude.ai 对话中可用

对于团队 / 企业计划

组织所有者必须首先添加连接器:

  1. 导航到 组织设置 > 连接器

  2. 点击 添加自定义连接器

  3. 输入 MCP 服务器 URL:PIPESHUB_INSTANCE_URL/mcp

  4. 点击 高级设置 并输入 OAuth 客户端 ID 和客户端密钥

  5. 点击 添加

团队成员随后可以连接:

  1. 前往 设置 > 连接器

  2. 找到 PipesHub 连接器(标有"自定义"标签)

  3. 点击 连接 通过 PipesHub 的 OAuth 登录进行身份验证

重定向 URI

Claude.ai 使用以下重定向 URI 进行 OAuth:

https://claude.ai/api/mcp/auth_callback

在你的 PipesHub OAuth 应用中将其注册为允许的重定向 URI。

安全说明

  • 仅连接到受信任的 MCP 服务器

  • 在 OAuth 身份验证流程中审查请求的权限

  • Claude.ai 使用授予的 OAuth 令牌代表你与 PipesHub 交互——你的密码永远不会被共享

LibreChat 通过其自定义连接器 UI 支持带有 OAuth 身份验证的远程 MCP 服务器。这让你可以将 PipesHub 工具连接到 LibreChat 实例中可用的任何模型。

LibreChat MCP 配置

配置

将以下英文文本翻译成中文:

  1. 登录你的 LibreChat 实例

  2. 导航到 MCP 服务器 设置面板

  3. 点击 添加 创建新的自定义 MCP 连接器

  4. 填写连接器详细信息:

    • 名称:PipesHub(或你喜欢的任何名称)

    • MCP 服务器 URL:PIPESHUB_INSTANCE_URL/mcp

    • 传输方式:选择 Streamable HTTP

    • 认证方式:选择 OAuth

  5. 输入你的 OAuth 凭据:

    • 客户端 ID:YOUR_CLIENT_ID

    • 客户端密钥:YOUR_CLIENT_SECRET

    • 授权 URL:PIPESHUB_INSTANCE_URL/api/v1/oauth2/authorize

    • 令牌 URL:PIPESHUB_INSTANCE_URL/api/v1/oauth2/token

    • 作用域:openid email(或根据需要添加其他作用域)

  6. 勾选 我信任此应用程序

  7. 点击 添加 保存连接器

  8. 添加后,LibreChat 会生成一个 重定向 URI,显示在连接器设置面板中(复制按钮旁边)。其格式如下:

    http://localhost:3080/api/mcp/<server-identifier>/oauth/callback
  9. 复制重定向 URI,并在你的 PipesHub OAuth 应用中将其注册为允许的重定向 URI(参见第 1 步)

  10. 返回 LibreChat 连接器,点击 更新 启动 OAuth 流程——你将被重定向到 PipesHub 的登录页面进行身份验证并授予权限

重定向 URI

LibreChat 会在 连接器创建后 生成重定向 URI。其格式如下:

http://localhost:3080/api/mcp/<server-identifier>/oauth/callback

其中 <server-identifier> 是 LibreChat 分配的唯一标识符(显示在连接器设置顶部的"唯一服务器标识符"处)。你必须复制此 URI 并添加到 PipesHub OAuth 应用的允许重定向 URI 列表中,然后 才能进行身份验证。

注意: 如果你的 LibreChat 实例运行在不同的主机或端口上,URI 会相应变化(例如 https://chat.example.com/api/mcp/pipeshub/oauth/callback)。

作用域

LibreChat 允许你在 作用域 字段中指定 OAuth 作用域。使用空格分隔的列表:

openid email

要请求 PipesHub 特定的作用域,请将其添加到作用域字段中:

openid email org:read kb:read kb:write semantic:read conversation:read conversation:write conversation:chat agent:read agent:execute

注意: 你请求的作用域必须与 PipesHub 中授予 OAuth 应用的作用域一致。详见自定义默认作用域。


本地 MCP 服务器(Stdio)

如果你不想连接 PipesHub 的远程 MCP 端点,也可以使用 @pipeshub-ai/mcp npm 包将 MCP 服务器作为本地 stdio 进程运行。当你更倾向于本地设置,或需要在无法直接通过 HTTP 连接远程 MCP 端点的环境中工作时,这种方式非常有用。

前提条件

  • 已安装 Node.js 18+

  • PipesHub 实例 URL

  • 认证凭据:Bearer 令牌(JWT)或 OAuth 客户端 ID + 客户端密钥

占位符

在以下所有配置中替换这些占位符:

占位符

描述

示例

PIPESHUB_INSTANCE_URL

你的 PipesHub 实例 URL

https://app.pipeshub.com

YOUR_BEARER_TOKEN

用于认证的 JWT Bearer 令牌

eyJhbGci...

YOUR_CLIENT_ID

OAuth 应用客户端 ID

clid_abc123...

YOUR_CLIENT_SECRET

OAuth 应用客户端密钥

clsec_xyz789...

在 Claude Desktop 设置中配置(claude_desktop_config.json):

{
  "mcpServers": {
    "pipeshub": {
      "command": "npx",
      "args": [
        "@pipeshub-ai/mcp",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--bearer-auth",
        "YOUR_BEARER_TOKEN"
      ]
    }
  }
}

使用 OAuth 凭据:

{
  "mcpServers": {
    "pipeshub": {
      "command": "npx",
      "args": [
        "@pipeshub-ai/mcp",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--client-id",
        "YOUR_CLIENT_ID",
        "--client-secret",
        "YOUR_CLIENT_SECRET",
        "--token-url",
        "/api/v1/oauth2/token"
      ]
    }
  }
}

打开 Cursor 设置 > 工具与集成 > 新建 MCP 服务器,或编辑项目中的 .cursor/mcp.json:

{
  "mcpServers": {
    "pipeshub": {
      "command": "npx",
      "args": [
        "@pipeshub-ai/mcp",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--bearer-auth",
        "YOUR_BEARER_TOKEN"
      ]
    }
  }
}

使用 OAuth 凭据:

{
  "mcpServers": {
    "pipeshub": {
      "command": "npx",
      "args": [
        "@pipeshub-ai/mcp",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--client-id",
        "YOUR_CLIENT_ID",
        "--client-secret",
        "YOUR_CLIENT_SECRET",
        "--token-url",
        "/api/v1/oauth2/token"
      ]
    }
  }
}
claude mcp add pipeshub -- npx -y @pipeshub-ai/mcp start \
  --server-url PIPESHUB_INSTANCE_URL \
  --bearer-auth YOUR_BEARER_TOKEN

使用 OAuth 凭据:

claude mcp add pipeshub -- npx -y @pipeshub-ai/mcp start \
  --server-url PIPESHUB_INSTANCE_URL \
  --client-id YOUR_CLIENT_ID \
  --client-secret YOUR_CLIENT_SECRET \
  --token-url /api/v1/oauth2/token
gemini mcp add pipeshub -- npx -y @pipeshub-ai/mcp start \
  --server-url PIPESHUB_INSTANCE_URL \
  --bearer-auth YOUR_BEARER_TOKEN

使用 OAuth 凭据:

gemini mcp add pipeshub -- npx -y @pipeshub-ai/mcp start \
  --server-url PIPESHUB_INSTANCE_URL \
  --client-id YOUR_CLIENT_ID \
  --client-secret YOUR_CLIENT_SECRET \
  --token-url /api/v1/oauth2/token

将 MCP 服务器作为本地 stdio 进程运行,使用 OAuth 应用的客户端 ID 和客户端密钥进行认证(client_credentials 授权方式)。编辑 ~/.codex/config.toml(或项目根目录下的 .codex/config.toml):

[mcp_servers.pipeshub]
command = "npx"
args = [
  "-y",
  "@pipeshub-ai/mcp",
  "start",
  "--server-url",
  "PIPESHUB_INSTANCE_URL/api/v1",
  "--client-id",
  "YOUR_CLIENT_ID",
  "--client-secret",
  "YOUR_CLIENT_SECRET",
  "--token-url",
  "/api/v1/oauth2/token",
]

注意事项:

  • --server-url 必须包含 /api/v1。

  • --token-url /api/v1/oauth2/token 是必需的。

或者使用 JWT Bearer 令牌进行认证:

[mcp_servers.pipeshub]
command = "npx"
args = [
  "-y",
  "@pipeshub-ai/mcp",
  "start",
  "--server-url",
  "PIPESHUB_INSTANCE_URL/api/v1",
  "--bearer-auth",
  "YOUR_BEARER_TOKEN",
]

打开命令面板 > MCP: 打开用户配置,然后添加:

{
  "mcpServers": {
    "pipeshub": {
      "command": "npx",
      "args": [
        "@pipeshub-ai/mcp",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--bearer-auth",
        "YOUR_BEARER_TOKEN"
      ]
    }
  }
}

打开 Windsurf 设置 > Cascade > 管理 MCP > 查看原始配置,然后添加:

{
  "mcpServers": {
    "pipeshub": {
      "command": "npx",
      "args": [
        "@pipeshub-ai/mcp",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--bearer-auth",
        "YOUR_BEARER_TOKEN"
      ]
    }
  }
}

要从克隆的仓库而不是 npm 包运行本地 MCP 服务器:

git clone https://github.com/pipeshub-ai/pipeshub-ai.git
cd pipeshub-ai
npm install
npm run build
node ./bin/mcp-server.js start --server-url PIPESHUB_INSTANCE_URL --bearer-auth YOUR_BEARER_TOKEN

对于 MCP 客户端配置,将 npx @pipeshub-ai/mcp 替换为 node ./bin/mcp-server.js:

{
  "mcpServers": {
    "pipeshub": {
      "command": "node",
      "args": [
        "./bin/mcp-server.js",
        "start",
        "--server-url",
        "PIPESHUB_INSTANCE_URL",
        "--bearer-auth",
        "YOUR_BEARER_TOKEN"
      ]
    }
  }
}

使用 MCP Inspector 进行调试:

npx @modelcontextprotocol/inspector node ./bin/mcp-server.js start --server-url PIPESHUB_INSTANCE_URL --bearer-auth YOUR_BEARER_TOKEN

CLI 帮助

查看完整的服务器参数列表:

npx @pipeshub-ai/mcp --help

工作原理

架构

AI Client (Cursor / Claude Code / Gemini CLI / Codex CLI / Claude.ai / LibreChat)
        │
        │  HTTP POST (JSON-RPC)
        │  Authorization: Bearer <token>
        ▼
  PIPESHUB_INSTANCE_URL/mcp
        │
        │  StreamableHTTP Transport
        │  (stateless, per-request MCP server)
        ▼
  PipesHub API (curated tool set — see TOOLS.md)

OAuth 受保护资源发现

PipesHub 在以下地址暴露 OAuth 受保护资源发现:

PIPESHUB_INSTANCE_URL/.well-known/oauth-protected-resource/mcp

这将自动返回所有 OAuth 端点:

  • 授权:PIPESHUB_INSTANCE_URL/api/v1/oauth2/authorize

  • 令牌:PIPESHUB_INSTANCE_URL/api/v1/oauth2/token

  • 撤销:PIPESHUB_INSTANCE_URL/api/v1/oauth2/revoke

  • JWKS:PIPESHUB_INSTANCE_URL/.well-known/jwks.json


故障排除

"不兼容的认证服务器:不支持动态客户端注册"

这意味着客户端正在尝试动态注册,而不是使用你预先配置的凭据。请确保你正确传递了 --client-id 和 --client-secret(Claude Code)或 auth 对象(Cursor)。

认证失败 / 重定向错误

  • 确保 OAuth 应用中的 重定向 URI 与客户端使用的完全匹配:

    • Cursor:cursor://anysphere.cursor-mcp/oauth/callback

    • Claude Code:http://localhost:<callbackPort>/callback

    • Claude.ai:https://claude.ai/api/mcp/auth_callback

    • Gemini CLI:http://localhost:7777/oauth/callback

    • LibreChat:http://localhost:3080/api/mcp/<server-identifier>/oauth/callback

  • 确保 OAuth 应用在 PipesHub 中处于 活跃 状态(未被暂停)

无法访问 MCP 端点

  • 验证端点是否可访问:curl -X POST PIPESHUB_INSTANCE_URL/mcp(应返回 401,而不是连接错误)

  • 检查你的 PipesHub 实例是否已启用 MCP

使用 MCP Inspector 调试

npx @modelcontextprotocol/inspector

然后使用 Bearer 令牌连接到 PIPESHUB_INSTANCE_URL/mcp,直接测试端点。


常见问题

  1. 更新 PipesHub 实例上的 MCP_SCOPES 环境变量,以包含你希望通过发现端点暴露的新作用域。

  2. 更新 PipesHub 中的 OAuth 应用作用域:前往 设置 > 开发者设置 > OAuth 应用,选择你的 OAuth 应用,根据需要添加或删除作用域。

  3. 重新认证客户端——现有令牌携带的是旧作用域,因此你需要重新认证才能获得具有更新作用域的新令牌。例如:

    • Cursor:移除并重新添加 MCP 服务器,或清除缓存的 OAuth 令牌后重新连接。

    • Claude Code:运行 /mcp 并再次完成浏览器登录流程。

    • Gemini CLI:运行 /mcp auth pipeshub 重新认证。

    • Codex CLI:使用新令牌更新 PIPESHUB_BEARER_TOKEN 并重启 Codex。

    • Claude.ai:在 设置 > 连接器 中断开并重新连接连接器。

Available Tools

7 tools
pipeshub_agentsA
Read-onlyIdempotent

List the PipesHub agents configured for this org, each with its capabilities.

Agents are specialized assistants (custom system prompt, tools, knowledge scope). To converse with one, take its agentId and pass it to pipeshub_chat's agentId argument.

Each agent is returned as: { agentId, name, description, systemPrompt, startMessage, tags, webSearch, isActive, toolsets, knowledge }.

  • toolsets — what the agent can DO: each { name, tools } where name is the connector (e.g. jira, gmail) and tools are the runnable tool ids (e.g. jira.create_issue, gmail.send_email).

  • knowledge — what the agent can READ: each { name, type } (e.g. Confluence-2 / Confluence).

Route on toolsets/knowledge, not the name — names and descriptions are often generic or misleading. Match the request to the agent whose tools can actually perform it (e.g. "create a Jira ticket" → the agent whose toolset is jira and whose tools include jira.create_issue). If NO agent has a tool for the requested action, say so — don't force an unrelated agent.

The list may be empty (no agents configured). For plain Q&A when no specific agent is needed, use pipeshub_chat WITHOUT agentId and pick a chatMode: internal_search (org's indexed knowledge) or web_search (live web). Use agentId everywhere an agent is referenced.

Inputs: search.

pipeshub_chatA

Ask a question, get an answer grounded in the org's indexed data with citations. It reads a few retrieved passages — never a whole document, never a complete list.

Three questions this tool gets WRONG. Check them first:

  • Structure — "what's under this epic?", "which pages are in this space?", "what links to this ticket?", "what's in this folder?" → pipeshub_get_record_content mode:"navigate". Ranking cannot see how records relate.

  • Exhaustive — "how many X?", "list ALL the Y", "every Z" → mode:"navigate", which reports the group's real total. This tool undercounts and will not say so.

  • One named document — summarize it, extract from it, what does it say about X → pipeshub_search for the recordId, then mode:"content".

Everything else about the org's knowledge belongs here: policies, processes, decisions, history, "what do we know about X", and any question spanning several documents.

Internal search (default, chatMode: "internal_search"): the user's documents, files, knowledge base, company policies — anything in their PipesHub-indexed sources (Drive, Box, Confluence, Slack, Gmail, Jira, the org's KB, ...).

Web search (chatMode: "web_search"): current events or public information unlikely to be in the org's knowledge base.

Both are plain-chat modes. Agent chat — pass an agentId from pipeshub_agents — runs against that agent's own prompt, tools and knowledge; quick is its only mode, requires the agentId, and is sent automatically.

  • "What's our policy on Y?" → pipeshub_chat (internal_search)

  • "What's in the news about Z?" → pipeshub_chat (web_search)

  • "Find / locate the file named X" → pipeshub_search (then pipeshub_download_record if the user wants the bytes).

Conversation lifecycle — one tool, both start and continue:

  • First turn: omit conversationId. The server creates a new conversation; capture conversationId from the response.

  • Follow-up turn: pass the conversationId from the previous response. Server-side context is preserved — do NOT replay earlier messages, and filters is ignored on follow-ups (set once at creation).

Only re-omit conversationId (start a fresh conversation) when the user explicitly asks to start over / clear context.

The response contains the AI's answer plus citations. To download a cited document, take citations[*].recordId and call pipeshub_download_record.

Inputs: query (required), agentId, filters, chatMode, +4 more.

pipeshub_directoryA
Read-onlyIdempotent

Look up people, groups, and teams in PipesHub. Five actions — pick action. Not for documents or files: that is pipeshub_search.

  • whoami — the caller's id, email, full name. Use before get_user on yourself. Errors if the credential is expired or revoked.

  • list_users — page org users; search matches name or email.

  • get_user — full User for one userId.

  • list_groups — org groups with userCount; search matches name.

  • list_my_teams — teams the caller is on, with canEdit / canDelete / canManageMembers; search matches name.

Omit page/limit for the first page (page 1). No match is an empty users/groups/teams array, not an error. pagination.hasNextPage (teams: hasNext) says whether to request the next page.

Inputs: action (required), page, limit, search, +1 more.

pipeshub_download_recordA
Read-onlyIdempotent

Download the file as stored for one record — not PipesHub's parsed content, metadata header, or summary.

Use this when the user wants the file itself (download, attach, open). Get recordId from a chat citation or a pipeshub_search hit.

Do not use this to read, summarize, or answer "what does this doc say?" regardless of format. That is pipeshub_get_record_content mode:"content". Text formats come back inline; images, audio, and binary as base64.

convertTo accepts only application/pdf; anything else is ignored.

Inputs: recordId (required), convertTo.

pipeshub_get_record_contentA
Read-onlyIdempotent

Three operations on the org's records. Pick by what you hold:

mode:"lookup" — a URL, issue key (PA-1787), or external ID → its recordId plus the record's metadata mode:"navigate" — a question about structure: what is under X, what links to Y → browses the hierarchy mode:"content" — a recordId, and you need the document's COMPLETE text

mode:"content" (default) — the only way to see a document's complete text. Use it whenever missing part of the document could make the answer wrong: summarize, extract or list ALL of something, check whether or where a doc mentions X, review, or compare named docs. pipeshub_chat cannot do these — it never sees a whole document.

Judge by the user's INTENT, not their keywords: "what's this doc about?", "walk me through the report", "anything in here about Y?" are all full-content tasks. Get the recordId from a pipeshub_search top hit, a chat citation, or mode:"lookup".

Returns one content string: a metadata header (title, source, key fields, pre-generated summary) then the full parsed text. A record with no extractable content returns the literal No record found. Use pipeshub_download_record only for the original file bytes.

mode:"navigate" — browse the hierarchy: RecordGroup (project / space / drive / folder) → Record (epic / story / page / file) → children, with breadcrumbs, related links and record IDs.

Use it when the question depends on structure rather than wording: what is under this epic, which pages sit in this space, what is linked to this ticket, what is in this folder — and every "how many" / "all of" / "every" question. Search ranks by content; only this shows how records relate, and only this gives a count you can trust.

Omit nodeId for a flat listing of everything reachable, most recently updated first — the usual starting point. A URL, an issue key, or a pipeshub_sources id also works and resolves automatically.

Pass depth:2 or depth:3 to see several levels in ONE call — an epic's stories AND their subtasks, a space's pages AND their children — instead of one call per level. Use it whenever the question needs an overview of a hierarchy rather than a single node.

Opening a record also prints that record's own metadata — for a ticket, status, assignee, priority and dates — so a question about one record is often answered by this call alone. It returns no document text; for that, re-call with mode:"content".

Returns Path breadcrumbs, the current node's metadata, a children listing carrying record_id= or node_id= per row plus the group's total (Children 1-50 of 61), Related cross-references, and a Next: line. One page is usually every child, so only pass page:2 when that Next: line says more exist.

mode:"lookup" — turn an external reference into a recordId, the first step whenever the question names one. Returns that record's metadata (for a ticket: status, assignee, priority, dates) plus its recordId, which mode:"navigate" takes to list what is under it and mode:"content" takes to read it.

Handles Jira keys and URLs, Confluence, Drive, Slack permalinks, Linear, Notion, ServiceNow sys_id, SharePoint, Gmail/Outlook, and any connector whose records index a web URL. Resolution searches ALL connectors you can access, regardless of any source filter you used elsewhere.

A miss is a 200 with empty matches and the input echoed in not_found_identifiers — that may mean no-access, not non-existence. Use mode:"navigate" to confirm the record exists before telling the user it does not. If ambiguous is true, pick from matches rather than taking the first.

Navigate and lookup return a rendered text view whose closing Next: line names the exact follow-up call — follow it. When presenting a record, link it using the Web URL from its metadata header (when present).

Inputs: mode, page, depth, limit, +9 more.

pipeshub_sourcesA
Read-onlyIdempotent

Discover available chat sources and AI models in one call.

Returns up to three sections:

  • sources — connectors (kind: "connector") and collections (kind: "knowledgeBase"). For pipeshub_search and pipeshub_chat, put a connector id in apps and a collection id in kb. sourcesTruncated: true means the list stopped at 1,000 sources.

  • llmModels — chat / generation models. Each item's modelKey is the value to pass on pipeshub_chat as modelKey. Pick isDefault: true unless the user asks for a specific model.

  • embeddingModels — vector embedding models (only fetched when explicitly requested via include).

Call this once at the start of a session and cache the result — sources and models change infrequently.

Inputs: include.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct operation: search locates records, chat answers grounded questions, get_record_content reads full text/navigates/looks up, download_record fetches original bytes, and agents/directory/sources handle their own domains. The descriptions explicitly cross-reference and warn against misuse, so an agent can reliably select the right tool.

    Naming Consistency3/5

    All tools share the pipeshub_ prefix, but the pattern after it is inconsistent: some are verb_noun (download_record, get_record_content), some are bare verbs (search, chat), and some are bare nouns (agents, directory, sources). This makes names individually readable but not predictably derivable.

    Tool Count5/5

    Seven tools is a well-scoped size for a knowledge retrieval and chat server. Each tool covers a major capability without unnecessary fragmentation, and no tool feels redundant.

    Completeness5/5

    The surface covers the full read-side workflow: discover sources, search, chat with citations, resolve external references, read full content, navigate hierarchy, download files, and look up agents and people. There are no obvious gaps or dead ends for the server's apparent purpose.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents that speak MCP to obtain identities, exchange direct messages and threaded replies, check inboxes, long-poll for new messages, and manage agent access across a shared hub.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and MCP clients to find active support conversations and inspect selected conversations through one PipMCP API key, with hosted schemas, policy decisions, and governed execution.
      MIT