@capybara-hq/plugin-github 0.1.0-rc.0 → 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.capybara-plugin/plugin.json +3 -11
- package/README.md +10 -8
- package/package.json +2 -2
- package/connectors/github-pat.json +0 -119
- package/guides/github-pat.md +0 -58
- package/guides/github-pat.zh.md +0 -53
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"$schema": "https://capybarahq.com/schemas/plugin.v1.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
4
|
"name": "github",
|
|
5
|
-
"version": "0.1.0-rc.
|
|
5
|
+
"version": "0.1.0-rc.1",
|
|
6
6
|
"publisher": "Capybara",
|
|
7
7
|
"description": {
|
|
8
|
-
"en": "Agents work with GitHub as the connected person: issues, pull requests, reviews, repositories and Actions runs, through GitHub's remote MCP server.
|
|
9
|
-
"zh": "智能体以连接者本人的身份使用 GitHub:issue、拉取请求、评审、仓库与 Actions 运行,经 GitHub 的远程 MCP
|
|
8
|
+
"en": "Agents work with GitHub as the connected person: issues, pull requests, reviews, repositories and Actions runs, through GitHub's remote MCP server. Each member connects with OAuth through a GitHub App (or OAuth App) the org admin registers",
|
|
9
|
+
"zh": "智能体以连接者本人的身份使用 GitHub:issue、拉取请求、评审、仓库与 Actions 运行,经 GitHub 的远程 MCP 服务器。每位成员通过组织管理员注册的 GitHub App(或 OAuth App)用 OAuth 连接"
|
|
10
10
|
},
|
|
11
11
|
"displayName": {
|
|
12
12
|
"zh": "GitHub",
|
|
@@ -23,9 +23,6 @@
|
|
|
23
23
|
"connectorTemplates": [
|
|
24
24
|
{
|
|
25
25
|
"path": "./connectors/github.json"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"path": "./connectors/github-pat.json"
|
|
29
26
|
}
|
|
30
27
|
],
|
|
31
28
|
"setupGuides": [
|
|
@@ -33,11 +30,6 @@
|
|
|
33
30
|
"id": "github-oauth",
|
|
34
31
|
"place": "connector-template",
|
|
35
32
|
"template": "github"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "github-pat",
|
|
39
|
-
"place": "connector-template",
|
|
40
|
-
"template": "github-pat"
|
|
41
33
|
}
|
|
42
34
|
]
|
|
43
35
|
}
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @capybara-hq/plugin-github
|
|
2
2
|
|
|
3
|
-
GitHub connector
|
|
3
|
+
The GitHub connector template (declarative: no extension). Agents work with GitHub **as the
|
|
4
4
|
person using them**: issues, pull requests, comments and reviews, repository files and branches,
|
|
5
5
|
and Actions runs and logs, through [GitHub's remote MCP server](https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md)
|
|
6
6
|
(`https://api.githubcopilot.com/mcp/`) on the [`connector-mcp`](../connector-mcp) connector.
|
|
@@ -8,14 +8,13 @@ and Actions runs and logs, through [GitHub's remote MCP server](https://github.c
|
|
|
8
8
|
| Template | Auth | Default |
|
|
9
9
|
|---|---|---|
|
|
10
10
|
| `github` | Per-person OAuth (`oauth_code`, MCP discovery, manual client): the org admin registers a GitHub App (recommended: fine-grained permissions, per-installation repositories, tokens that expire after eight hours and are refreshed) or an OAuth App (classic scopes `repo`, `read:org`, `read:user`, `user:email`, `workflow`) | on |
|
|
11
|
-
| `github-pat` | Per-person personal access token (`bearer`) | off: an org admin switches it on where tokens are allowed |
|
|
12
11
|
|
|
13
12
|
GitHub does not support dynamic client registration, so the OAuth template always needs a client
|
|
14
13
|
the org admin enters.
|
|
15
14
|
|
|
16
15
|
## Tools and policies
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
The template sets the endpoint header `X-MCP-Toolsets: context,repos,issues,pull_requests,users,actions`
|
|
19
18
|
(GitHub's default toolsets plus `actions` for CI status). The header and the URL are editable per
|
|
20
19
|
org (`editableEndpoint`): add toolsets, set `X-MCP-Readonly: true`, or point the URL at a GitHub
|
|
21
20
|
Enterprise Cloud data residency host (`https://copilot-api.<subdomain>.ghe.com/mcp`). GitHub
|
|
@@ -32,17 +31,20 @@ annotation (read-only: allow, else ask) and goes through the drift review.
|
|
|
32
31
|
|
|
33
32
|
`guides/github-oauth.md` (template `github`: GitHub App settings, the OAuth App alternative, the
|
|
34
33
|
kernel checks `public-url`, `oauth-client`, `oauth-token-endpoint`, `connector-tools`, and how a
|
|
35
|
-
member connects and revokes)
|
|
36
|
-
tokens, and the fine-grained token a member creates), each with a Chinese version. Preview with
|
|
34
|
+
member connects and revokes), with a Chinese version. Preview with
|
|
37
35
|
`capybara-plugin guide github-oauth --audience admin` from this directory.
|
|
38
36
|
|
|
39
37
|
## Tests
|
|
40
38
|
|
|
41
39
|
```bash
|
|
42
40
|
pnpm exec vitest run plugins/github
|
|
43
|
-
# live, against GitHub (
|
|
41
|
+
# live, against GitHub (lists the tools and calls get_me; read-only):
|
|
44
42
|
CAPYBARA_TEST_LIVE_TOOLS=1 pnpm exec vitest run plugins/github/test/live -t live
|
|
45
43
|
```
|
|
46
44
|
|
|
47
|
-
The live test needs `CAPYBARA_TEST_GITHUB_MCP_TOKEN
|
|
48
|
-
|
|
45
|
+
The live test needs `CAPYBARA_TEST_GITHUB_MCP_TOKEN`: a personal access token stands in for a
|
|
46
|
+
member's OAuth token, since the OAuth flow needs a browser. Keep it in an env file outside the
|
|
47
|
+
repository.
|
|
48
|
+
|
|
49
|
+
A personal access token template was dropped before release: OAuth through a GitHub App gives
|
|
50
|
+
expiring tokens, per-installation repositories and admin control, which a member-made token does not.
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-github",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"description": "GitHub connector
|
|
6
|
+
"description": "GitHub connector template: issues, pull requests, reviews, repositories and Actions through GitHub's remote MCP server, as the connected person (OAuth through a GitHub App or OAuth App)",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/capybara-hq/plugins.git",
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"displayName": {
|
|
3
|
-
"zh": "GitHub(个人访问令牌)",
|
|
4
|
-
"en": "GitHub (personal access token)"
|
|
5
|
-
},
|
|
6
|
-
"description": "The same GitHub tools as the GitHub template, but each member pastes a personal access token of their own (fine-grained recommended) instead of connecting with OAuth. Off by default: an org admin switches it on where personal access tokens are allowed.",
|
|
7
|
-
"icon": "./icon.svg",
|
|
8
|
-
"defaultEnabled": false,
|
|
9
|
-
"template": {
|
|
10
|
-
"plugin": "connector-mcp",
|
|
11
|
-
"pluginVersion": "^0.1.0-rc.1",
|
|
12
|
-
"connector": "mcp",
|
|
13
|
-
"endpoint": {
|
|
14
|
-
"url": "https://api.githubcopilot.com/mcp/",
|
|
15
|
-
"headers": {
|
|
16
|
-
"X-MCP-Toolsets": "context,repos,issues,pull_requests,users,actions"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"editableEndpoint": ["url", "headers"],
|
|
20
|
-
"auth": {
|
|
21
|
-
"type": "bearer",
|
|
22
|
-
"ownership": "personal"
|
|
23
|
-
},
|
|
24
|
-
"defaultToolPolicies": {
|
|
25
|
-
"get_me": "allow",
|
|
26
|
-
"get_teams": "allow",
|
|
27
|
-
"get_team_members": "allow",
|
|
28
|
-
"ui_get": "allow",
|
|
29
|
-
"get_commit": "allow",
|
|
30
|
-
"get_file_contents": "allow",
|
|
31
|
-
"get_file_blame": "allow",
|
|
32
|
-
"get_latest_release": "allow",
|
|
33
|
-
"get_release_by_tag": "allow",
|
|
34
|
-
"get_tag": "allow",
|
|
35
|
-
"list_branches": "allow",
|
|
36
|
-
"list_commits": "allow",
|
|
37
|
-
"list_releases": "allow",
|
|
38
|
-
"list_repository_collaborators": "allow",
|
|
39
|
-
"list_tags": "allow",
|
|
40
|
-
"search_code": "allow",
|
|
41
|
-
"search_commits": "allow",
|
|
42
|
-
"search_repositories": "allow",
|
|
43
|
-
"issue_read": "allow",
|
|
44
|
-
"list_issues": "allow",
|
|
45
|
-
"search_issues": "allow",
|
|
46
|
-
"list_issue_types": "allow",
|
|
47
|
-
"list_issue_fields": "allow",
|
|
48
|
-
"get_label": "allow",
|
|
49
|
-
"find_duplicate": "allow",
|
|
50
|
-
"issue_dependency_read": "allow",
|
|
51
|
-
"issue_artifact_read": "allow",
|
|
52
|
-
"pull_request_read": "allow",
|
|
53
|
-
"list_pull_requests": "allow",
|
|
54
|
-
"search_pull_requests": "allow",
|
|
55
|
-
"search_users": "allow",
|
|
56
|
-
"actions_get": "allow",
|
|
57
|
-
"actions_list": "allow",
|
|
58
|
-
"get_job_logs": "allow",
|
|
59
|
-
"create_branch": "ask",
|
|
60
|
-
"create_or_update_file": "ask",
|
|
61
|
-
"push_files": "ask",
|
|
62
|
-
"delete_file": "ask",
|
|
63
|
-
"create_repository": "ask",
|
|
64
|
-
"fork_repository": "ask",
|
|
65
|
-
"create_issue": "ask",
|
|
66
|
-
"issue_write": "ask",
|
|
67
|
-
"add_issue_comment": "ask",
|
|
68
|
-
"update_issue_comment": "ask",
|
|
69
|
-
"sub_issue_write": "ask",
|
|
70
|
-
"add_sub_issue": "ask",
|
|
71
|
-
"remove_sub_issue": "ask",
|
|
72
|
-
"reprioritize_sub_issue": "ask",
|
|
73
|
-
"set_issue_fields": "ask",
|
|
74
|
-
"update_issue_assignees": "ask",
|
|
75
|
-
"update_issue_body": "ask",
|
|
76
|
-
"update_issue_labels": "ask",
|
|
77
|
-
"update_issue_milestone": "ask",
|
|
78
|
-
"update_issue_state": "ask",
|
|
79
|
-
"update_issue_title": "ask",
|
|
80
|
-
"update_issue_type": "ask",
|
|
81
|
-
"issue_dependency_write": "ask",
|
|
82
|
-
"issue_artifact_write": "ask",
|
|
83
|
-
"add_issue_reaction": "ask",
|
|
84
|
-
"add_issue_comment_reaction": "ask",
|
|
85
|
-
"remove_issue_reaction": "ask",
|
|
86
|
-
"remove_issue_comment_reaction": "ask",
|
|
87
|
-
"hide_issue_comment": "ask",
|
|
88
|
-
"unhide_issue_comment": "ask",
|
|
89
|
-
"create_pull_request": "ask",
|
|
90
|
-
"update_pull_request": "ask",
|
|
91
|
-
"update_pull_request_branch": "ask",
|
|
92
|
-
"update_pull_request_body": "ask",
|
|
93
|
-
"update_pull_request_title": "ask",
|
|
94
|
-
"update_pull_request_state": "ask",
|
|
95
|
-
"update_pull_request_draft_state": "ask",
|
|
96
|
-
"merge_pull_request": "ask",
|
|
97
|
-
"request_pull_request_reviewers": "ask",
|
|
98
|
-
"pull_request_review_write": "ask",
|
|
99
|
-
"create_pull_request_review": "ask",
|
|
100
|
-
"submit_pending_pull_request_review": "ask",
|
|
101
|
-
"delete_pending_pull_request_review": "ask",
|
|
102
|
-
"add_comment_to_pending_review": "ask",
|
|
103
|
-
"add_pull_request_review_comment": "ask",
|
|
104
|
-
"add_reply_to_pull_request_comment": "ask",
|
|
105
|
-
"resolve_review_thread": "ask",
|
|
106
|
-
"unresolve_review_thread": "ask",
|
|
107
|
-
"add_pull_request_review_comment_reaction": "ask",
|
|
108
|
-
"remove_pull_request_review_comment_reaction": "ask",
|
|
109
|
-
"hide_pull_request_review": "ask",
|
|
110
|
-
"unhide_pull_request_review": "ask",
|
|
111
|
-
"hide_pull_request_review_comment": "ask",
|
|
112
|
-
"unhide_pull_request_review_comment": "ask",
|
|
113
|
-
"assign_copilot_to_issue": "ask",
|
|
114
|
-
"request_copilot_review": "ask",
|
|
115
|
-
"actions_run_trigger": "ask",
|
|
116
|
-
"delete_repository": "deny"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
package/guides/github-pat.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Set up the GitHub connector with personal access tokens
|
|
2
|
-
|
|
3
|
-
This template gives agents the same GitHub tools as the **GitHub** template, but each member pastes
|
|
4
|
-
a personal access token of their own instead of connecting with OAuth. Agents then act on GitHub
|
|
5
|
-
as that member, with what the token allows.
|
|
6
|
-
|
|
7
|
-
::: audience admin
|
|
8
|
-
The template starts switched off. Switch it on only where personal access tokens are acceptable:
|
|
9
|
-
they are created and scoped by each member, and a classic token reaches every repository the
|
|
10
|
-
member can. Prefer the **GitHub** template (a GitHub App) where you can.
|
|
11
|
-
|
|
12
|
-
If your GitHub organization requires approval of fine-grained tokens, an owner approves each
|
|
13
|
-
member's token under **Settings → Personal access tokens → Pending requests**. To forbid classic
|
|
14
|
-
tokens, set **Settings → Personal access tokens → Restrict access via personal access tokens
|
|
15
|
-
(classic)**.
|
|
16
|
-
|
|
17
|
-
Reads run directly; writes ask the member first and deleting a repository is denied, as in the
|
|
18
|
-
**GitHub** template.
|
|
19
|
-
|
|
20
|
-
::check capybara:connector-tools A member connected and the tool list was read
|
|
21
|
-
:::
|
|
22
|
-
|
|
23
|
-
::: audience member
|
|
24
|
-
## Create a token
|
|
25
|
-
|
|
26
|
-
Open **Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new
|
|
27
|
-
token** on GitHub (`https://github.com/settings/personal-access-tokens/new`) and choose:
|
|
28
|
-
|
|
29
|
-
```yaml title="Fine-grained token (GitHub connector)"
|
|
30
|
-
# Personal access token for the "{{templateName}}" connector template ({{pluginName}} {{pluginVersion}}).
|
|
31
|
-
# Reference: https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens (checked 2026-11-12).
|
|
32
|
-
Resource owner: (your account or the organization that owns the repositories)
|
|
33
|
-
Expiration: 90 days or less
|
|
34
|
-
Repository access: Only select repositories
|
|
35
|
-
Repository permissions:
|
|
36
|
-
Actions: Read and write
|
|
37
|
-
Commit statuses: Read-only
|
|
38
|
-
Contents: Read and write
|
|
39
|
-
Issues: Read and write
|
|
40
|
-
Metadata: Read-only
|
|
41
|
-
Pull requests: Read and write
|
|
42
|
-
Workflows: Read and write # only to change files under .github/workflows
|
|
43
|
-
Organization permissions:
|
|
44
|
-
Members: Read-only
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Fine-grained tokens have no Checks permission; Actions and Commit statuses cover CI status.
|
|
48
|
-
A classic token works too (scopes `repo`, `read:org`, `read:user`, `user:email`, `workflow`); with
|
|
49
|
-
one, GitHub hides the tools the token's scopes do not cover.
|
|
50
|
-
|
|
51
|
-
## Connect
|
|
52
|
-
|
|
53
|
-
Paste the token in **Connect**. It is stored encrypted and never shown again. When it expires,
|
|
54
|
-
connect again with a new token. **Disconnect** deletes it in Capybara; delete the token on GitHub
|
|
55
|
-
as well when you no longer need it.
|
|
56
|
-
|
|
57
|
-
::check capybara:connector-connected Your GitHub token is connected
|
|
58
|
-
:::
|
package/guides/github-pat.zh.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# 用个人访问令牌设置 GitHub 连接器
|
|
2
|
-
|
|
3
|
-
本模板给智能体的 GitHub 工具和 **GitHub** 模板相同,区别是每位成员粘贴自己的个人访问令牌,而不是用 OAuth
|
|
4
|
-
连接。智能体以这位成员的身份操作 GitHub,能做什么由令牌决定。
|
|
5
|
-
|
|
6
|
-
::: audience admin
|
|
7
|
-
本模板默认关闭。只在允许个人访问令牌的组织里打开:令牌由成员自己创建、自己决定范围,经典令牌能访问成员能
|
|
8
|
-
访问的所有仓库。能用 **GitHub** 模板(GitHub App)时优先用它。
|
|
9
|
-
|
|
10
|
-
如果 GitHub 组织要求审批细粒度令牌,需要组织所有者在 **Settings → Personal access tokens → Pending
|
|
11
|
-
requests** 里批准每位成员的令牌。要禁止经典令牌,设置 **Settings → Personal access tokens → Restrict access
|
|
12
|
-
via personal access tokens (classic)**。
|
|
13
|
-
|
|
14
|
-
和 **GitHub** 模板一样:读取直接执行,写入先征求成员同意,删除仓库默认禁止。
|
|
15
|
-
|
|
16
|
-
::check capybara:connector-tools 已有成员连接并读到工具列表
|
|
17
|
-
:::
|
|
18
|
-
|
|
19
|
-
::: audience member
|
|
20
|
-
## 创建令牌
|
|
21
|
-
|
|
22
|
-
在 GitHub 上打开 **Settings → Developer settings → Personal access tokens → Fine-grained tokens →
|
|
23
|
-
Generate new token**(`https://github.com/settings/personal-access-tokens/new`),按下面选择:
|
|
24
|
-
|
|
25
|
-
```yaml title="细粒度令牌(GitHub 连接器)"
|
|
26
|
-
# Personal access token for the "{{templateName}}" connector template ({{pluginName}} {{pluginVersion}}).
|
|
27
|
-
# Reference: https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens (checked 2026-11-12).
|
|
28
|
-
Resource owner: (your account or the organization that owns the repositories)
|
|
29
|
-
Expiration: 90 days or less
|
|
30
|
-
Repository access: Only select repositories
|
|
31
|
-
Repository permissions:
|
|
32
|
-
Actions: Read and write
|
|
33
|
-
Commit statuses: Read-only
|
|
34
|
-
Contents: Read and write
|
|
35
|
-
Issues: Read and write
|
|
36
|
-
Metadata: Read-only
|
|
37
|
-
Pull requests: Read and write
|
|
38
|
-
Workflows: Read and write # only to change files under .github/workflows
|
|
39
|
-
Organization permissions:
|
|
40
|
-
Members: Read-only
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
细粒度令牌没有 Checks 权限;CI 状态由 Actions 和 Commit statuses 覆盖。
|
|
44
|
-
也可以用经典令牌(scope 为 `repo`、`read:org`、`read:user`、`user:email`、`workflow`);这时 GitHub 会隐藏
|
|
45
|
-
令牌 scope 覆盖不到的工具。
|
|
46
|
-
|
|
47
|
-
## 连接
|
|
48
|
-
|
|
49
|
-
在**连接**里粘贴令牌。令牌加密保存,之后不再显示。过期后用新令牌重新连接。**断开连接**会删除 Capybara 里的
|
|
50
|
-
令牌;不再需要时也请在 GitHub 上删除它。
|
|
51
|
-
|
|
52
|
-
::check capybara:connector-connected 你的 GitHub 令牌已连接
|
|
53
|
-
:::
|