@capybara-hq/plugin-github 0.0.0-stage → 0.1.0-rc.0

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.
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://capybarahq.com/schemas/plugin.v1.schema.json",
3
+ "schemaVersion": 1,
4
+ "name": "github",
5
+ "version": "0.1.0-rc.0",
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. Members connect with OAuth (a GitHub App or OAuth App the org admin registers) or, when the admin allows it, a personal access token",
9
+ "zh": "智能体以连接者本人的身份使用 GitHub:issue、拉取请求、评审、仓库与 Actions 运行,经 GitHub 的远程 MCP 服务器。成员用 OAuth(组织管理员注册的 GitHub App 或 OAuth App)连接,或在管理员允许时用个人访问令牌连接"
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
+ "path": "./connectors/github-pat.json"
29
+ }
30
+ ],
31
+ "setupGuides": [
32
+ {
33
+ "id": "github-oauth",
34
+ "place": "connector-template",
35
+ "template": "github"
36
+ },
37
+ {
38
+ "id": "github-pat",
39
+ "place": "connector-template",
40
+ "template": "github-pat"
41
+ }
42
+ ]
43
+ }
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
@@ -0,0 +1,2 @@
1
+ Capybara
2
+ Copyright 2026 Meta-1 (Tianjin Yuanyilian Technology Co., Ltd.)
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @capybara-hq/plugin-github
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ GitHub connector templates (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
+ | `github-pat` | Per-person personal access token (`bearer`) | off: an org admin switches it on where tokens are allowed |
12
+
13
+ GitHub does not support dynamic client registration, so the OAuth template always needs a client
14
+ the org admin enters.
15
+
16
+ ## Tools and policies
17
+
18
+ Both templates set the endpoint header `X-MCP-Toolsets: context,repos,issues,pull_requests,users,actions`
19
+ (GitHub's default toolsets plus `actions` for CI status). The header and the URL are editable per
20
+ org (`editableEndpoint`): add toolsets, set `X-MCP-Readonly: true`, or point the URL at a GitHub
21
+ Enterprise Cloud data residency host (`https://copilot-api.<subdomain>.ghe.com/mcp`). GitHub
22
+ Enterprise Server has no remote MCP server.
23
+
24
+ `defaultToolPolicies` lists every tool of those toolsets in github/github-mcp-server (checked
25
+ 2026-11-12, including the tools behind GitHub's feature flags): the read-only tools are `allow`,
26
+ every write is `ask` (creating issues and pull requests, comments, reviews, merging, pushing files,
27
+ branches, re-running workflows), and `delete_repository` is `deny`. GitHub's tool names use only
28
+ `[a-z0-9_]`, so every tool key is valid. A tool GitHub adds later gets the kernel's default from its
29
+ annotation (read-only: allow, else ask) and goes through the drift review.
30
+
31
+ ## Setup guides
32
+
33
+ `guides/github-oauth.md` (template `github`: GitHub App settings, the OAuth App alternative, the
34
+ kernel checks `public-url`, `oauth-client`, `oauth-token-endpoint`, `connector-tools`, and how a
35
+ member connects and revokes) and `guides/github-pat.md` (template `github-pat`: when to allow
36
+ tokens, and the fine-grained token a member creates), each with a Chinese version. Preview with
37
+ `capybara-plugin guide github-oauth --audience admin` from this directory.
38
+
39
+ ## Tests
40
+
41
+ ```bash
42
+ pnpm exec vitest run plugins/github
43
+ # live, against GitHub (opens and closes an issue in the scratch repository):
44
+ CAPYBARA_TEST_LIVE_TOOLS=1 pnpm exec vitest run plugins/github/test/live -t live
45
+ ```
46
+
47
+ The live test needs `CAPYBARA_TEST_GITHUB_MCP_TOKEN` (a personal access token) and
48
+ `CAPYBARA_TEST_GITHUB_REPO` (`owner/name`). Keep them in an env file outside the repository.
@@ -0,0 +1,119 @@
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
+ }
@@ -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
+ :::
@@ -0,0 +1,58 @@
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
+ :::
@@ -0,0 +1,53 @@
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
+ :::
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.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-rc.0",
4
+ "type": "module",
5
+ "license": "Apache-2.0",
6
+ "description": "GitHub connector templates: issues, pull requests, reviews, repositories and Actions through GitHub's remote MCP server, as the connected person (GitHub App / OAuth App or a personal access token)",
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
+ }