Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To use an existing database, set `DATABASE_URL` in `.env` and skip the Docker st
| Collaboration | [Notion](https://www.notion.com) · [Linear](https://linear.app) · [Atlassian](https://www.atlassian.com) (Jira, Confluence) · [ClickUp](https://clickup.com) · [monday.com](https://monday.com) · [Airtable](https://airtable.com) · [Todoist](https://todoist.com) · [Intercom](https://www.intercom.com) |
| Code & deploy | [GitHub](https://github.com) · [GitLab](https://gitlab.com) · [Vercel](https://vercel.com) · [Netlify](https://www.netlify.com) · [Cloudflare](https://www.cloudflare.com) |
| Databases | [Supabase](https://supabase.com) · [Neon](https://neon.com) · [Prisma](https://www.prisma.io) |
| Monitoring & analytics | [Sentry](https://sentry.io) · [PostHog](https://posthog.com) |
| Monitoring & analytics | [Sentry](https://sentry.io) · [PostHog](https://posthog.com) · [Google Search Console](https://search.google.com/search-console) · [Google Analytics](https://analytics.google.com) |
| Payments | [Stripe](https://stripe.com) · [PayPal](https://www.paypal.com) · [Square](https://squareup.com) |
| Design & websites | [Canva](https://www.canva.com) · [Miro](https://miro.com) · [Webflow](https://webflow.com) · [Wix](https://www.wix.com) |

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ npm run dev # 或:make dev
| 协作与办公 | [Notion](https://www.notion.com) · [Linear](https://linear.app) · [Atlassian](https://www.atlassian.com)(Jira、Confluence)· [ClickUp](https://clickup.com) · [monday.com](https://monday.com) · [Airtable](https://airtable.com) · [Todoist](https://todoist.com) · [Intercom](https://www.intercom.com) |
| 代码与部署 | [GitHub](https://github.com) · [GitLab](https://gitlab.com) · [Vercel](https://vercel.com) · [Netlify](https://www.netlify.com) · [Cloudflare](https://www.cloudflare.com) |
| 数据库 | [Supabase](https://supabase.com) · [Neon](https://neon.com) · [Prisma](https://www.prisma.io) |
| 监控与分析 | [Sentry](https://sentry.io) · [PostHog](https://posthog.com) |
| 监控与分析 | [Sentry](https://sentry.io) · [PostHog](https://posthog.com) · [Google Search Console](https://search.google.com/search-console) · [Google Analytics](https://analytics.google.com) |
| 支付 | [Stripe](https://stripe.com) · [PayPal](https://www.paypal.com) · [Square](https://squareup.com) |
| 设计与建站 | [Canva](https://www.canva.com) · [Miro](https://miro.com) · [Webflow](https://webflow.com) · [Wix](https://www.wix.com) |

Expand Down
4 changes: 2 additions & 2 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Connany source code is licensed under MIT. Third-party packages retain their own

## Connector marks

All connector names and logos (Notion, GitHub, Linear, Sentry, PostHog, Atlassian, Vercel, Supabase, Neon, Netlify, GitLab, Cloudflare, Prisma, Stripe, PayPal, Square, ClickUp, monday.com, Airtable, Todoist, Miro, Canva, Intercom, Webflow and Wix) belong to their respective owners and are used to identify integrations. No affiliation or endorsement is implied. The Connany license does not grant rights to these trademarks.
All connector names and logos (Notion, GitHub, Linear, Sentry, PostHog, Atlassian, Vercel, Supabase, Neon, Netlify, GitLab, Cloudflare, Prisma, Stripe, PayPal, Square, ClickUp, monday.com, Airtable, Todoist, Miro, Canva, Intercom, Webflow, Wix, Google Search Console and Google Analytics) belong to their respective owners and are used to identify integrations. No affiliation or endorsement is implied. The Connany license does not grant rights to these trademarks.

- Notion and GitHub SVG icons in `src/connectors/catalog.ts`: sourced from [LobeHub Icons](https://github.com/lobehub/lobe-icons), under the MIT license reproduced below.
- Other connector SVG icons: sourced from [Simple Icons](https://simpleicons.org) (CC0 1.0). monday.com and Canva are not available there and use plain monograms.
- Other connector SVG icons: sourced from [Simple Icons](https://simpleicons.org) (CC0 1.0). monday.com and Canva are not available there and use plain monograms. The Google Search Console mark is redrawn as a monochrome vector from Google's official logo.
- Linear SVG logomark: sourced from [Linear Brand Guidelines](https://linear.app/brand), `Linear-Brand-Assets.zip?v=3`, `logo-dark.svg`. It remains subject to Linear's brand usage terms.

## LobeHub Icons license
Expand Down
2 changes: 1 addition & 1 deletion docs/agent-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ SDK 会抛出 `ConnanyError`,带 `status`、`code`、`requestId` 和 `details`

所有连接器的工具都来自上游官方 MCP,名称格式为 `<连接器>.<官方工具名>`,参数以 `input_schema` 为准。

接入方的代码对所有连接器都一样:用 `GET /v1/connectors` 拿到可连接的列表,授权、列出工具、调用工具的接口都不区分连接器。除下面三个之外,Sentry、PostHog、Atlassian、Vercel、Supabase、Neon、Netlify、GitLab、Cloudflare、Prisma、Stripe、PayPal、Square、ClickUp、monday.com、Airtable、Todoist、Miro、Canva、Intercom、Webflow、Wix 也都走各自的官方 MCP,工具名为 `<连接器>.<官方工具名>`。少数平台不提供用户信息,这类连接显示为「<平台> 账号」,`identity.unverified` 为 true,重新授权时无法确认是同一个账号,建议在界面上提示用户。
接入方的代码对所有连接器都一样:用 `GET /v1/connectors` 拿到可连接的列表,授权、列出工具、调用工具的接口都不区分连接器。除下面三个之外,Sentry、PostHog、Atlassian、Vercel、Supabase、Neon、Netlify、GitLab、Cloudflare、Prisma、Stripe、PayPal、Square、ClickUp、monday.com、Airtable、Todoist、Miro、Canva、Intercom、Webflow、Wix 也都走各自的官方 MCP,工具名为 `<连接器>.<官方工具名>`。Google Search Console 和 Google Analytics 没有官方托管 MCP,工具由 Connany 内置(如 `google_search_console.query_search_analytics`、`google_analytics.run_report`),调用方式相同。少数平台不提供用户信息,这类连接显示为「<平台> 账号」,`identity.unverified` 为 true,重新授权时无法确认是同一个账号,建议在界面上提示用户。

### Notion

Expand Down
37 changes: 36 additions & 1 deletion docs/connector-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,36 @@ GitHub App 安装授权决定仓库范围;用户 OAuth 决定操作主体。Co

[官方文档](https://linear.app/docs/mcp)

## Google Search Console / Google Analytics

Google 不提供 Search Console 和 Analytics 的托管 MCP,也不支持动态客户端注册。这两个连接器由管理员在 Google Cloud 创建一个 OAuth 客户端,Connany 用用户的 token 直接调用 Google REST API,工具目录内置在 Connany 里,无需「同步工具目录」。两个连接器可以共用同一个 OAuth 客户端。

1. 在 [Google Cloud 控制台](https://console.cloud.google.com/) 选择或新建项目,在「API 和服务 → 库」中启用:
- Search Console:**Google Search Console API**
- Analytics:**Google Analytics Data API** 和 **Google Analytics Admin API**
2. 配置 OAuth 同意屏幕(Google Auth Platform):填写应用名称、支持邮箱和授权域名,在「数据访问」中添加 `openid`、`email`、`https://www.googleapis.com/auth/webmasters.readonly`、`https://www.googleapis.com/auth/analytics.readonly`。
3. 在「凭据」创建 **Web 应用** 类型的 OAuth 客户端,「已获授权的重定向 URI」加入:
- `https://connect.example.com/oauth/google_search_console/callback`
- `https://connect.example.com/oauth/google_analytics/callback`
4. 在管理后台「连接器 → Google Search Console / Google Analytics → 配置」填写 Client ID 和 Client Secret 并保存,然后在「连接测试」发起授权,试读数据会列出账号可访问的站点 / GA4 媒体资源。

发布状态:

- **测试中(Testing)**:只有加入「测试用户」的 Google 账号(最多 100 个)能授权,且 refresh token **7 天后失效**,用户需要重新授权。适合自测。
- **正式版(In production)**:两个 scope 都是 Google 的敏感范围,对外开放前需要通过 Google 的应用验证(品牌信息、隐私政策、用途说明和演示视频),不需要安全评估。未验证时用户会看到「Google 尚未验证此应用」的提示。
- **内部(Internal)**:仅限 Google Workspace 组织内的账号,无需验证,refresh token 不会 7 天过期。

工具(全部只读):

| 连接器 | 工具 |
|---|---|
| Google Search Console | `list_sites`、`query_search_analytics`(点击、展示、CTR、排名,可按查询词 / 页面 / 国家 / 设备 / 日期分组和过滤)、`list_sitemaps`、`inspect_url`(索引状态) |
| Google Analytics | `list_account_summaries`、`get_property`、`get_metadata`(可用维度与指标,含自定义)、`run_report`、`run_realtime_report` |

工具名为 `<连接器>.<工具>`,例如 `google_analytics.run_report`。返回结果整理为按维度、指标命名的行,数值指标转为数字;单次最多 1000 行,用 `start_row` / `offset` 翻页。Google 返回的错误说明(如 API 未启用、无权访问该媒体资源、指标名错误)会放在错误的 `details.upstream_message` 中,MCP 调用会直接展示给 agent。

授权时请求 `access_type=offline` 和 `prompt=consent`,保证每次授权都拿到 refresh token。账号以 Google userinfo 的 `sub` 识别,显示为邮箱。断开连接会调用 `https://oauth2.googleapis.com/revoke` 撤销 refresh token。

## 其他官方托管 MCP 连接器

以下连接器和 Notion、Linear 一样走官方 MCP 授权:管理员在「连接器」点启用,Connany 自动完成 OAuth 客户端注册(动态客户端注册,RFC 7591),然后点「同步工具目录」用自己的账号授权一次。不需要去各平台申请应用或填写凭证。
Expand Down Expand Up @@ -110,7 +140,12 @@ curl -s https://mcp.example.com/.well-known/oauth-protected-resource/mcp
curl -s https://<授权服务器>/.well-known/oauth-authorization-server
```

后台「连接器」、连接路由、工具校验、工具列表会自动出现新连接器,无需修改数据库。需要自定义 OAuth 的连接器(如 GitHub App)仍在 `ConnectorRuntime`(`src/connectors/index.ts`)中单独实现。
没有托管 MCP 或不支持动态注册的服务(如 Google)使用 `auth: 'oauth'`:

- `oauth`:`authorize`、`token`,可选 `revoke`(RFC 7009)、`userinfo`(OIDC,用 `sub` 或 `id` 识别账号)、`scope`、`authorizeParams`,以及后台配置弹框中的 `console`(创建客户端的链接和说明)。管理员在后台填写 Client ID / Secret。
- `rest`:Connany 自己实现的工具,参考 `src/connectors/google.ts`:每个工具有 zod 参数、请求构造和可选的结果整理。工具名用 `<连接器>.<小写下划线>`,与 MCP 工具名规则一致。工具目录随代码发布,不写入 `connector_tools`。

后台「连接器」、连接路由、工具校验、工具列表会自动出现新连接器,无需修改数据库。GitHub App 的安装流程仍在 `ConnectorRuntime`(`src/connectors/index.ts`)中单独实现。

升级到此版本需运行一次 `pnpm db:migrate`(`005_provider_catalog.sql` 移除数据库中写死的连接器名单约束)。

Expand Down
Loading
Loading