@cursor/july 0.1.68 → 0.1.73
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/AGENTS.md +4 -5
- package/README.md +23 -11
- package/dist/bin/agent-serve.js +3 -2
- package/dist/channels/github/api.d.ts +2 -0
- package/dist/channels/github/api.d.ts.map +1 -1
- package/dist/channels/github/api.js +2 -1
- package/dist/channels/github/binding.d.ts +7 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +4 -0
- package/dist/channels/github/checks.d.ts +99 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +108 -0
- package/dist/channels/github/cursor-account.d.ts +4 -4
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +7 -5
- package/dist/channels/github/index.d.ts +1 -0
- package/dist/channels/github/index.d.ts.map +1 -1
- package/dist/channels/github/index.js +1 -0
- package/dist/channels/github/types.d.ts +8 -0
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/slack/manifest.d.ts +2 -2
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +13 -11
- package/dist/channels/slack/types.d.ts +2 -2
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +17 -5
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -5
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.C5XUTCw9.js → app.CdbcFD8T.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DQad--_z.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CGDTAYHY.js → VPLocalSearchBox.D_NKImM7.js} +1 -1
- package/dist/docs/assets/chunks/{theme.lPixh250.js → theme.CMvz7cu9.js} +2 -2
- package/dist/docs/assets/{concepts.md.CqOsxbMU.js → concepts.md.BXAm6G-C.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.js → guides_mcp-oauth.md.CzEB6RaG.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.js → reference_agent-config.md.BZnEKfEc.js} +3 -4
- package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.lean.js → reference_agent-config.md.BZnEKfEc.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Bwswbm6H.js → reference_connections.md.Cu3N-S3Q.js} +18 -11
- package/dist/docs/assets/{reference_connections.md.Bwswbm6H.lean.js → reference_connections.md.Cu3N-S3Q.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.js → reference_tools.md.DTg_kEsx.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.DQ-hYuZT.js +1 -0
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/deployment.html +3 -3
- package/dist/docs/evals.html +3 -3
- package/dist/docs/example-agents/approval-buddy.html +3 -3
- package/dist/docs/example-agents/benny.html +3 -3
- package/dist/docs/example-agents/bugbot.html +3 -3
- package/dist/docs/example-agents/codebase-wiki.html +3 -3
- package/dist/docs/example-agents/codeowners-review.html +3 -3
- package/dist/docs/example-agents/concierge.html +3 -3
- package/dist/docs/example-agents/fsd.html +3 -3
- package/dist/docs/example-agents/index.html +3 -3
- package/dist/docs/example-agents/knowledge-base.html +3 -3
- package/dist/docs/example-agents/oncall.html +3 -3
- package/dist/docs/example-agents/security-reviewer.html +3 -3
- package/dist/docs/example-agents/slack-agent.html +3 -3
- package/dist/docs/example-agents/weather-agent.html +3 -3
- package/dist/docs/guides/agent-to-agent.html +3 -3
- package/dist/docs/guides/cloud-runtime.html +3 -3
- package/dist/docs/guides/convert-automation.html +3 -3
- package/dist/docs/guides/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +3 -3
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/opentelemetry.html +3 -3
- package/dist/docs/guides/slack.html +3 -3
- package/dist/docs/guides/webhooks.html +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +3 -3
- package/dist/docs/quickstart.html +3 -3
- package/dist/docs/reference/agent-config.html +5 -6
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +3 -3
- package/dist/docs/reference/connections.html +20 -13
- package/dist/docs/reference/hooks.html +3 -3
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/prompt.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +5 -5
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +3 -3
- package/dist/docs/templates/agentic-owners.html +3 -3
- package/dist/docs/templates/demo.html +3 -3
- package/dist/docs/templates/pr-autofixer.html +3 -3
- package/dist/docs/templates/security-reviewer.html +3 -3
- package/dist/docs/templates/triage.html +3 -3
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/internal/advertise-tools.d.ts +11 -6
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +63 -30
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -4
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +2 -10
- package/dist/internal/cursor/account-mcp.d.ts +29 -3
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +147 -67
- package/dist/internal/cursor/backend-client.d.ts +11 -6
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +32 -10
- package/dist/internal/cursor-account-mcp-auth.d.ts +11 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +69 -0
- package/dist/internal/deploy-client.d.ts +0 -7
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +2 -4
- package/dist/internal/deploy-manifest.d.ts +15 -24
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +38 -27
- package/dist/internal/deployment-scm-event-stream.d.ts +4 -1
- package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -1
- package/dist/internal/deployment-scm-event-stream.js +15 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +42 -10
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +7 -106
- package/dist/internal/init-scaffold.d.ts +8 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +168 -0
- package/dist/internal/inline-stdio-mcp.d.ts +2 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
- package/dist/internal/inline-stdio-mcp.js +10 -8
- package/dist/internal/json-schema.d.ts +7 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -3
- package/dist/internal/mcp-endpoint.js +7 -7
- package/dist/internal/mcp-host.js +4 -2
- package/dist/internal/mcp-oauth.d.ts +22 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +40 -1
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +5 -5
- package/dist/internal/review-comments.d.ts +97 -0
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +151 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +30 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +4 -6
- package/dist/internal/shallow-clone.d.ts +94 -39
- package/dist/internal/shallow-clone.d.ts.map +1 -1
- package/dist/internal/shallow-clone.js +188 -68
- package/dist/internal/terminal-style.d.ts +18 -0
- package/dist/internal/terminal-style.d.ts.map +1 -1
- package/dist/internal/terminal-style.js +46 -1
- package/dist/internal/workspace.d.ts +2 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +5 -0
- package/dist/playground/assets/index-77uhu5Kr.css +1 -0
- package/dist/playground/assets/{index-yxs1heea.js → index-D4buox4m.js} +42 -42
- package/dist/playground/index.html +2 -2
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +28 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/concepts.md +4 -4
- package/docs/guides/mcp-oauth.md +3 -1
- package/docs/reference/agent-config.md +11 -12
- package/docs/reference/connections.md +44 -26
- package/docs/reference/sessions.md +2 -2
- package/docs/reference/tools.md +1 -1
- package/docs/troubleshooting.md +3 -2
- package/package.json +4 -1
- package/skills/create-agent/SKILL.md +12 -9
- package/skills/debug/SKILL.md +2 -1
- package/skills/framework-map/SKILL.md +6 -6
- package/skills/mcp-auth/SKILL.md +8 -6
- package/src/bin/agent-serve.ts +3 -2
- package/src/channels/github/api.ts +6 -1
- package/src/channels/github/binding.ts +21 -0
- package/src/channels/github/checks.ts +179 -0
- package/src/channels/github/cursor-account.ts +9 -6
- package/src/channels/github/index.ts +1 -0
- package/src/channels/github/types.ts +8 -0
- package/src/channels/slack/manifest.ts +8 -10
- package/src/channels/slack/types.ts +2 -2
- package/src/connections.ts +17 -5
- package/src/internal/advertise-tools.ts +72 -23
- package/src/internal/cli-deploy.ts +4 -15
- package/src/internal/convert-automation/convert-workflow.ts +2 -11
- package/src/internal/cursor/account-mcp.ts +208 -73
- package/src/internal/cursor/backend-client.ts +45 -11
- package/src/internal/cursor-account-mcp-auth.ts +83 -0
- package/src/internal/deploy-client.ts +0 -10
- package/src/internal/deploy-manifest.ts +33 -39
- package/src/internal/deployment-scm-event-stream.ts +17 -1
- package/src/internal/discovery.ts +47 -3
- package/src/internal/init-project.ts +7 -133
- package/src/internal/init-scaffold.ts +176 -0
- package/src/internal/inline-stdio-mcp.ts +13 -0
- package/src/internal/json-schema.ts +24 -3
- package/src/internal/mcp-endpoint.ts +6 -0
- package/src/internal/mcp-host.ts +4 -0
- package/src/internal/mcp-oauth.ts +55 -1
- package/src/internal/package-inline-stdio.ts +5 -1
- package/src/internal/review-comments.ts +245 -0
- package/src/internal/sanitize-mcp-tool-name.ts +33 -0
- package/src/internal/session-engine.ts +7 -0
- package/src/internal/shallow-clone.ts +293 -105
- package/src/internal/terminal-style.ts +67 -1
- package/src/internal/workspace.ts +6 -0
- package/src/tools.ts +7 -0
- package/src/types.ts +32 -4
- package/templates/agentic-owners/agent/agent.ts +3 -0
- package/templates/demo/agent/agent.ts +3 -0
- package/templates/security-reviewer/agent/agent.ts +3 -0
- package/templates/triage/agent/agent.ts +3 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DvUR3lv9.js +0 -1
- package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
- package/dist/playground/assets/index-CoL7xCJl.css +0 -1
- /package/dist/docs/assets/{concepts.md.CqOsxbMU.lean.js → concepts.md.BXAm6G-C.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.lean.js → guides_mcp-oauth.md.CzEB6RaG.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.lean.js → reference_sessions.md.B0DdlM-K.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.Wmvb7Lob.lean.js → reference_tools.md.DTg_kEsx.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
|
@@ -62,7 +62,7 @@ questions, concrete options, the recommended option listed first and labeled
|
|
|
62
62
|
| **Runtime** | `local` (default) · `cloud` | Local = Cursor SDK harness on this machine; server tools, skills, sandbox seeds, and tool approvals all work. Cloud = Cursor cloud agents; needs `cloud.repos`, no server tools/skills/sandbox seeds (instructions are prepended to the first prompt). Recommend local unless the purpose needs a repo checkout on a cloud VM. |
|
|
63
63
|
| **Model** | `grok-4.5` with `effort=high`, `fast=true` (default) · Other model id | Effort and fast are params, not id suffixes: `{ id: "grok-4.5", params: [{ id: "effort", value: "high" }, { id: "fast", value: "true" }] }` — the SDK rejects suffix-style ids. |
|
|
64
64
|
| **Channels** (multi) | playground + HTTP API only (always mounted) · Slack · GitHub webhooks · custom webhook · schedule (cron) | Slack has two connections: the Cursor-hosted connection (`cursorAccount: true` — zero Slack admin, recommended default) and a dedicated Socket Mode app (own bot user + one app/token pair per agent; needed for channel watching or approval buttons). When Slack is picked, resolve the connection with the Step 0 gate in `setup-slack/SKILL.md` — either fold its AskQuestion into this round or ask it before channel setup; default to Cursor-hosted when you cannot ask. GitHub verifies `X-Hub-Signature-256` when a secret is set. Discord/Teams packs do not exist yet — offer custom webhook instead. |
|
|
65
|
-
| **MCP connections** (multi) | none · remote server (URL + header auth) · local stdio server · Other | One file per server under `agent/mcp-connections/`; filename = server name;
|
|
65
|
+
| **MCP connections** (multi) | none · remote server (URL + header auth) · local stdio server · Cursor account connectors · Other | One file per server under `agent/mcp-connections/`; filename = server name. Do not name an account connection `cursor.ts` (collides with the IDE `cursor` namespace); use `account.ts`. Tokens via env vars, never hardcoded. Connections serve the model and host code (`ctx.host.mcp`). If the model should call them by name on local turns, set `advertiseTools: true`. Set `hostOnly: true` only when host tools call the server and the playground must not. |
|
|
66
66
|
| **Capabilities** (multi) | server tools · agent tools (scripts) · skills · subagents · hooks · sandbox seed files · tool approvals (HITL) · evals (recommend) | Server tools, skills, sandbox seeds, approvals are local-runtime only. Agent tools (`execution: "agent"`) work on both runtimes. Always recommend at least one smoke eval. |
|
|
67
67
|
|
|
68
68
|
Close the round with a one-screen plan — chosen options plus the file tree you
|
|
@@ -87,6 +87,10 @@ Defaults that make first cuts good:
|
|
|
87
87
|
|
|
88
88
|
- **Minimal surface.** Instructions + 1–2 real tools + the chosen channels +
|
|
89
89
|
one smoke eval. Unpicked capabilities are follow-ups, not scope.
|
|
90
|
+
- **`local.cwd`.** Keep the harness outside a monorepo checkout
|
|
91
|
+
(`~/.cache/agent-serve/<slug>`). Discovery does this for nested git
|
|
92
|
+
projects. Point cwd at a checkout only when the agent must inherit that
|
|
93
|
+
tree.
|
|
90
94
|
- **Instructions** (`agent/instructions.md`, required): a few lines — identity,
|
|
91
95
|
when to use which tool, output shape. Not an essay.
|
|
92
96
|
- **Tool per file**, filename = tool name the model sees. Prefer
|
|
@@ -139,9 +143,9 @@ agent-sdk init ./<slug>
|
|
|
139
143
|
```
|
|
140
144
|
|
|
141
145
|
`init` writes `package.json` (with `typescript` dev deps and a
|
|
142
|
-
`check` script), `tsconfig.json`, `
|
|
143
|
-
a demo `agent/tools/echo.ts`, and empty capability
|
|
144
|
-
(`skills/`, `channels/`, `evals/`, …) each with a `.gitkeep`; existing
|
|
146
|
+
`check` script), `tsconfig.json`, `AGENTS.md`, `.gitignore`, `agent/agent.ts`,
|
|
147
|
+
`agent/instructions.md`, a demo `agent/tools/echo.ts`, and empty capability
|
|
148
|
+
folders (`skills/`, `channels/`, `evals/`, …) each with a `.gitkeep`; existing
|
|
145
149
|
files are left alone (`exist`) and missing ones are filled in. It then
|
|
146
150
|
runs `npm install`, and when the host is unsigned runs `login` and waits
|
|
147
151
|
before printing `cd` (when needed) and `agent-sdk dev`. Then shape it to the
|
|
@@ -149,8 +153,7 @@ plan:
|
|
|
149
153
|
|
|
150
154
|
1. `tsconfig.json` — init writes a strict, `noEmit` config covering `agent/`
|
|
151
155
|
and `evals/`; extend it only when the project needs more.
|
|
152
|
-
2. `agent/agent.ts` — chosen model/runtime via `defineAgent({...})
|
|
153
|
-
`cloud: { repos: [...] }` block for cloud runtime.
|
|
156
|
+
2. `agent/agent.ts` — chosen model/runtime via `defineAgent({...})`. Nested git checkouts get `local.cwd` under `~/.cache/agent-serve/<slug>` at discovery even if omitted. Add the `cloud: { repos: [...] }` block for cloud runtime.
|
|
154
157
|
3. `agent/instructions.md` — real instructions; delete or replace `echo.ts`
|
|
155
158
|
with the real tools.
|
|
156
159
|
4. Add the chosen `channels/`, `mcp-connections/`, `skills/`, `subagents/<id>/`
|
|
@@ -210,9 +213,9 @@ agent-sdk eval --dir ./<slug>
|
|
|
210
213
|
|
|
211
214
|
Serve only the new agent's directory during bring-up — pointing `serve` at a
|
|
212
215
|
parent folder also mounts every sibling agent it contains.
|
|
213
|
-
Runtime state lands in `<project>/.agent-serve/` (gitignored)
|
|
214
|
-
|
|
215
|
-
`
|
|
216
|
+
Runtime state lands in `<project>/.agent-serve/` (gitignored). Nested
|
|
217
|
+
checkouts default `local.cwd` to `~/.cache/agent-serve/<slug>` at
|
|
218
|
+
discovery. `--state-root` is for session files, not harness cwd.
|
|
216
219
|
|
|
217
220
|
## Channel setup with the user
|
|
218
221
|
|
package/skills/debug/SKILL.md
CHANGED
|
@@ -47,7 +47,8 @@ curl -sN 'localhost:3000/<slug>/v1/session/<id>/stream?startIndex=0' | head -50
|
|
|
47
47
|
| Every built-in read/grep the model makes fails; turns crawl through retry loops | You ran the CLI under **Bun**. Kill it, rerun under Node/tsx. (`NGHTTP2_FRAME_SIZE_ERROR` in SDK logs is the tell.) |
|
|
48
48
|
| `gh webhook forward` / `agent-sdk github forward` deliveries all 401 — but hook creation succeeded | `GITHUB_TOKEN`/`GH_TOKEN` in the env. The relay authenticates with the gh CLI login and rejects env tokens. `GITHUB_TOKEN= GH_TOKEN= agent-sdk github forward ...` |
|
|
49
49
|
| `Hook already exists` starting a forwarder | GitHub allows one forwarder per repo. Use one `github forward --dir <parent>` (it fans out to every matching channel) instead of N processes; kill stale forwarders. |
|
|
50
|
-
| Agent's answers reference monorepo rules / AGENTS.md it shouldn't know | Session workspace sits inside
|
|
50
|
+
| Agent's answers reference monorepo rules / AGENTS.md it shouldn't know | Session workspace sits inside another git checkout, so the harness loaded ancestor config. Nested projects default `local.cwd` to `~/.cache/agent-serve/<dir>`. Point cwd at a checkout only when the agent should inherit that tree. |
|
|
51
|
+
| Yellow box lists Datadog/Linear tools; model recites `GetDynamicTools` / IDE `cursor` tools and never calls MCP | Attached MCP is behind meta-tools, or `hostOnly` hid it, or cwd still leaked IDE MCP. Set `advertiseTools: true` for named tools on local turns. Confirm `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
|
|
51
52
|
| Port 3000/5273 in use; stray processes after crashes | `lsof -iTCP:3000 -sTCP:LISTEN`, kill the pids; also check companion processes (e.g. vite). |
|
|
52
53
|
| Pending tool approval vanished after server restart | By design: parked SDK calls don't survive host restart; they resolve as interrupted. Re-run the turn. |
|
|
53
54
|
| Schedule / reminder never fires under `--dev` | Dev never auto-fires. `POST /<slug>/v1/dev/schedules/<id>` or `POST /<slug>/v1/dev/reminders/<id>` (list at `GET /v1/dev/reminders`). |
|
|
@@ -38,11 +38,11 @@ pnpm exec tsx src/bin/agent-serve.ts <cmd> ...
|
|
|
38
38
|
before shipping. Classic miss: a tool `execute` return that fails
|
|
39
39
|
`ToolExecuteResult` — returns must be JSON-shaped, so use object
|
|
40
40
|
literals or `type` aliases, not `interface` types.
|
|
41
|
-
4. **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
the
|
|
45
|
-
|
|
41
|
+
4. **Harness cwd in a nested git repo.** Discovery defaults `local.cwd` to
|
|
42
|
+
`~/.cache/agent-serve/<dir>` so ancestor `AGENTS.md` / `.cursor` / IDE
|
|
43
|
+
MCP do not leak into playground turns. Set cwd at a checkout only when
|
|
44
|
+
the agent must inherit that tree. Attached MCP is invisible by name
|
|
45
|
+
until `advertiseTools: true`. `hostOnly` hides it from the model.
|
|
46
46
|
5. **A model turn needs `CURSOR_API_KEY`.** Everything structural
|
|
47
47
|
(`validate`, `info`, `call`, `serve` bring-up) works without one.
|
|
48
48
|
|
|
@@ -57,7 +57,7 @@ path live under README "Folder structure".
|
|
|
57
57
|
| `agent/instructions.md` | Always-on system prompt (required; `.ts`/dir forms exist) |
|
|
58
58
|
| `agent/tools/<name>.ts` | One typed tool; filename = tool name. `execution: "server"` (in-process, default) or `"agent"` (script that runs where the agent runs) |
|
|
59
59
|
| `agent/skills/*` | SKILL.md-convention procedures, loaded on demand |
|
|
60
|
-
| `agent/mcp-connections/<name>.ts` | MCP servers
|
|
60
|
+
| `agent/mcp-connections/<name>.ts` | MCP servers. Do not name an account connection `cursor.ts`. `advertiseTools: true` for named tools on local turns; `hostOnly` keeps them off the model. `{ tools }` authors TypeScript the Agent SDK packages as stdio MCP. |
|
|
61
61
|
| `agent/subagents/<id>/` | Child agent dir (`description` required; per-subagent tools/skills/MCP connections ignored for now) |
|
|
62
62
|
| `agent/channels/*.ts` | HTTP surfaces beyond the built-in session API; `slack.ts` / `github.ts` use the platform packs |
|
|
63
63
|
| `agent/hooks/*.ts` | Observe-only event subscribers (never fatal) |
|
package/skills/mcp-auth/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agentkit-mcp-auth
|
|
|
3
3
|
description: >-
|
|
4
4
|
Authorize host MCP OAuth for defineConnection({ url, oauth: true }):
|
|
5
5
|
agent-sdk mcp oauth, local mcp-auth.json, --store deployment secrets,
|
|
6
|
-
hostOnly, and egress. Read when wiring or debugging MCP auth.
|
|
6
|
+
hostOnly, advertiseTools, and egress. Read when wiring or debugging MCP auth.
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Host MCP OAuth (mcp auth)
|
|
@@ -26,13 +26,15 @@ Docs: `docs/guides/mcp-oauth.md`, `docs/reference/connections.md`,
|
|
|
26
26
|
| Remote URL that speaks OAuth; host must hold tokens | `defineConnection({ url, oauth: true })` + this skill |
|
|
27
27
|
| Static bearer / API key | `headers` / env on a plain `{ url }` connection |
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
those tools.
|
|
29
|
+
Set `hostOnly: true` only when host tools / channel handlers should call
|
|
30
|
+
the server and the model should not (admin APIs, privileged writes).
|
|
31
|
+
Playground chat will not see those tools. For connectors the model should
|
|
32
|
+
call on local turns (Linear, Datadog, account MCP), omit `hostOnly` and
|
|
33
|
+
set `advertiseTools: true`.
|
|
32
34
|
|
|
33
35
|
## Goal checklist
|
|
34
36
|
|
|
35
|
-
- [ ] `agent/mcp-connections/<name>.ts` with `url` + `oauth: true` (
|
|
37
|
+
- [ ] `agent/mcp-connections/<name>.ts` with `url` + `oauth: true` (`hostOnly` if privileged; `advertiseTools` if the model should call it)
|
|
36
38
|
- [ ] `hosting.secretNames` lists `MCP_OAUTH_<NAME>_{ACCESS_TOKEN,REFRESH_TOKEN,CLIENT_ID}` when you will `--store`
|
|
37
39
|
- [ ] Hosted engines that reach non-bootstrap hosts declare `hosting.egressDomains`
|
|
38
40
|
- [ ] Local: `agent-sdk mcp oauth <name>` succeeds
|
|
@@ -127,7 +129,7 @@ redeploy completed, then exercise the same host tool once.
|
|
|
127
129
|
| `Unknown MCP connection` | Filename under `agent/mcp-connections/` must match CLI arg |
|
|
128
130
|
| Callback hang | Free port 8787; finish browser flow on this machine |
|
|
129
131
|
| Hosted 401 / unauthorized | `secrets list`; re-run `--store`; redeploy |
|
|
130
|
-
| Model invents `mcp_auth` / IDE MCP |
|
|
132
|
+
| Model invents `mcp_auth` / IDE MCP | `hostOnly` hid it, or attached MCP is behind meta-tools. Use host tools for privileged servers. Set `advertiseTools: true` for named tools on local turns. |
|
|
131
133
|
| Tokens ignored after URL edit | Expected; run `mcp oauth` again for the new resource URL |
|
|
132
134
|
|
|
133
135
|
## Don't
|
package/src/bin/agent-serve.ts
CHANGED
|
@@ -1260,7 +1260,8 @@ async function main(argv: string[]): Promise<number> {
|
|
|
1260
1260
|
values["cursor-events"] === true
|
|
1261
1261
|
? { repos: values.repo ?? [] }
|
|
1262
1262
|
: undefined,
|
|
1263
|
-
// Soft boot logs
|
|
1263
|
+
// Soft boot logs stay secondary to the banner. `dim` is a no-op on
|
|
1264
|
+
// already-styled lines (the MCP warning box).
|
|
1264
1265
|
logger: (line: string) => {
|
|
1265
1266
|
process.stdout.write(`${style.dim(line)}\n`);
|
|
1266
1267
|
},
|
|
@@ -1700,7 +1701,7 @@ installTransportErrorGuards();
|
|
|
1700
1701
|
|
|
1701
1702
|
// Authored agent files are TypeScript imported at runtime; install the tsx
|
|
1702
1703
|
// loader (and the framework import aliases on compiled runs) before any
|
|
1703
|
-
// command touches a project.
|
|
1704
|
+
// command touches a project. In-repo CLI is `bin/agentsdk`.
|
|
1704
1705
|
registerAuthoredModuleLoaders()
|
|
1705
1706
|
.then(() => main(process.argv.slice(2)))
|
|
1706
1707
|
.then(
|
|
@@ -535,7 +535,12 @@ function isOctokitRequestError(error: unknown): error is {
|
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
|
|
538
|
+
/** Normalize an Octokit request failure into {@link GitHubApiError}. */
|
|
539
|
+
export function wrapOctokitError(
|
|
540
|
+
error: unknown,
|
|
541
|
+
method: string,
|
|
542
|
+
path: string
|
|
543
|
+
): Error {
|
|
539
544
|
if (isOctokitRequestError(error)) {
|
|
540
545
|
return new GitHubApiError({
|
|
541
546
|
body: error.response?.data,
|
|
@@ -17,6 +17,11 @@ import {
|
|
|
17
17
|
type GitHubPostedComment,
|
|
18
18
|
type GitHubReactionContent,
|
|
19
19
|
} from "./api.js";
|
|
20
|
+
import {
|
|
21
|
+
createGitHubCheck,
|
|
22
|
+
type GitHubCheck,
|
|
23
|
+
type GitHubCheckCreateInput,
|
|
24
|
+
} from "./checks.js";
|
|
20
25
|
import type {
|
|
21
26
|
GitHubChannelCredentials,
|
|
22
27
|
GitHubConversationKind,
|
|
@@ -79,6 +84,14 @@ export interface GitHubHandle {
|
|
|
79
84
|
description?: string;
|
|
80
85
|
targetUrl?: string;
|
|
81
86
|
}): Promise<GitHubApiResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Open a CI check run (Checks API) on `sha` and get a handle for updating
|
|
89
|
+
* and concluding it. Needs `checks:write` — with `cursorAccount`, declare
|
|
90
|
+
* `githubChannel({ checks: true })` to opt the lease up.
|
|
91
|
+
*/
|
|
92
|
+
createCheck(
|
|
93
|
+
input: Omit<GitHubCheckCreateInput, "github" | "owner" | "repo">
|
|
94
|
+
): Promise<GitHubCheck>;
|
|
82
95
|
}
|
|
83
96
|
|
|
84
97
|
/** Thread-scoped operations for the current conversation (`ctx.thread`). */
|
|
@@ -149,6 +162,14 @@ export function buildGitHubBinding(input: {
|
|
|
149
162
|
: { targetUrl: status.targetUrl }),
|
|
150
163
|
});
|
|
151
164
|
},
|
|
165
|
+
createCheck(check) {
|
|
166
|
+
return createGitHubCheck({
|
|
167
|
+
...check,
|
|
168
|
+
github: { getOctokit },
|
|
169
|
+
owner: state.owner,
|
|
170
|
+
repo: state.repo,
|
|
171
|
+
});
|
|
172
|
+
},
|
|
152
173
|
};
|
|
153
174
|
|
|
154
175
|
const thread: GitHubThread = {
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic CI checks (GitHub Checks API) for agent authors.
|
|
3
|
+
*
|
|
4
|
+
* `createGitHubCheck` opens a merge-box check run on a commit and returns a
|
|
5
|
+
* handle for updating and concluding it, so an agent can report its own CI
|
|
6
|
+
* result (name, summary, and a "Details" link — e.g. the agent session run).
|
|
7
|
+
* Works with any client exposing `getOctokit()` (`ctx.github`,
|
|
8
|
+
* `ctx.host.github`), and is also reachable as `ctx.github.createCheck(...)`.
|
|
9
|
+
*
|
|
10
|
+
* Posting checks needs `checks:write`. With `cursorAccount`, declare
|
|
11
|
+
* `githubChannel({ checks: true })` so the hosted lease is minted on the
|
|
12
|
+
* `contents-write` tier; GitHub App / PAT credentials need the equivalent
|
|
13
|
+
* permission.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { Octokit } from "@octokit/rest";
|
|
17
|
+
import {
|
|
18
|
+
type GitHubCheckRunConclusion,
|
|
19
|
+
type GitHubCheckRunStatus,
|
|
20
|
+
wrapOctokitError,
|
|
21
|
+
} from "./api.js";
|
|
22
|
+
|
|
23
|
+
/** Any client that can hand out an authenticated Octokit. */
|
|
24
|
+
export interface GitHubCheckClient {
|
|
25
|
+
getOctokit(): Promise<Octokit>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Output shown on the check page (both fields required by GitHub). */
|
|
29
|
+
export interface GitHubCheckOutput {
|
|
30
|
+
/** Heading on the check page. */
|
|
31
|
+
title: string;
|
|
32
|
+
/** Markdown body (supports links, e.g. `[View session](…)`). */
|
|
33
|
+
summary: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GitHubCheckCreateInput {
|
|
37
|
+
/** Client used for every API call on the returned handle. */
|
|
38
|
+
github: GitHubCheckClient;
|
|
39
|
+
/** Repository owner login, e.g. `"acme"`. */
|
|
40
|
+
owner: string;
|
|
41
|
+
/** Repository name, e.g. `"widgets"`. */
|
|
42
|
+
repo: string;
|
|
43
|
+
/** Check name shown in the PR merge box, e.g. `"Cursor Security Review"`. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** Commit the check attaches to (usually the PR head SHA). */
|
|
46
|
+
sha: string;
|
|
47
|
+
/** Initial status. Defaults to `"in_progress"`. */
|
|
48
|
+
status?: "queued" | "in_progress";
|
|
49
|
+
/** "Details" link on the check, e.g. the agent session run URL. */
|
|
50
|
+
detailsUrl?: string;
|
|
51
|
+
/** Title + markdown summary shown on the check page. */
|
|
52
|
+
output?: GitHubCheckOutput;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface GitHubCheckUpdateInput {
|
|
56
|
+
status?: GitHubCheckRunStatus;
|
|
57
|
+
conclusion?: GitHubCheckRunConclusion;
|
|
58
|
+
detailsUrl?: string;
|
|
59
|
+
output?: GitHubCheckOutput;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface GitHubCheckConcludeInput {
|
|
63
|
+
/** Final result shown in the merge box. */
|
|
64
|
+
conclusion: GitHubCheckRunConclusion;
|
|
65
|
+
detailsUrl?: string;
|
|
66
|
+
output?: GitHubCheckOutput;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** A created check run. All methods throw `GitHubApiError` on API failure. */
|
|
70
|
+
export interface GitHubCheck {
|
|
71
|
+
/** Check run id (for reuse across process restarts). */
|
|
72
|
+
readonly id: number;
|
|
73
|
+
/** GitHub web URL of the check run page, when returned by the API. */
|
|
74
|
+
readonly url: string | undefined;
|
|
75
|
+
/** Patch status / output / details link while the check is running. */
|
|
76
|
+
update(input: GitHubCheckUpdateInput): Promise<void>;
|
|
77
|
+
/** Complete the check with a conclusion (sets `completed_at`). */
|
|
78
|
+
conclude(input: GitHubCheckConcludeInput): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Create a CI check run on a commit and return a handle for later updates.
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* const check = await createGitHubCheck({
|
|
86
|
+
* github: ctx.github,
|
|
87
|
+
* owner: ctx.repository.owner,
|
|
88
|
+
* repo: ctx.repository.name,
|
|
89
|
+
* name: "Cursor Security Review",
|
|
90
|
+
* sha: pr.headSha,
|
|
91
|
+
* detailsUrl: sessionUrl,
|
|
92
|
+
* output: { title: "Running…", summary: `[View session](${sessionUrl})` },
|
|
93
|
+
* });
|
|
94
|
+
* // …do the work…
|
|
95
|
+
* await check.conclude({ conclusion: "success", output: { … } });
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export async function createGitHubCheck(
|
|
99
|
+
input: GitHubCheckCreateInput
|
|
100
|
+
): Promise<GitHubCheck> {
|
|
101
|
+
const octokit = await input.github.getOctokit();
|
|
102
|
+
let created: { id: number; html_url?: string | null };
|
|
103
|
+
try {
|
|
104
|
+
const response = await octokit.rest.checks.create({
|
|
105
|
+
owner: input.owner,
|
|
106
|
+
repo: input.repo,
|
|
107
|
+
name: input.name,
|
|
108
|
+
head_sha: input.sha,
|
|
109
|
+
status: input.status ?? "in_progress",
|
|
110
|
+
started_at: new Date().toISOString(),
|
|
111
|
+
details_url: input.detailsUrl,
|
|
112
|
+
output: input.output,
|
|
113
|
+
});
|
|
114
|
+
created = response.data;
|
|
115
|
+
} catch (error) {
|
|
116
|
+
throw wrapOctokitError(
|
|
117
|
+
error,
|
|
118
|
+
"POST",
|
|
119
|
+
`/repos/${input.owner}/${input.repo}/check-runs`
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
return resumeGitHubCheck({
|
|
123
|
+
github: input.github,
|
|
124
|
+
owner: input.owner,
|
|
125
|
+
repo: input.repo,
|
|
126
|
+
name: input.name,
|
|
127
|
+
checkRunId: created.id,
|
|
128
|
+
url: typeof created.html_url === "string" ? created.html_url : undefined,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Rebuild a {@link GitHubCheck} handle for an existing check run id (e.g.
|
|
134
|
+
* after a process restart). No API call is made until the first update.
|
|
135
|
+
*/
|
|
136
|
+
export function resumeGitHubCheck(input: {
|
|
137
|
+
github: GitHubCheckClient;
|
|
138
|
+
owner: string;
|
|
139
|
+
repo: string;
|
|
140
|
+
name: string;
|
|
141
|
+
checkRunId: number;
|
|
142
|
+
url?: string;
|
|
143
|
+
}): GitHubCheck {
|
|
144
|
+
const patch = async (update: GitHubCheckUpdateInput): Promise<void> => {
|
|
145
|
+
const octokit = await input.github.getOctokit();
|
|
146
|
+
try {
|
|
147
|
+
await octokit.rest.checks.update({
|
|
148
|
+
owner: input.owner,
|
|
149
|
+
repo: input.repo,
|
|
150
|
+
check_run_id: input.checkRunId,
|
|
151
|
+
name: input.name,
|
|
152
|
+
status: update.status,
|
|
153
|
+
conclusion: update.conclusion,
|
|
154
|
+
completed_at:
|
|
155
|
+
update.status === "completed" ? new Date().toISOString() : undefined,
|
|
156
|
+
details_url: update.detailsUrl,
|
|
157
|
+
output: update.output,
|
|
158
|
+
});
|
|
159
|
+
} catch (error) {
|
|
160
|
+
throw wrapOctokitError(
|
|
161
|
+
error,
|
|
162
|
+
"PATCH",
|
|
163
|
+
`/repos/${input.owner}/${input.repo}/check-runs/${input.checkRunId}`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
id: input.checkRunId,
|
|
169
|
+
url: input.url,
|
|
170
|
+
update: patch,
|
|
171
|
+
conclude: (conclude) =>
|
|
172
|
+
patch({
|
|
173
|
+
status: "completed",
|
|
174
|
+
conclusion: conclude.conclusion,
|
|
175
|
+
detailsUrl: conclude.detailsUrl,
|
|
176
|
+
output: conclude.output,
|
|
177
|
+
}),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
@@ -119,22 +119,25 @@ export function parseCursorGithubRepoScope(
|
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* Hosted `cursorAccount` mints `checks:write` on the `contents-write` tier.
|
|
122
|
-
* Enabling `progress.commitStatus` opts a `pr-write` (or
|
|
123
|
-
* to that tier so github-proxy / `/github-token` can
|
|
124
|
-
* `"read"` cannot post merge-box checks.
|
|
122
|
+
* Enabling `progress.commitStatus` or `checks: true` opts a `pr-write` (or
|
|
123
|
+
* omitted) channel up to that tier so github-proxy / `/github-token` can
|
|
124
|
+
* post Checks API runs. `"read"` cannot post merge-box checks.
|
|
125
125
|
*/
|
|
126
126
|
export function cursorGithubPermissionsForChannel(
|
|
127
|
-
options: Pick<GitHubChannelOptions, "progress">,
|
|
127
|
+
options: Pick<GitHubChannelOptions, "progress" | "checks">,
|
|
128
128
|
authored: CursorGithubPermissions | undefined = "pr-write"
|
|
129
129
|
): CursorGithubPermissions {
|
|
130
130
|
const base = authored ?? "pr-write";
|
|
131
131
|
const commitStatus = options.progress?.commitStatus;
|
|
132
|
-
|
|
132
|
+
const wantsChecks =
|
|
133
|
+
options.checks === true ||
|
|
134
|
+
(commitStatus !== undefined && commitStatus !== false);
|
|
135
|
+
if (!wantsChecks) {
|
|
133
136
|
return base;
|
|
134
137
|
}
|
|
135
138
|
if (base === "read") {
|
|
136
139
|
throw new Error(
|
|
137
|
-
'progress.commitStatus
|
|
140
|
+
'progress.commitStatus / checks need checks:write; cursorAccount permissions: "read" cannot post merge-box checks. Use "pr-write" or "contents-write".'
|
|
138
141
|
);
|
|
139
142
|
}
|
|
140
143
|
return "contents-write";
|
|
@@ -546,6 +546,14 @@ export interface GitHubChannelOptions {
|
|
|
546
546
|
* and sticky banner are opt-in via `commitStatus` / `banner`.
|
|
547
547
|
*/
|
|
548
548
|
progress?: GitHubProgressConfig;
|
|
549
|
+
/**
|
|
550
|
+
* Declare that this channel posts its own CI checks
|
|
551
|
+
* (`ctx.github.createCheck` / `createGitHubCheck`). With `cursorAccount`,
|
|
552
|
+
* opts the minted token up to `permissions: "contents-write"` so the
|
|
553
|
+
* hosted lease includes `checks:write` — same opt-up as
|
|
554
|
+
* `progress.commitStatus`. Has no effect on App / PAT credentials.
|
|
555
|
+
*/
|
|
556
|
+
checks?: boolean;
|
|
549
557
|
/**
|
|
550
558
|
* When false, skip posting assistant / error comments back to GitHub.
|
|
551
559
|
* Defaults to true.
|
|
@@ -29,8 +29,8 @@ export interface SlackAppManifest {
|
|
|
29
29
|
display_name: string;
|
|
30
30
|
always_online: boolean;
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
agent_view?: {
|
|
33
|
+
agent_description: string;
|
|
34
34
|
suggested_prompts: Array<{ title: string; message: string }>;
|
|
35
35
|
};
|
|
36
36
|
app_home?: {
|
|
@@ -135,9 +135,9 @@ export function buildSlackManifest(
|
|
|
135
135
|
: options.name;
|
|
136
136
|
const botName = options.botDisplayName ?? toBotDisplayName(options.name, env);
|
|
137
137
|
const description = options.description ?? defaultDescription(options.name);
|
|
138
|
-
const
|
|
138
|
+
const includeAgentView = options.assistant !== false;
|
|
139
139
|
|
|
140
|
-
const botScopes =
|
|
140
|
+
const botScopes = includeAgentView
|
|
141
141
|
? [...BOT_SCOPES]
|
|
142
142
|
: BOT_SCOPES.filter((scope) => scope !== "assistant:write");
|
|
143
143
|
|
|
@@ -164,14 +164,12 @@ export function buildSlackManifest(
|
|
|
164
164
|
messages_tab_enabled: true,
|
|
165
165
|
messages_tab_read_only_enabled: false,
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
agent_view: includeAgentView
|
|
168
168
|
? {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
suggested_prompts: suggested,
|
|
172
|
-
},
|
|
169
|
+
agent_description: description,
|
|
170
|
+
suggested_prompts: suggested,
|
|
173
171
|
}
|
|
174
|
-
:
|
|
172
|
+
: undefined,
|
|
175
173
|
},
|
|
176
174
|
oauth_config: {
|
|
177
175
|
scopes: {
|
|
@@ -651,7 +651,7 @@ export interface SlackManifestOptions {
|
|
|
651
651
|
env: "dev" | "prod";
|
|
652
652
|
/** Optional short description shown in the Slack app. */
|
|
653
653
|
description?: string;
|
|
654
|
-
/** Include `
|
|
654
|
+
/** Include `agent_view` + `assistant:write` for typing status. */
|
|
655
655
|
assistant?: boolean;
|
|
656
656
|
/**
|
|
657
657
|
* Enable Slack interactivity (needed for Approve/Deny cards).
|
|
@@ -663,7 +663,7 @@ export interface SlackManifestOptions {
|
|
|
663
663
|
* channel watch (`engagement.channelPosts`). Defaults to `false`.
|
|
664
664
|
*/
|
|
665
665
|
channelPosts?: boolean;
|
|
666
|
-
/** Seed suggested prompts into the manifest `
|
|
666
|
+
/** Seed suggested prompts into the manifest `agent_view`. */
|
|
667
667
|
suggestedPrompts?: Array<{ title: string; message: string }>;
|
|
668
668
|
/**
|
|
669
669
|
* Emit `settings.managed_app_settings`. Defaults to `true` — Cursor
|
package/src/connections.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* A connection gives tools from an external MCP server. The filename
|
|
5
5
|
* becomes the connection (server) name. Available to the agent (SDK
|
|
6
6
|
* `mcpServers`), host (`ctx.host.mcp`), and channel/schedule handlers.
|
|
7
|
-
* Pass `
|
|
7
|
+
* Pass `advertiseTools: true` for named tools on local turns. Pass
|
|
8
|
+
* `hostOnly: true` to keep it off the model (still on `host.mcp`).
|
|
8
9
|
*
|
|
9
10
|
* ```ts
|
|
10
11
|
* import { defineConnection } from "@anysphere/agent-serve/connections";
|
|
@@ -42,13 +43,24 @@
|
|
|
42
43
|
* to be signed in (`agent-serve login` or `CURSOR_API_KEY`):
|
|
43
44
|
*
|
|
44
45
|
* ```ts
|
|
45
|
-
* // agent/mcp-connections/
|
|
46
|
-
* export default defineConnection({
|
|
46
|
+
* // agent/mcp-connections/account.ts — every connected server (no allowlist)
|
|
47
|
+
* export default defineConnection({
|
|
48
|
+
* cursorAccount: true,
|
|
49
|
+
* advertiseTools: true,
|
|
50
|
+
* });
|
|
47
51
|
* // equivalent explicit form:
|
|
48
|
-
* export default defineConnection({
|
|
52
|
+
* export default defineConnection({
|
|
53
|
+
* cursorAccount: true,
|
|
54
|
+
* servers: "*",
|
|
55
|
+
* advertiseTools: true,
|
|
56
|
+
* });
|
|
49
57
|
*
|
|
50
58
|
* // or restrict to specific connectors by name
|
|
51
|
-
* export default defineConnection({
|
|
59
|
+
* export default defineConnection({
|
|
60
|
+
* cursorAccount: true,
|
|
61
|
+
* servers: ["Linear"],
|
|
62
|
+
* advertiseTools: true,
|
|
63
|
+
* });
|
|
52
64
|
* ```
|
|
53
65
|
*
|
|
54
66
|
* A **peer MCP connection** addresses another agent mounted on the same serve
|