@cursor/july 0.1.62 → 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 +11 -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/channel-watch.d.ts +2 -1
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +7 -3
- package/dist/channels/slack/dispatch.d.ts +9 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +41 -21
- 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 +14 -11
- package/dist/channels/slack/nudge-store.d.ts +16 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -1
- package/dist/channels/slack/nudge-store.js +53 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +4 -1
- package/dist/channels/slack/types.d.ts +24 -7
- 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.B-biogkN.js → app.CdbcFD8T.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DQad--_z.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DZqKtFZS.js → VPLocalSearchBox.D_NKImM7.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BwC5zP2r.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.CSQiNzre.js → reference_connections.md.Cu3N-S3Q.js} +26 -9
- package/dist/docs/assets/reference_connections.md.Cu3N-S3Q.lean.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.kJfJAP2m.js → reference_tools.md.DTg_kEsx.js} +2 -2
- package/dist/docs/assets/{reference_tools.md.kJfJAP2m.lean.js → reference_tools.md.DTg_kEsx.lean.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 +28 -11
- 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/files-backends/agent-store-presigned-url.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/advertise-tools.d.ts +79 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +185 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +7 -1
- package/dist/internal/cli-manifest.d.ts +19 -0
- package/dist/internal/cli-manifest.d.ts.map +1 -0
- package/dist/internal/cli-manifest.js +49 -0
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +9 -1
- 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/cursor-agent-template.d.ts +9 -0
- package/dist/internal/cursor-agent-template.d.ts.map +1 -0
- package/dist/internal/cursor-agent-template.js +37 -0
- package/dist/internal/deploy-client.d.ts +1 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +18 -2
- package/dist/internal/deploy-manifest.d.ts +76 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +117 -0
- package/dist/internal/deployment-scm-event-stream.d.ts +116 -0
- package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -0
- package/dist/internal/deployment-scm-event-stream.js +474 -0
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +111 -10
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +12 -123
- 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.d.ts +18 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +43 -5
- 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/sdk-runner.d.ts +1 -1
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +36 -13
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +18 -0
- package/dist/internal/session-engine.d.ts +66 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +428 -110
- package/dist/internal/shallow-clone.d.ts +170 -0
- package/dist/internal/shallow-clone.d.ts.map +1 -0
- package/dist/internal/shallow-clone.js +412 -0
- package/dist/internal/slack-provision-client.d.ts +2 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -1
- package/dist/internal/slack-provision-client.js +1 -0
- 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/turn-lease-store.d.ts +44 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +139 -0
- package/dist/internal/workspace.d.ts +14 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +33 -0
- package/dist/playground/assets/index-77uhu5Kr.css +1 -0
- package/dist/playground/assets/index-D4buox4m.js +85 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +122 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +173 -0
- package/dist/storage.d.ts +2 -72
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +2 -82
- package/dist/tools.d.ts +7 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +141 -6
- 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 +108 -10
- package/docs/reference/sessions.md +2 -2
- package/docs/reference/tools.md +14 -0
- package/docs/troubleshooting.md +3 -2
- package/package.json +7 -2
- 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 +12 -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/channel-watch.ts +6 -3
- package/src/channels/slack/dispatch.ts +40 -3
- package/src/channels/slack/manifest.ts +9 -10
- package/src/channels/slack/nudge-store.ts +56 -0
- package/src/channels/slack/slack-channel.ts +3 -0
- package/src/channels/slack/types.ts +24 -7
- package/src/connections.ts +17 -5
- package/src/index.ts +5 -0
- package/src/internal/advertise-tools.ts +278 -0
- package/src/internal/cli-deploy.ts +11 -1
- package/src/internal/cli-manifest.ts +63 -0
- package/src/internal/cli-slack.ts +10 -1
- 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/cursor-agent-template.ts +46 -0
- package/src/internal/deploy-client.ts +25 -6
- package/src/internal/deploy-manifest.ts +161 -0
- package/src/internal/deployment-scm-event-stream.ts +593 -0
- package/src/internal/discovery.ts +132 -3
- package/src/internal/init-project.ts +18 -153
- 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 +70 -9
- 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/sdk-runner.ts +50 -11
- package/src/internal/server.ts +19 -0
- package/src/internal/session-engine.ts +392 -19
- package/src/internal/shallow-clone.ts +595 -0
- package/src/internal/slack-provision-client.ts +3 -0
- package/src/internal/terminal-style.ts +67 -1
- package/src/internal/turn-lease-store.ts +147 -0
- package/src/internal/workspace.ts +33 -0
- package/src/storage-protocol.ts +247 -0
- package/src/storage.ts +16 -110
- package/src/tools.ts +7 -0
- package/src/types.ts +149 -7
- package/templates/agentic-owners/agent/agent.ts +3 -0
- package/templates/demo/agent/agent.ts +3 -0
- package/templates/pr-autofixer/agent/lib/drive-schemas.ts +4 -1
- package/templates/security-reviewer/agent/agent.ts +3 -0
- package/templates/triage/agent/agent.ts +3 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.5ozYNf74.js +0 -1
- package/dist/docs/assets/reference_connections.md.CSQiNzre.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
- package/dist/playground/assets/index-B4rcOgeP.css +0 -1
- package/dist/playground/assets/index-DXcY42Jv.js +0 -85
- /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/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
|
@@ -37,7 +37,6 @@ copies them onto the hosted deployment as `MCP_OAUTH_<NAME>_*` secrets.
|
|
|
37
37
|
export default defineConnection({
|
|
38
38
|
url: "https://mcp.example.com/inventory",
|
|
39
39
|
oauth: true,
|
|
40
|
-
hostOnly: true, // model cannot call; host.mcp still can
|
|
41
40
|
});
|
|
42
41
|
```
|
|
43
42
|
|
|
@@ -49,10 +48,96 @@ agent-sdk mcp oauth inventory --store # also upsert deployment secrets
|
|
|
49
48
|
Full walkthrough: [Host MCP OAuth](../guides/mcp-oauth.md). Companion
|
|
50
49
|
skill: [`skills/mcp-auth/SKILL.md`](../../skills/mcp-auth/SKILL.md).
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
the right choice for connectors already linked
|
|
55
|
-
|
|
51
|
+
Set `hostOnly: true` only when host tools should call the server and the
|
|
52
|
+
model should not. Playground chat will not see those tools. Account MCP
|
|
53
|
+
(`cursorAccount: true`) is the right choice for connectors already linked
|
|
54
|
+
in the Cursor dashboard. Omit `servers` (or pass `"*"`) to forward every
|
|
55
|
+
connected connector. If the model should call those tools by name on
|
|
56
|
+
local turns, set `advertiseTools: true`.
|
|
57
|
+
|
|
58
|
+
## Per-session auth (`auth`)
|
|
59
|
+
|
|
60
|
+
For http/sse connections whose credential depends on **who the session is
|
|
61
|
+
for** — a multi-tenant agent asserting the tenant it is acting for —
|
|
62
|
+
declare an `auth` callback instead of static headers. It runs host-side
|
|
63
|
+
at turn-build time with the session's `SessionInfo` and returns headers
|
|
64
|
+
merged over the static ones:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
export default defineConnection({
|
|
68
|
+
url: "https://api.cursor.com/v1/mcp/plugins",
|
|
69
|
+
auth: async (session) => ({
|
|
70
|
+
headers: { Authorization: `Bearer ${await grantFor(session)}` },
|
|
71
|
+
}),
|
|
72
|
+
advertiseTools: true, // optional — named tools instead of meta-tools
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The callback is evaluated on **every local turn** — reminder fires and
|
|
77
|
+
post-restart follow-ups included — so the identity always comes from the
|
|
78
|
+
session itself, never from state parked in memory. The model never sees a
|
|
79
|
+
tenant parameter and can never choose the tenant. A callback that throws
|
|
80
|
+
fails the turn: a turn never silently runs without the connection's
|
|
81
|
+
identity. Local runtime only; cloud turns are refused. `host.mcp` calls
|
|
82
|
+
from server tools keep the static headers only. Not combinable with
|
|
83
|
+
`oauth: true` — the host OAuth provider owns the Authorization header.
|
|
84
|
+
|
|
85
|
+
Derive the identity from durable session facts — `session.auth`,
|
|
86
|
+
`session.id`, or your channel's own session state. Do **not** key it off
|
|
87
|
+
`session.continuationKey`: the HTTP channel rotates the continuation key
|
|
88
|
+
after every accepted follow-up, so a tenant mapping keyed on it silently
|
|
89
|
+
breaks mid-conversation. (Channels that mint stable, parseable tokens by
|
|
90
|
+
design are the exception.)
|
|
91
|
+
|
|
92
|
+
`auth` works attached or advertised. Advertised connections open
|
|
93
|
+
per-operation clients with the evaluated headers. Attached connections
|
|
94
|
+
ride the turn's SDK `mcpServers`, passed on **every send** rather than
|
|
95
|
+
pinned on the cached per-session agent handle, so a rotated credential is
|
|
96
|
+
live on the very next turn. The cost: when any attached connection has
|
|
97
|
+
`auth`, *all* of the agent's attached connections are configured per
|
|
98
|
+
send — the harness opens fresh MCP clients for them on each turn, so a
|
|
99
|
+
stdio (`command`) server respawns per turn and loses any in-process
|
|
100
|
+
state; keep stateful stdio servers out of agents that attach an auth'd
|
|
101
|
+
connection (or advertise the auth'd connection instead). Workspace
|
|
102
|
+
prewarm has no session, so it omits auth'd connections rather than
|
|
103
|
+
attaching them without an identity.
|
|
104
|
+
|
|
105
|
+
## Advertise a connection's tools by name (`advertiseTools`) {#advertise-tools}
|
|
106
|
+
|
|
107
|
+
Attached MCP servers sit behind the harness MCP meta-tools. The model does
|
|
108
|
+
not see names like `Datadog-search_datadog_dashboards` until you set
|
|
109
|
+
`advertiseTools: true`. Use that flag when playground or local chat should
|
|
110
|
+
call the tools by name.
|
|
111
|
+
|
|
112
|
+
The engine lists the connection at turn-build time and synthesizes a named
|
|
113
|
+
1:1 passthrough server tool per entry, using the server's names,
|
|
114
|
+
descriptions, and live schemas. Those merge into the authored
|
|
115
|
+
`agent/tools/` catalog. The raw connection is then not attached to the
|
|
116
|
+
model (it stays available on `host.mcp`), so each tool appears exactly
|
|
117
|
+
once.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
export default defineConnection({
|
|
121
|
+
url: "https://api.cursor.com/v1/mcp/plugins",
|
|
122
|
+
auth: async (session) => ({ headers: await tenantHeaders(session) }),
|
|
123
|
+
advertiseTools: true,
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Fail-closed, by design: a `listTools` failure, an invalid tool name, or a
|
|
128
|
+
name collision (with an authored tool or another advertised connection)
|
|
129
|
+
fails the turn. A turn never silently runs with a shrunken toolset.
|
|
130
|
+
Listing runs once per turn, so point this at endpoints that answer
|
|
131
|
+
`tools/list` cheaply. Connections with `auth` are listed and called
|
|
132
|
+
through one-off clients carrying that session's headers. Auth-less ones
|
|
133
|
+
(including Cursor account connections) go through the shared host
|
|
134
|
+
registry. Local runtime only, like all server tools, and not combinable
|
|
135
|
+
with `hostOnly`. Advertising puts the tools in the model's toolset.
|
|
136
|
+
`hostOnly` keeps them off the model. `GET /v1/info` reports
|
|
137
|
+
`advertiseTools` on the connection. The per-tool list is built per turn,
|
|
138
|
+
not on the static catalog, the peer-agent MCP server, or cloud
|
|
139
|
+
`agentsdk-tools`, and those advertised tools cannot be invoked via direct
|
|
140
|
+
tool calls.
|
|
56
141
|
|
|
57
142
|
## Local stdio MCP server
|
|
58
143
|
|
|
@@ -100,17 +185,29 @@ behavior in an explicit form. Pass a name list when you want a smaller
|
|
|
100
185
|
set.
|
|
101
186
|
|
|
102
187
|
```ts
|
|
103
|
-
// agent/mcp-connections/
|
|
104
|
-
export default defineConnection({
|
|
188
|
+
// agent/mcp-connections/account.ts: every connected connector
|
|
189
|
+
export default defineConnection({
|
|
190
|
+
cursorAccount: true,
|
|
191
|
+
advertiseTools: true,
|
|
192
|
+
});
|
|
105
193
|
// same, spelled out:
|
|
106
|
-
export default defineConnection({
|
|
194
|
+
export default defineConnection({
|
|
195
|
+
cursorAccount: true,
|
|
196
|
+
servers: "*",
|
|
197
|
+
advertiseTools: true,
|
|
198
|
+
});
|
|
107
199
|
// only Linear:
|
|
108
200
|
export default defineConnection({
|
|
109
201
|
cursorAccount: true,
|
|
110
202
|
servers: ["Linear"],
|
|
203
|
+
advertiseTools: true,
|
|
111
204
|
});
|
|
112
205
|
```
|
|
113
206
|
|
|
207
|
+
Name the file `account.ts`. `cursor.ts` collides with the IDE `cursor`
|
|
208
|
+
MCP namespace. `advertiseTools: true` puts connector tools on local
|
|
209
|
+
turns by name. Without it they sit behind harness meta-tools.
|
|
210
|
+
|
|
114
211
|
The host must be signed in (`agent-sdk login` or `CURSOR_API_KEY`).
|
|
115
212
|
`serve` fails fast at startup otherwise, and logs each connector's live
|
|
116
213
|
status (`connected`, `needsAuth`, `error`) as it starts.
|
|
@@ -152,8 +249,9 @@ are in the [Agent-to-agent guide](../guides/agent-to-agent.md).
|
|
|
152
249
|
|
|
153
250
|
One authored MCP connection serves three consumers.
|
|
154
251
|
|
|
155
|
-
1. **Cursor agent:**
|
|
156
|
-
|
|
252
|
+
1. **Cursor agent:** Attached connections ride SDK `mcpServers` behind
|
|
253
|
+
harness MCP meta-tools. Set `advertiseTools: true` so local turns see
|
|
254
|
+
named tools. `hostOnly` keeps the connection off the model.
|
|
157
255
|
2. **Server tools:** Deterministic host code composes MCP calls
|
|
158
256
|
through `ctx.host.mcp`:
|
|
159
257
|
|
|
@@ -150,8 +150,8 @@ disappears from listings and can no longer be streamed or continued.
|
|
|
150
150
|
The `runner/` store keeps its own conversation copy until you remove it.
|
|
151
151
|
Cloud conversations remain on the Cursor backend.
|
|
152
152
|
|
|
153
|
-
Change the root with `--state-root` or `stateRoot`.
|
|
154
|
-
|
|
153
|
+
Change the root with `--state-root` or `stateRoot`. Nested git checkouts
|
|
154
|
+
already default `local.cwd` outside the enclosing repo. See
|
|
155
155
|
[local session workspaces](../concepts.md#what-files-can-a-local-session-access).
|
|
156
156
|
|
|
157
157
|
## How do I inspect a saved event stream?
|
package/docs/reference/tools.md
CHANGED
|
@@ -129,6 +129,20 @@ On the local runtime, scripts land under `.agent-serve/tools/` in the
|
|
|
129
129
|
session workspace with a catalog in `AGENTS.md`. On cloud, the catalog
|
|
130
130
|
and script bodies travel on the first prompt.
|
|
131
131
|
|
|
132
|
+
## Tools from an MCP connection, advertised by name
|
|
133
|
+
|
|
134
|
+
Authored `agent/tools/` files are one catalog for every session. When
|
|
135
|
+
the tools should come from an MCP server — including per-tenant toolsets
|
|
136
|
+
resolved at runtime — declare the connection with
|
|
137
|
+
`advertiseTools: true` (plus per-session `auth` when the credential
|
|
138
|
+
depends on who the session is for) and the engine synthesizes named 1:1
|
|
139
|
+
passthrough server tools from the connection's live `listTools` on every
|
|
140
|
+
local turn. See
|
|
141
|
+
[MCP Connections](connections.md#advertise-tools).
|
|
142
|
+
Advertised tools ride the same execution path as authored server tools,
|
|
143
|
+
but cannot be invoked via
|
|
144
|
+
[direct tool calls](#call-a-tool-without-a-model-turn).
|
|
145
|
+
|
|
132
146
|
## Gate a tool on human approval
|
|
133
147
|
|
|
134
148
|
A server tool can require a person to sign off before it runs. Set
|
package/docs/troubleshooting.md
CHANGED
|
@@ -31,7 +31,8 @@ Match your symptom below. Keep the commands as `agent-sdk`; see
|
|
|
31
31
|
| --- | --- |
|
|
32
32
|
| Built-in file reads and greps fail; the turn retries for a long time | Run under Node 22.13+ (or `tsx`), never Bun. Look for `NGHTTP2_FRAME_SIZE_ERROR` in logs. |
|
|
33
33
|
| The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
|
|
34
|
-
| Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Point `defineAgent({ local: { cwd } })`
|
|
34
|
+
| Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Nested git checkouts default `local.cwd` to `~/.cache/agent-serve/<dir>`. Point `defineAgent({ local: { cwd } })` at a checkout only when the agent should inherit that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
|
|
35
|
+
| Yellow box shows Datadog/Linear tools, but the model lists `GetDynamicTools` / IDE `cursor` tools and never calls them | Attached MCP sits behind harness meta-tools, or `hostOnly` hid the connection, or the harness cwd is still inside another checkout. Set `advertiseTools: true` for named tools on local turns. Check `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
|
|
35
36
|
| Server tools, skills, or workspace seed files never appear | The agent runtime is `cloud`. Those features apply on the local runtime. `validate` warns when this combination is present. |
|
|
36
37
|
| `validate` and `run` succeed, but typecheck fails in CI | The CLI runs TypeScript with type-stripping only. Keep tool `execute` return types as object literals or `type` aliases, not `interface` types. |
|
|
37
38
|
| Login works, but turns are rejected when using custom API hosts | Point login and model traffic at the same host (`CURSOR_API_BASE_URL` and `CURSOR_BACKEND_URL`). A key from one host is rejected by the other. |
|
|
@@ -70,7 +71,7 @@ Match your symptom below. Keep the commands as `agent-sdk`; see
|
|
|
70
71
|
| --- | --- |
|
|
71
72
|
| `must be defineConnection({ url, oauth: true })` | The connection file needs `oauth: true`, or you passed the wrong connection name to `agent-sdk mcp oauth`. |
|
|
72
73
|
| Local auth works; hosted calls unauthorized | Run `agent-sdk mcp oauth <name> --store`, confirm names with `agent-sdk secrets list <slug>`, then redeploy. |
|
|
73
|
-
| Model asks for `mcp_auth` or IDE MCP for a privileged server | That connection is
|
|
74
|
+
| Model asks for `mcp_auth` or IDE MCP for a privileged server | That connection is `hostOnly`. Call it from a host tool via `ctx.host.mcp`, and update instructions. |
|
|
74
75
|
|
|
75
76
|
See [Host MCP OAuth](./guides/mcp-oauth.md) and
|
|
76
77
|
[`skills/mcp-auth/SKILL.md`](../skills/mcp-auth/SKILL.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cursor/july",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.73",
|
|
4
4
|
"description": "(early alpha) Filesystem-first framework for defining Cursor agents as markdown and TypeScript and serving them over channels with the Cursor SDK.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -150,18 +150,21 @@
|
|
|
150
150
|
},
|
|
151
151
|
"./kv": {
|
|
152
152
|
"anysphere-source": "./src/kv.ts",
|
|
153
|
+
"bun": "./dist/kv.js",
|
|
153
154
|
"types": "./dist/kv.d.ts",
|
|
154
155
|
"import": "./dist/kv.js",
|
|
155
156
|
"default": "./dist/kv.js"
|
|
156
157
|
},
|
|
157
158
|
"./kv/memory": {
|
|
158
159
|
"anysphere-source": "./src/kv/memory-kv.ts",
|
|
160
|
+
"bun": "./dist/kv/memory-kv.js",
|
|
159
161
|
"types": "./dist/kv/memory-kv.d.ts",
|
|
160
162
|
"import": "./dist/kv/memory-kv.js",
|
|
161
163
|
"default": "./dist/kv/memory-kv.js"
|
|
162
164
|
},
|
|
163
165
|
"./ledger": {
|
|
164
166
|
"anysphere-source": "./src/ledger.ts",
|
|
167
|
+
"bun": "./dist/ledger.js",
|
|
165
168
|
"types": "./dist/ledger.d.ts",
|
|
166
169
|
"import": "./dist/ledger.js",
|
|
167
170
|
"default": "./dist/ledger.js"
|
|
@@ -221,7 +224,7 @@
|
|
|
221
224
|
"node": ">=22.13"
|
|
222
225
|
},
|
|
223
226
|
"dependencies": {
|
|
224
|
-
"@cursor/sdk": "1.0.
|
|
227
|
+
"@cursor/sdk": "1.0.28",
|
|
225
228
|
"@modelcontextprotocol/sdk": "1.25.1",
|
|
226
229
|
"@octokit/auth-app": "^7.2.0",
|
|
227
230
|
"@octokit/rest": "^21.1.1",
|
|
@@ -246,6 +249,7 @@
|
|
|
246
249
|
"javascript-time-ago": "^2.6.4",
|
|
247
250
|
"js-yaml": "4.1.0",
|
|
248
251
|
"ms": "^2.1.3",
|
|
252
|
+
"proper-lockfile": "^4.1.2",
|
|
249
253
|
"slackify-markdown": "^5.0.0",
|
|
250
254
|
"tsx": "^4.0.0",
|
|
251
255
|
"esbuild": "^0.25.0",
|
|
@@ -263,6 +267,7 @@
|
|
|
263
267
|
"@types/ms": "^2.1.0",
|
|
264
268
|
"@types/node": "catalog:",
|
|
265
269
|
"@types/pg": "^8.16.0",
|
|
270
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
266
271
|
"@types/react": "^19.0.0",
|
|
267
272
|
"@types/react-dom": "^19.0.0",
|
|
268
273
|
"@typescript/native-preview": "7.0.0-dev.20260701.1",
|
|
@@ -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
|
@@ -58,6 +58,7 @@ import {
|
|
|
58
58
|
cmdStop,
|
|
59
59
|
type DeployCliOptions,
|
|
60
60
|
} from "../internal/cli-deploy.js";
|
|
61
|
+
import { cmdManifest } from "../internal/cli-manifest.js";
|
|
61
62
|
import {
|
|
62
63
|
CLI_COMMAND_NAME as CLI,
|
|
63
64
|
PACKAGE_NAME,
|
|
@@ -139,6 +140,7 @@ Usage:
|
|
|
139
140
|
[--no-wait] [--repo <url>] [--ref <ref>]
|
|
140
141
|
[--path <agentPath>] [--cursor-events-repo <owner/name>]...
|
|
141
142
|
[--allow-domain <domain>]...
|
|
143
|
+
${CLI} manifest [--dir <path>] [--json]
|
|
142
144
|
${CLI} deployments [--team <id>] [--json]
|
|
143
145
|
${CLI} deployment <slug> [--team <id>] [--json]
|
|
144
146
|
${CLI} stop <slug> [--team <id>] [--json] [--no-wait]
|
|
@@ -742,6 +744,13 @@ async function main(argv: string[]): Promise<number> {
|
|
|
742
744
|
});
|
|
743
745
|
}
|
|
744
746
|
|
|
747
|
+
case "manifest": {
|
|
748
|
+
// Offline extraction of deploy metadata (events, egress, routes,
|
|
749
|
+
// /v1/info payload) — no VM, no network. Wd-1 of the event-ingress
|
|
750
|
+
// plan; `deploy` attaches this to the request from Wd-2 on.
|
|
751
|
+
return cmdManifest({ dir, json: values.json === true });
|
|
752
|
+
}
|
|
753
|
+
|
|
745
754
|
case "deployments": {
|
|
746
755
|
return cmdDeployments(deployOptionsFromValues(values));
|
|
747
756
|
}
|
|
@@ -1251,7 +1260,8 @@ async function main(argv: string[]): Promise<number> {
|
|
|
1251
1260
|
values["cursor-events"] === true
|
|
1252
1261
|
? { repos: values.repo ?? [] }
|
|
1253
1262
|
: undefined,
|
|
1254
|
-
// 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).
|
|
1255
1265
|
logger: (line: string) => {
|
|
1256
1266
|
process.stdout.write(`${style.dim(line)}\n`);
|
|
1257
1267
|
},
|
|
@@ -1691,7 +1701,7 @@ installTransportErrorGuards();
|
|
|
1691
1701
|
|
|
1692
1702
|
// Authored agent files are TypeScript imported at runtime; install the tsx
|
|
1693
1703
|
// loader (and the framework import aliases on compiled runs) before any
|
|
1694
|
-
// command touches a project.
|
|
1704
|
+
// command touches a project. In-repo CLI is `bin/agentsdk`.
|
|
1695
1705
|
registerAuthoredModuleLoaders()
|
|
1696
1706
|
.then(() => main(process.argv.slice(2)))
|
|
1697
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 = {
|