@capybara-hq/plugin-github 0.0.0-stage → 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 +35 -0
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +49 -2
- package/connectors/github.json +122 -0
- package/guides/github-oauth.md +93 -0
- package/guides/github-oauth.zh.md +84 -0
- package/icon.svg +1 -0
- package/package.json +11 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://capybarahq.com/schemas/plugin.v1.schema.json",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"name": "github",
|
|
5
|
+
"version": "0.1.0-rc.1",
|
|
6
|
+
"publisher": "Capybara",
|
|
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. 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
|
+
},
|
|
11
|
+
"displayName": {
|
|
12
|
+
"zh": "GitHub",
|
|
13
|
+
"en": "GitHub"
|
|
14
|
+
},
|
|
15
|
+
"icon": "./icon.svg",
|
|
16
|
+
"homepage": "https://github.com/capybara-hq/plugins/tree/main/plugins/github#readme",
|
|
17
|
+
"dependencies": [
|
|
18
|
+
{
|
|
19
|
+
"name": "connector-mcp",
|
|
20
|
+
"version": "^0.1.0-rc.1"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"connectorTemplates": [
|
|
24
|
+
{
|
|
25
|
+
"path": "./connectors/github.json"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"setupGuides": [
|
|
29
|
+
{
|
|
30
|
+
"id": "github-oauth",
|
|
31
|
+
"place": "connector-template",
|
|
32
|
+
"template": "github"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @capybara-hq/plugin-github
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The GitHub connector template (declarative: no extension). Agents work with GitHub **as the
|
|
4
|
+
person using them**: issues, pull requests, comments and reviews, repository files and branches,
|
|
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
|
+
(`https://api.githubcopilot.com/mcp/`) on the [`connector-mcp`](../connector-mcp) connector.
|
|
7
|
+
|
|
8
|
+
| Template | Auth | Default |
|
|
9
|
+
|---|---|---|
|
|
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
|
+
|
|
12
|
+
GitHub does not support dynamic client registration, so the OAuth template always needs a client
|
|
13
|
+
the org admin enters.
|
|
14
|
+
|
|
15
|
+
## Tools and policies
|
|
16
|
+
|
|
17
|
+
The template sets the endpoint header `X-MCP-Toolsets: context,repos,issues,pull_requests,users,actions`
|
|
18
|
+
(GitHub's default toolsets plus `actions` for CI status). The header and the URL are editable per
|
|
19
|
+
org (`editableEndpoint`): add toolsets, set `X-MCP-Readonly: true`, or point the URL at a GitHub
|
|
20
|
+
Enterprise Cloud data residency host (`https://copilot-api.<subdomain>.ghe.com/mcp`). GitHub
|
|
21
|
+
Enterprise Server has no remote MCP server.
|
|
22
|
+
|
|
23
|
+
`defaultToolPolicies` lists every tool of those toolsets in github/github-mcp-server (checked
|
|
24
|
+
2026-11-12, including the tools behind GitHub's feature flags): the read-only tools are `allow`,
|
|
25
|
+
every write is `ask` (creating issues and pull requests, comments, reviews, merging, pushing files,
|
|
26
|
+
branches, re-running workflows), and `delete_repository` is `deny`. GitHub's tool names use only
|
|
27
|
+
`[a-z0-9_]`, so every tool key is valid. A tool GitHub adds later gets the kernel's default from its
|
|
28
|
+
annotation (read-only: allow, else ask) and goes through the drift review.
|
|
29
|
+
|
|
30
|
+
## Setup guides
|
|
31
|
+
|
|
32
|
+
`guides/github-oauth.md` (template `github`: GitHub App settings, the OAuth App alternative, the
|
|
33
|
+
kernel checks `public-url`, `oauth-client`, `oauth-token-endpoint`, `connector-tools`, and how a
|
|
34
|
+
member connects and revokes), with a Chinese version. Preview with
|
|
35
|
+
`capybara-plugin guide github-oauth --audience admin` from this directory.
|
|
36
|
+
|
|
37
|
+
## Tests
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm exec vitest run plugins/github
|
|
41
|
+
# live, against GitHub (lists the tools and calls get_me; read-only):
|
|
42
|
+
CAPYBARA_TEST_LIVE_TOOLS=1 pnpm exec vitest run plugins/github/test/live -t live
|
|
43
|
+
```
|
|
44
|
+
|
|
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.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"displayName": {
|
|
3
|
+
"zh": "GitHub",
|
|
4
|
+
"en": "GitHub"
|
|
5
|
+
},
|
|
6
|
+
"description": "Issues, pull requests, reviews, repositories and Actions runs as the connected person, through GitHub's remote MCP server. Each member connects their own GitHub account with OAuth; an org admin registers a GitHub App (recommended) or OAuth App and enters its client here.",
|
|
7
|
+
"icon": "./icon.svg",
|
|
8
|
+
"template": {
|
|
9
|
+
"plugin": "connector-mcp",
|
|
10
|
+
"pluginVersion": "^0.1.0-rc.1",
|
|
11
|
+
"connector": "mcp",
|
|
12
|
+
"endpoint": {
|
|
13
|
+
"url": "https://api.githubcopilot.com/mcp/",
|
|
14
|
+
"headers": {
|
|
15
|
+
"X-MCP-Toolsets": "context,repos,issues,pull_requests,users,actions"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"editableEndpoint": ["url", "headers"],
|
|
19
|
+
"auth": {
|
|
20
|
+
"type": "oauth_code",
|
|
21
|
+
"ownership": "personal",
|
|
22
|
+
"discovery": "mcp",
|
|
23
|
+
"client": "manual",
|
|
24
|
+
"tokenAuthMethod": "client_secret_post",
|
|
25
|
+
"scopes": ["repo", "read:org", "read:user", "user:email", "workflow"]
|
|
26
|
+
},
|
|
27
|
+
"defaultToolPolicies": {
|
|
28
|
+
"get_me": "allow",
|
|
29
|
+
"get_teams": "allow",
|
|
30
|
+
"get_team_members": "allow",
|
|
31
|
+
"ui_get": "allow",
|
|
32
|
+
"get_commit": "allow",
|
|
33
|
+
"get_file_contents": "allow",
|
|
34
|
+
"get_file_blame": "allow",
|
|
35
|
+
"get_latest_release": "allow",
|
|
36
|
+
"get_release_by_tag": "allow",
|
|
37
|
+
"get_tag": "allow",
|
|
38
|
+
"list_branches": "allow",
|
|
39
|
+
"list_commits": "allow",
|
|
40
|
+
"list_releases": "allow",
|
|
41
|
+
"list_repository_collaborators": "allow",
|
|
42
|
+
"list_tags": "allow",
|
|
43
|
+
"search_code": "allow",
|
|
44
|
+
"search_commits": "allow",
|
|
45
|
+
"search_repositories": "allow",
|
|
46
|
+
"issue_read": "allow",
|
|
47
|
+
"list_issues": "allow",
|
|
48
|
+
"search_issues": "allow",
|
|
49
|
+
"list_issue_types": "allow",
|
|
50
|
+
"list_issue_fields": "allow",
|
|
51
|
+
"get_label": "allow",
|
|
52
|
+
"find_duplicate": "allow",
|
|
53
|
+
"issue_dependency_read": "allow",
|
|
54
|
+
"issue_artifact_read": "allow",
|
|
55
|
+
"pull_request_read": "allow",
|
|
56
|
+
"list_pull_requests": "allow",
|
|
57
|
+
"search_pull_requests": "allow",
|
|
58
|
+
"search_users": "allow",
|
|
59
|
+
"actions_get": "allow",
|
|
60
|
+
"actions_list": "allow",
|
|
61
|
+
"get_job_logs": "allow",
|
|
62
|
+
"create_branch": "ask",
|
|
63
|
+
"create_or_update_file": "ask",
|
|
64
|
+
"push_files": "ask",
|
|
65
|
+
"delete_file": "ask",
|
|
66
|
+
"create_repository": "ask",
|
|
67
|
+
"fork_repository": "ask",
|
|
68
|
+
"create_issue": "ask",
|
|
69
|
+
"issue_write": "ask",
|
|
70
|
+
"add_issue_comment": "ask",
|
|
71
|
+
"update_issue_comment": "ask",
|
|
72
|
+
"sub_issue_write": "ask",
|
|
73
|
+
"add_sub_issue": "ask",
|
|
74
|
+
"remove_sub_issue": "ask",
|
|
75
|
+
"reprioritize_sub_issue": "ask",
|
|
76
|
+
"set_issue_fields": "ask",
|
|
77
|
+
"update_issue_assignees": "ask",
|
|
78
|
+
"update_issue_body": "ask",
|
|
79
|
+
"update_issue_labels": "ask",
|
|
80
|
+
"update_issue_milestone": "ask",
|
|
81
|
+
"update_issue_state": "ask",
|
|
82
|
+
"update_issue_title": "ask",
|
|
83
|
+
"update_issue_type": "ask",
|
|
84
|
+
"issue_dependency_write": "ask",
|
|
85
|
+
"issue_artifact_write": "ask",
|
|
86
|
+
"add_issue_reaction": "ask",
|
|
87
|
+
"add_issue_comment_reaction": "ask",
|
|
88
|
+
"remove_issue_reaction": "ask",
|
|
89
|
+
"remove_issue_comment_reaction": "ask",
|
|
90
|
+
"hide_issue_comment": "ask",
|
|
91
|
+
"unhide_issue_comment": "ask",
|
|
92
|
+
"create_pull_request": "ask",
|
|
93
|
+
"update_pull_request": "ask",
|
|
94
|
+
"update_pull_request_branch": "ask",
|
|
95
|
+
"update_pull_request_body": "ask",
|
|
96
|
+
"update_pull_request_title": "ask",
|
|
97
|
+
"update_pull_request_state": "ask",
|
|
98
|
+
"update_pull_request_draft_state": "ask",
|
|
99
|
+
"merge_pull_request": "ask",
|
|
100
|
+
"request_pull_request_reviewers": "ask",
|
|
101
|
+
"pull_request_review_write": "ask",
|
|
102
|
+
"create_pull_request_review": "ask",
|
|
103
|
+
"submit_pending_pull_request_review": "ask",
|
|
104
|
+
"delete_pending_pull_request_review": "ask",
|
|
105
|
+
"add_comment_to_pending_review": "ask",
|
|
106
|
+
"add_pull_request_review_comment": "ask",
|
|
107
|
+
"add_reply_to_pull_request_comment": "ask",
|
|
108
|
+
"resolve_review_thread": "ask",
|
|
109
|
+
"unresolve_review_thread": "ask",
|
|
110
|
+
"add_pull_request_review_comment_reaction": "ask",
|
|
111
|
+
"remove_pull_request_review_comment_reaction": "ask",
|
|
112
|
+
"hide_pull_request_review": "ask",
|
|
113
|
+
"unhide_pull_request_review": "ask",
|
|
114
|
+
"hide_pull_request_review_comment": "ask",
|
|
115
|
+
"unhide_pull_request_review_comment": "ask",
|
|
116
|
+
"assign_copilot_to_issue": "ask",
|
|
117
|
+
"request_copilot_review": "ask",
|
|
118
|
+
"actions_run_trigger": "ask",
|
|
119
|
+
"delete_repository": "deny"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Set up the GitHub connector
|
|
2
|
+
|
|
3
|
+
The GitHub connector lets agents read and work on issues, pull requests, reviews, repository
|
|
4
|
+
files and Actions runs **as the person using them**, through GitHub's remote MCP server. Each
|
|
5
|
+
member connects their own GitHub account, so an agent sees and changes only what that person can,
|
|
6
|
+
and GitHub's audit log names that person.
|
|
7
|
+
|
|
8
|
+
::: audience admin
|
|
9
|
+
An org admin sets it up once: register an app on GitHub, then enter its client id and secret here.
|
|
10
|
+
Members connect afterwards.
|
|
11
|
+
|
|
12
|
+
## 1. Register a GitHub App (recommended)
|
|
13
|
+
|
|
14
|
+
A GitHub App gives members tokens limited to the permissions below and to the repositories the
|
|
15
|
+
app is installed on, and the tokens expire after eight hours (Capybara refreshes them).
|
|
16
|
+
|
|
17
|
+
Open **Settings → Developer settings → GitHub Apps → New GitHub App** of the GitHub organization
|
|
18
|
+
that owns your repositories (`https://github.com/organizations/<org>/settings/apps/new`) and fill
|
|
19
|
+
in the form as listed below. Leave everything not listed at its default.
|
|
20
|
+
|
|
21
|
+
```yaml title="GitHub App settings (GitHub connector)"
|
|
22
|
+
# GitHub App for the "{{templateName}}" connector template ({{pluginName}} {{pluginVersion}}).
|
|
23
|
+
# Reference: https://docs.github.com/apps/creating-github-apps (checked 2026-11-12).
|
|
24
|
+
GitHub App name: "Capybara connector"
|
|
25
|
+
Homepage URL: "{{publicUrl}}"
|
|
26
|
+
Callback URL: "{{oauthCallbackUrl}}"
|
|
27
|
+
Expire user authorization tokens: on
|
|
28
|
+
Request user authorization (OAuth) during installation: off
|
|
29
|
+
Enable Device Flow: off
|
|
30
|
+
Webhook Active: off
|
|
31
|
+
Repository permissions:
|
|
32
|
+
Actions: Read and write # read runs and logs, re-run workflows
|
|
33
|
+
Checks: Read-only
|
|
34
|
+
Commit statuses: Read-only
|
|
35
|
+
Contents: Read and write # files, branches, commits, merges
|
|
36
|
+
Issues: Read and write
|
|
37
|
+
Metadata: Read-only # mandatory
|
|
38
|
+
Pull requests: Read and write
|
|
39
|
+
Workflows: Read and write # change files under .github/workflows
|
|
40
|
+
Organization permissions:
|
|
41
|
+
Members: Read-only # teams
|
|
42
|
+
Account permissions:
|
|
43
|
+
Email addresses: Read-only
|
|
44
|
+
Where can this GitHub App be installed: Only on this account
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
::check capybara:public-url The platform has a public URL
|
|
48
|
+
|
|
49
|
+
Then **Install App** on the organization, for all repositories or the ones agents may touch. A
|
|
50
|
+
member's token never reaches further than both the member's own access and this installation.
|
|
51
|
+
|
|
52
|
+
### An OAuth App instead
|
|
53
|
+
|
|
54
|
+
An OAuth App (**Settings → Developer settings → OAuth Apps → New OAuth App**, authorization
|
|
55
|
+
callback URL `{{oauthCallbackUrl}}`) also works. Its tokens do not expire and carry the classic
|
|
56
|
+
scopes this template asks for (`repo`, `read:org`, `read:user`, `user:email`, `workflow`) across
|
|
57
|
+
every repository the member can reach. If the organization restricts OAuth App access, an owner
|
|
58
|
+
approves the app under **Settings → Third-party access**.
|
|
59
|
+
|
|
60
|
+
## 2. Enter the client
|
|
61
|
+
|
|
62
|
+
Copy the app's **Client ID**, generate a **client secret**, and enter both in the fields below. The
|
|
63
|
+
secret is stored encrypted and reads back only as "set".
|
|
64
|
+
|
|
65
|
+
::check capybara:oauth-client The client id and secret are entered
|
|
66
|
+
::check capybara:oauth-token-endpoint GitHub accepts the client id and secret
|
|
67
|
+
::check capybara:connector-tools A member connected and the tool list was read
|
|
68
|
+
|
|
69
|
+
## Tools and approvals
|
|
70
|
+
|
|
71
|
+
The template turns on GitHub's `context`, `repos`, `issues`, `pull_requests`, `users` and
|
|
72
|
+
`actions` toolsets (the endpoint header `X-MCP-Toolsets`; edit it to add or remove toolsets).
|
|
73
|
+
Reads run directly. Writes (creating issues and pull requests, comments and reviews, merging,
|
|
74
|
+
pushing files, creating branches, re-running workflows) ask the member first, and deleting a
|
|
75
|
+
repository is denied. Change any of these per tool on the connector page.
|
|
76
|
+
|
|
77
|
+
For GitHub Enterprise Cloud with data residency, change the endpoint URL to
|
|
78
|
+
`https://copilot-api.<your-subdomain>.ghe.com/mcp` and register the app on that host.
|
|
79
|
+
:::
|
|
80
|
+
|
|
81
|
+
::: audience member
|
|
82
|
+
## Connect your GitHub account
|
|
83
|
+
|
|
84
|
+
Choose **Connect** and approve on GitHub's consent screen. Agents then act on GitHub as you, and
|
|
85
|
+
writes ask you first unless your admin changed that. An agent sees only the repositories you can
|
|
86
|
+
see and, with a GitHub App, only those the app is installed on.
|
|
87
|
+
|
|
88
|
+
**Disconnect** deletes the token in Capybara. To revoke it at GitHub too, open
|
|
89
|
+
**Settings → Applications → Authorized GitHub Apps** (or **Authorized OAuth Apps**) and revoke
|
|
90
|
+
the app.
|
|
91
|
+
|
|
92
|
+
::check capybara:connector-connected Your GitHub account is connected
|
|
93
|
+
:::
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# 设置 GitHub 连接器
|
|
2
|
+
|
|
3
|
+
GitHub 连接器让智能体**以使用者本人的身份**处理 issue、拉取请求、评审、仓库文件和 Actions 运行,经由
|
|
4
|
+
GitHub 的远程 MCP 服务器。每位成员连接自己的 GitHub 账号,所以智能体只能看到和修改这个人能看到和修改的
|
|
5
|
+
内容,GitHub 的审计日志里记的也是这个人。
|
|
6
|
+
|
|
7
|
+
::: audience admin
|
|
8
|
+
组织管理员只需设置一次:在 GitHub 上注册一个应用,再把它的 client id 和 secret 填到这里。之后成员各自连接。
|
|
9
|
+
|
|
10
|
+
## 1. 注册 GitHub App(推荐)
|
|
11
|
+
|
|
12
|
+
GitHub App 发给成员的令牌只有下面列出的权限,只能访问安装了这个应用的仓库,并且八小时后过期(Capybara
|
|
13
|
+
会自动刷新)。
|
|
14
|
+
|
|
15
|
+
打开存放仓库的 GitHub 组织的 **Settings → Developer settings → GitHub Apps → New GitHub App**
|
|
16
|
+
(`https://github.com/organizations/<org>/settings/apps/new`),按下面填写,未列出的项保持默认。
|
|
17
|
+
|
|
18
|
+
```yaml title="GitHub App 设置(GitHub 连接器)"
|
|
19
|
+
# GitHub App for the "{{templateName}}" connector template ({{pluginName}} {{pluginVersion}}).
|
|
20
|
+
# Reference: https://docs.github.com/apps/creating-github-apps (checked 2026-11-12).
|
|
21
|
+
GitHub App name: "Capybara connector"
|
|
22
|
+
Homepage URL: "{{publicUrl}}"
|
|
23
|
+
Callback URL: "{{oauthCallbackUrl}}"
|
|
24
|
+
Expire user authorization tokens: on
|
|
25
|
+
Request user authorization (OAuth) during installation: off
|
|
26
|
+
Enable Device Flow: off
|
|
27
|
+
Webhook Active: off
|
|
28
|
+
Repository permissions:
|
|
29
|
+
Actions: Read and write # read runs and logs, re-run workflows
|
|
30
|
+
Checks: Read-only
|
|
31
|
+
Commit statuses: Read-only
|
|
32
|
+
Contents: Read and write # files, branches, commits, merges
|
|
33
|
+
Issues: Read and write
|
|
34
|
+
Metadata: Read-only # mandatory
|
|
35
|
+
Pull requests: Read and write
|
|
36
|
+
Workflows: Read and write # change files under .github/workflows
|
|
37
|
+
Organization permissions:
|
|
38
|
+
Members: Read-only # teams
|
|
39
|
+
Account permissions:
|
|
40
|
+
Email addresses: Read-only
|
|
41
|
+
Where can this GitHub App be installed: Only on this account
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
::check capybara:public-url 平台有公网地址
|
|
45
|
+
|
|
46
|
+
然后在组织上 **Install App**,选择全部仓库或允许智能体操作的那些仓库。成员令牌的范围永远不会超出成员本人的
|
|
47
|
+
权限与这次安装的交集。
|
|
48
|
+
|
|
49
|
+
### 改用 OAuth App
|
|
50
|
+
|
|
51
|
+
也可以用 OAuth App(**Settings → Developer settings → OAuth Apps → New OAuth App**,授权回调地址填
|
|
52
|
+
`{{oauthCallbackUrl}}`)。它的令牌不会过期,带着本模板申请的经典 scope(`repo`、`read:org`、`read:user`、
|
|
53
|
+
`user:email`、`workflow`),覆盖成员能访问的所有仓库。如果组织限制了 OAuth App 访问,需要组织所有者在
|
|
54
|
+
**Settings → Third-party access** 里批准这个应用。
|
|
55
|
+
|
|
56
|
+
## 2. 填写客户端
|
|
57
|
+
|
|
58
|
+
复制应用的 **Client ID**,生成一个 **client secret**,把两者填到下面的字段里。secret 加密保存,之后只显示「已设置」。
|
|
59
|
+
|
|
60
|
+
::check capybara:oauth-client 已填写 client id 和 secret
|
|
61
|
+
::check capybara:oauth-token-endpoint GitHub 接受这个 client id 和 secret
|
|
62
|
+
::check capybara:connector-tools 已有成员连接并读到工具列表
|
|
63
|
+
|
|
64
|
+
## 工具与审批
|
|
65
|
+
|
|
66
|
+
本模板开启 GitHub 的 `context`、`repos`、`issues`、`pull_requests`、`users` 和 `actions` 工具集(端点请求头
|
|
67
|
+
`X-MCP-Toolsets`,可编辑以增减工具集)。读取类操作直接执行;写入(创建 issue 和拉取请求、评论与评审、合并、
|
|
68
|
+
推送文件、创建分支、重新运行工作流)会先征求成员同意;删除仓库默认禁止。每个工具的策略都可以在连接器页面单独修改。
|
|
69
|
+
|
|
70
|
+
使用带数据驻留的 GitHub Enterprise Cloud 时,把端点地址改为
|
|
71
|
+
`https://copilot-api.<your-subdomain>.ghe.com/mcp`,并在那个域名上注册应用。
|
|
72
|
+
:::
|
|
73
|
+
|
|
74
|
+
::: audience member
|
|
75
|
+
## 连接你的 GitHub 账号
|
|
76
|
+
|
|
77
|
+
选择**连接**,在 GitHub 的授权页面上同意。之后智能体以你的身份操作 GitHub,写入操作会先问你(除非管理员改了
|
|
78
|
+
设置)。智能体只能看到你能看到的仓库;使用 GitHub App 时,还只限于安装了这个应用的仓库。
|
|
79
|
+
|
|
80
|
+
**断开连接**会删除 Capybara 里的令牌。如果还要在 GitHub 上吊销,打开 **Settings → Applications →
|
|
81
|
+
Authorized GitHub Apps**(或 **Authorized OAuth Apps**)撤销这个应用。
|
|
82
|
+
|
|
83
|
+
::check capybara:connector-connected 你的 GitHub 账号已连接
|
|
84
|
+
:::
|
package/icon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18"><title>GitHub</title><path fill="#1f2328" d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-github",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
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
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/capybara-hq/plugins.git",
|
|
10
|
+
"directory": "plugins/github"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/capybara-hq/plugins/tree/main/plugins/github#readme"
|
|
13
|
+
}
|