copilot-agents-mcp 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +248 -2
- package/dist/auth.js +584 -0
- package/dist/cli.js +328 -0
- package/dist/errors.js +197 -0
- package/dist/github.js +321 -0
- package/dist/http.js +77 -0
- package/dist/keyring.js +39 -0
- package/dist/notify.js +129 -0
- package/dist/selection.js +115 -0
- package/dist/server.js +389 -0
- package/dist/state.js +324 -0
- package/dist/swe-models.js +226 -0
- package/dist/watch.js +180 -0
- package/fixtures/openapi/create-task.request.json +45 -0
- package/fixtures/openapi/create-task.response.json +234 -0
- package/fixtures/openapi/get-task.response.json +413 -0
- package/package.json +49 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Daniel Saez Vilarrubia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,249 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo.svg" width="128" alt="copilot-agents-mcp">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# copilot-agents-mcp
|
|
6
|
+
|
|
7
|
+
`copilot-agents-mcp` is a local Model Context Protocol (MCP) server for launching and managing GitHub Copilot cloud agent tasks.
|
|
8
|
+
It runs on your machine over stdio or local HTTP. Version 0.0.1 requires Node.js 26 or later.
|
|
9
|
+
|
|
10
|
+
```mermaid
|
|
11
|
+
flowchart LR
|
|
12
|
+
C[MCP client] -->|stdio| M[copilot-agents-mcp]
|
|
13
|
+
M -->|GitHub App device flow or PAT| A[GitHub authentication]
|
|
14
|
+
M -->|GitHub Copilot cloud agent tasks API| G[GitHub]
|
|
15
|
+
M --> N[Local state and watcher]
|
|
16
|
+
N -->|system notification and optional POST| U[Notification receiver]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
The package is not published to npm. Run it directly from this repository:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx -y github:daniel-saezv/copilot-agents-mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The default server uses stdio. To use local HTTP, run:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx -y github:daniel-saezv/copilot-agents-mcp --http --port 3333
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The HTTP endpoint is `http://127.0.0.1:3333/mcp`.
|
|
34
|
+
|
|
35
|
+
## Authentication
|
|
36
|
+
|
|
37
|
+
Use one of these credential modes:
|
|
38
|
+
|
|
39
|
+
- **Personal access token.** Set `GITHUB_PERSONAL_ACCESS_TOKEN` in the MCP process environment.
|
|
40
|
+
- **GitHub App.** Run `npx -y github:daniel-saezv/copilot-agents-mcp login`, complete the device flow, and leave `GITHUB_PERSONAL_ACCESS_TOKEN` unset.
|
|
41
|
+
|
|
42
|
+
Check the active credential with:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx -y github:daniel-saezv/copilot-agents-mcp auth status
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
See [authentication](docs/authentication.md) and [permissions](docs/permissions.md).
|
|
49
|
+
|
|
50
|
+
## Configure your MCP client
|
|
51
|
+
|
|
52
|
+
Every example below has two variants:
|
|
53
|
+
|
|
54
|
+
- PAT: keep the `env` block and do not run `login`.
|
|
55
|
+
- GitHub App: run `login`, then remove the `env` block.
|
|
56
|
+
|
|
57
|
+
The command is the same in each client. Replace `github_pat_...` with a token that has the required permissions.
|
|
58
|
+
|
|
59
|
+
### Visual Studio Code
|
|
60
|
+
|
|
61
|
+
Create `.vscode/mcp.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"servers": {
|
|
66
|
+
"copilot-agents": {
|
|
67
|
+
"type": "stdio",
|
|
68
|
+
"command": "npx",
|
|
69
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"],
|
|
70
|
+
"env": {
|
|
71
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_..."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For GitHub App authentication, run `login` once and use this variant:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"servers": {
|
|
83
|
+
"copilot-agents": {
|
|
84
|
+
"type": "stdio",
|
|
85
|
+
"command": "npx",
|
|
86
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Claude Desktop
|
|
93
|
+
|
|
94
|
+
Add this server to `claude_desktop_config.json`:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"copilot-agents": {
|
|
100
|
+
"command": "npx",
|
|
101
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"],
|
|
102
|
+
"env": {
|
|
103
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_..."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
For GitHub App authentication, run `login` once and use this variant:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"copilot-agents": {
|
|
116
|
+
"command": "npx",
|
|
117
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Claude Code
|
|
124
|
+
|
|
125
|
+
For a PAT, register the local stdio server:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
claude mcp add --transport stdio copilot-agents \
|
|
129
|
+
-e GITHUB_PERSONAL_ACCESS_TOKEN=github_pat_... \
|
|
130
|
+
-- npx -y github:daniel-saezv/copilot-agents-mcp
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
For GitHub App authentication, run the server `login` command first. Then register it without `-e`:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npx -y github:daniel-saezv/copilot-agents-mcp login
|
|
137
|
+
claude mcp add --transport stdio copilot-agents \
|
|
138
|
+
-- npx -y github:daniel-saezv/copilot-agents-mcp
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Cursor
|
|
142
|
+
|
|
143
|
+
Create `.cursor/mcp.json`:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"copilot-agents": {
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"],
|
|
151
|
+
"env": {
|
|
152
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_..."
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
For GitHub App authentication, run `login` once and use this variant:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"mcpServers": {
|
|
164
|
+
"copilot-agents": {
|
|
165
|
+
"command": "npx",
|
|
166
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Grok Bot
|
|
173
|
+
|
|
174
|
+
Configure Grok Bot as a local MCP server over stdio with:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"mcpServers": {
|
|
179
|
+
"copilot-agents": {
|
|
180
|
+
"command": "npx",
|
|
181
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"],
|
|
182
|
+
"env": {
|
|
183
|
+
"GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_..."
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
For GitHub App authentication, run `login` once and use this variant:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"mcpServers": {
|
|
195
|
+
"copilot-agents": {
|
|
196
|
+
"command": "npx",
|
|
197
|
+
"args": ["-y", "github:daniel-saezv/copilot-agents-mcp"]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Tools
|
|
204
|
+
|
|
205
|
+
<!-- START AUTOMATED TOOLS -->
|
|
206
|
+
| Tool | Toolset | Read-only | Description |
|
|
207
|
+
| --- | --- | --- | --- |
|
|
208
|
+
| `create_agent_task` | copilot_tasks | no | Launch a GitHub Copilot cloud agent task. The model is sent unchanged. If the model was already rejected, the tool skips the API call and lists accepted models observed so far. |
|
|
209
|
+
| `get_agent_task` | copilot_tasks | yes | Read a GitHub Copilot agent task once. |
|
|
210
|
+
| `steer_agent_task` | copilot_tasks | no | [Experimental] Undocumented internal GitHub endpoint that can change without notice. Each steer consumes credits. The agent applies the instruction after its current tool call finishes. Send an instruction to a task with an open pull request. |
|
|
211
|
+
| `abort_agent_task` | copilot_tasks | no | [Experimental] Undocumented internal GitHub endpoint that can change without notice. Send {type: "abort"} to the steer endpoint, as VS Code does in tasksClient.ts, to stop the task. This has not been verified against GitHub. |
|
|
212
|
+
| `get_agent_task_events` | copilot_tasks | yes | [Experimental] Undocumented internal GitHub endpoint that can change without notice. Read one page of task events (read-only). |
|
|
213
|
+
| `list_copilot_models` | copilot_models | yes | Read /agents/swe/models and return the ID, name, vendor, preview flag, token prices or multiplier, and promotion when present. |
|
|
214
|
+
<!-- END AUTOMATED TOOLS -->
|
|
215
|
+
|
|
216
|
+
See [the tool reference](docs/tools.md) for all input and output fields.
|
|
217
|
+
|
|
218
|
+
## Watch tasks
|
|
219
|
+
|
|
220
|
+
`create_agent_task` starts a detached watcher. You can also start it directly:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npx -y github:daniel-saezv/copilot-agents-mcp watch
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The watcher polls pending tasks, stores local state, and sends completion notifications. See [notifications](docs/notifications.md).
|
|
227
|
+
|
|
228
|
+
## Release
|
|
229
|
+
|
|
230
|
+
Push a tag `vMAJOR.MINOR.PATCH`. The release workflow checks that the tag (without the leading `v`) matches `version` in `package.json`, then runs typecheck, lint, tests, build, and a package smoke test on Node 26 before publishing to npm with `--provenance --access public`.
|
|
231
|
+
|
|
232
|
+
The first publish (0.0.1) needs the `NPM_TOKEN` repository secret: [Trusted Publishing](https://docs.npmjs.com/trusted-publishers/) requires the package to already exist on npm. The workflow tries OIDC first and falls back to `NPM_TOKEN` when that fails. After 0.0.1 is on npm, add this repo and workflow as a trusted publisher on [npmjs.com](https://www.npmjs.com/), then remove the `NPM_TOKEN` secret so later releases use OIDC only.
|
|
233
|
+
|
|
234
|
+
## Test and build
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
bash scripts/setup
|
|
238
|
+
npm test
|
|
239
|
+
npm run typecheck
|
|
240
|
+
npm run lint
|
|
241
|
+
npm run build
|
|
242
|
+
node scripts/pack-smoke.mjs
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Agent development instructions remain in [AGENTS.md](AGENTS.md).
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
[MIT](LICENSE)
|