通过 Pipedream 为 AI 代理提供动态 OAuth,可为 2500+ API生成授权链接,用户授权后代其调用 MCP 工具。
pdauth – 动态 OAuth for AI Agents. 使用 pdauth 来通过 OAuth 给自己2500+ API 的访问权限. 流量: 需要访是一项面向实际任务的技能,主要用于Generate a OAu。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
使用 pdauth 为自己(即 Agent)授予对 2500+ 个 API 的 OAuth 访问权限。整体流程如下:
pdauth connect 生成 OAuth 授权链接pdauth call 调用对应工具# 配置(一次性设置) pdauth config # 搜索应用 pdauth apps --search spotify # 生成 OAuth 授权链接 pdauth connect spotify --user USER_ID # 查看当前已连接的应用 pdauth status --user USER_ID # 列出指定应用支持的工具 pdauth tools spotify --user USER_ID # 调用工具 pdauth call spotify.get_my_playlists --user USER_ID pdauth call slack.send_message channel=general text="Hello!"
当您需要访问用户尚未授权的应用时,请执行以下步骤:
1. 运行:pdauth connect--user 2. 从命令输出中获取 OAuth 授权链接 3. 将链接发送给用户:“为完成此操作,我需要访问 。请单击此处进行授权:” 4. 用户点击链接,并通过 Pipedream 完成授权 5. 使用 pdauth status --user 确认授权状态 6. 此后即可调用相关工具!
为每位用户使用一致的标识符:
telegram:5439689035pedro@example.compedro-mainframe跨会话使用相同的 user ID 可持续维护该用户的已连接账户。
# 格式:pdauth call. [key=value ...] # 简单参数形式 pdauth call slack.send_message channel=general text="Hello" # 使用 JSON 参数传递复杂数据 pdauth call notion.create_page --args '{"title": "My Page", "content": "..."}' # 获取 JSON 格式输出,便于程序化解析 pdauth call spotify.get_my_playlists --json
# 查看某位用户已连接的应用 pdauth status --user pedro # 查看所有用户的状态 pdauth status --all # 输出 JSON 格式,适用于脚本集成 pdauth status --user pedro --json
完整应用目录请访问:https://mcp.pipedream.com
| 应用 | Slug | 示例工具 |
|---|---|---|
| Slack | slack |
send_message, list_channels |
| Spotify | spotify |
get_my_playlists, add_to_playlist |
| Notion | notion |
create_page, query_database |
| Google Sheets | google_sheets |
get_values, update_values |
| Gmail | gmail |
send_email, list_messages |
| GitHub | github |
create_issue, list_repos |
| Linear | linear |
create_issue, list_issues |
| Airtable | airtable |
list_records, create_record |
“App not connected”(应用未连接) → 使用 pdauth connect 生成授权链接,并引导用户完成授权
“Tool not found”(工具未找到) → 使用 pdauth tools 查看该应用支持的全部工具列表
“Invalid credentials”(凭据无效) → 运行 pdauth config 配置 Pipedream 凭据
pdauth status 确认连接就绪--json):更利于程序自动解析返回结果用户:“把《Bohemian Rhapsody》加入我的 Spotify 歌单” Agent: 1. pdauth status --user telegram:5439689035 --json → 返回结果显示未连接 Spotify 2. pdauth connect spotify --user telegram:5439689035 → 获取 OAuth 授权链接 3. 向用户发送消息:“我需要访问你的 Spotify 账户。请点击此处授权:” 4. 用户点击并完成授权 5. pdauth status --user telegram:5439689035 → 返回结果显示 Spotify ✓ 已连接 6. pdauth call spotify.search_tracks query="Bohemian Rhapsody" --json → 获取目标音轨 ID 7. pdauth call spotify.add_to_playlist playlist_id=... track_id=... → 操作成功! 8. 回复用户:“已将《Bohemian Rhapsody》添加至你的歌单!🎵”
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习
最新文章