mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
Deploying to gh-pages from @ mark3labs/kit@d304805106 🚀
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
{"version":"1.5.2","languages":{"en":{"hash":"en_a69431cb5a","wasm":"en","page_count":21}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
{"version":"1.5.2","languages":{"en":{"hash":"en_64a0b2c5b2","wasm":"en","page_count":21}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Machine-readable JSON output for scripting and automation.">
|
||||
<link rel="canonical" href="/advanced/json-output">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"JSON Output","description":"Machine-readable JSON output for scripting and automation.","url":"https://go-kit.dev/advanced/json-output","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Multi-agent orchestration with Kit subagents.">
|
||||
<link rel="canonical" href="/advanced/subagents">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Subagents","description":"Multi-agent orchestration with Kit subagents.","url":"https://go-kit.dev/advanced/subagents","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Test Kit's TUI non-interactively using tmux.">
|
||||
<link rel="canonical" href="/advanced/testing">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Testing with tmux","description":"Test Kit's TUI non-interactively using tmux.","url":"https://go-kit.dev/advanced/testing","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -198,6 +198,27 @@ including <code>TopP</code>, <code>TopK</code>, <code>FrequencyPenalty</code>, <
|
||||
<span class="line"><span style="color:#6A737D;--shiki-dark:#6A737D">// List and read resources</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">resources </span><span style="color:#D73A49;--shiki-dark:#F97583">:=</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> host.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">ListMCPResources</span><span style="color:#24292E;--shiki-dark:#E1E4E8">()</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">content, _ </span><span style="color:#D73A49;--shiki-dark:#F97583">:=</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> host.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">ReadMCPResource</span><span style="color:#24292E;--shiki-dark:#E1E4E8">(ctx, </span><span style="color:#032F62;--shiki-dark:#9ECBFF">"server"</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, </span><span style="color:#032F62;--shiki-dark:#9ECBFF">"file:///path"</span><span style="color:#24292E;--shiki-dark:#E1E4E8">)</span></span></code></pre>
|
||||
<h2 id="mcp-tasks-long-running-tools"><a class="heading-anchor" aria-hidden="" tabindex="-1" href="#mcp-tasks-long-running-tools"><span class="icon icon-link"></span></a>MCP tasks (long-running tools)</h2>
|
||||
<p>Kit advertises <a href="https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks">MCP task support</a>
|
||||
during <code>initialize</code>, so cooperating servers can return a <code>taskId</code> immediately
|
||||
and let Kit poll <code>tasks/get</code> / <code>tasks/result</code> until the operation completes.
|
||||
This avoids HTTP/SSE proxy timeouts on long tools and gives you clean
|
||||
cancellation via context.</p>
|
||||
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">host, _ </span><span style="color:#D73A49;--shiki-dark:#F97583">:=</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> kit.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">New</span><span style="color:#24292E;--shiki-dark:#E1E4E8">(ctx, </span><span style="color:#D73A49;--shiki-dark:#F97583">&</span><span style="color:#6F42C1;--shiki-dark:#B392F0">kit</span><span style="color:#24292E;--shiki-dark:#E1E4E8">.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">Options</span><span style="color:#24292E;--shiki-dark:#E1E4E8">{</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> MCPTaskMode: </span><span style="color:#D73A49;--shiki-dark:#F97583">map</span><span style="color:#24292E;--shiki-dark:#E1E4E8">[</span><span style="color:#D73A49;--shiki-dark:#F97583">string</span><span style="color:#24292E;--shiki-dark:#E1E4E8">]</span><span style="color:#6F42C1;--shiki-dark:#B392F0">kit</span><span style="color:#24292E;--shiki-dark:#E1E4E8">.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">MCPTaskMode</span><span style="color:#24292E;--shiki-dark:#E1E4E8">{</span></span>
|
||||
<span class="line"><span style="color:#032F62;--shiki-dark:#9ECBFF"> "build-server"</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: kit.MCPTaskModeAlways,</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> MCPTaskProgress: </span><span style="color:#D73A49;--shiki-dark:#F97583">func</span><span style="color:#24292E;--shiki-dark:#E1E4E8">(</span><span style="color:#E36209;--shiki-dark:#FFAB70">p</span><span style="color:#6F42C1;--shiki-dark:#B392F0"> kit</span><span style="color:#24292E;--shiki-dark:#E1E4E8">.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">MCPTaskProgress</span><span style="color:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> log.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">Printf</span><span style="color:#24292E;--shiki-dark:#E1E4E8">(</span><span style="color:#032F62;--shiki-dark:#9ECBFF">"</span><span style="color:#005CC5;--shiki-dark:#79B8FF">%s</span><span style="color:#032F62;--shiki-dark:#9ECBFF">: </span><span style="color:#005CC5;--shiki-dark:#79B8FF">%s</span><span style="color:#032F62;--shiki-dark:#9ECBFF">"</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, p.TaskID, p.Status)</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">})</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#6A737D;--shiki-dark:#6A737D">// Inspect / cancel in-flight tasks</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">tasks, _ </span><span style="color:#D73A49;--shiki-dark:#F97583">:=</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> host.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">ListMCPTasks</span><span style="color:#24292E;--shiki-dark:#E1E4E8">(ctx, </span><span style="color:#032F62;--shiki-dark:#9ECBFF">"build-server"</span><span style="color:#24292E;--shiki-dark:#E1E4E8">)</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">_, _ </span><span style="color:#D73A49;--shiki-dark:#F97583">=</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> host.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">CancelMCPTask</span><span style="color:#24292E;--shiki-dark:#E1E4E8">(ctx, </span><span style="color:#032F62;--shiki-dark:#9ECBFF">"build-server"</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, tasks[</span><span style="color:#005CC5;--shiki-dark:#79B8FF">0</span><span style="color:#24292E;--shiki-dark:#E1E4E8">].TaskID)</span></span></code></pre>
|
||||
<p>Defaults to <code>MCPTaskModeAuto</code> per server, so any existing MCP server keeps
|
||||
its previous synchronous behaviour. See <a href="/sdk/options#mcp-tasks">SDK options → MCP Tasks</a>
|
||||
for the full surface.</p>
|
||||
<h2 id="context-and-compaction"><a class="heading-anchor" aria-hidden="" tabindex="-1" href="#context-and-compaction"><span class="icon icon-link"></span></a>Context and compaction</h2>
|
||||
<p>Monitor and manage context usage:</p>
|
||||
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">tokens </span><span style="color:#D73A49;--shiki-dark:#F97583">:=</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> host.</span><span style="color:#6F42C1;--shiki-dark:#B392F0">EstimateContextTokens</span><span style="color:#24292E;--shiki-dark:#E1E4E8">()</span></span>
|
||||
@@ -214,7 +235,7 @@ including <code>TopP</code>, <code>TopK</code>, <code>FrequencyPenalty</code>, <
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> NoSession: </span><span style="color:#005CC5;--shiki-dark:#79B8FF">true</span><span style="color:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> Timeout: </span><span style="color:#005CC5;--shiki-dark:#79B8FF">2</span><span style="color:#D73A49;--shiki-dark:#F97583"> *</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> time.Minute,</span></span>
|
||||
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">})</span></span></code></pre>
|
||||
<p>See <a href="/sdk/options">Options</a>, <a href="/sdk/callbacks">Callbacks</a>, and <a href="/sdk/sessions">Sessions</a> for more details.</p>`,headings:[{depth:2,text:"Installation",id:"installation"},{depth:2,text:"Basic usage",id:"basic-usage"},{depth:2,text:"Multi-turn conversations",id:"multi-turn-conversations"},{depth:2,text:"Additional prompt methods",id:"additional-prompt-methods"},{depth:2,text:"Custom tools",id:"custom-tools"},{depth:2,text:"Generation & provider overrides",id:"generation--provider-overrides"},{depth:2,text:"Event system",id:"event-system"},{depth:2,text:"Model management",id:"model-management"},{depth:2,text:"Dynamic MCP servers",id:"dynamic-mcp-servers"},{depth:3,text:"In-process MCP servers",id:"in-process-mcp-servers"},{depth:2,text:"MCP prompts and resources",id:"mcp-prompts-and-resources"},{depth:2,text:"Context and compaction",id:"context-and-compaction"},{depth:2,text:"In-process subagents",id:"in-process-subagents"}],raw:`
|
||||
<p>See <a href="/sdk/options">Options</a>, <a href="/sdk/callbacks">Callbacks</a>, and <a href="/sdk/sessions">Sessions</a> for more details.</p>`,headings:[{depth:2,text:"Installation",id:"installation"},{depth:2,text:"Basic usage",id:"basic-usage"},{depth:2,text:"Multi-turn conversations",id:"multi-turn-conversations"},{depth:2,text:"Additional prompt methods",id:"additional-prompt-methods"},{depth:2,text:"Custom tools",id:"custom-tools"},{depth:2,text:"Generation & provider overrides",id:"generation--provider-overrides"},{depth:2,text:"Event system",id:"event-system"},{depth:2,text:"Model management",id:"model-management"},{depth:2,text:"Dynamic MCP servers",id:"dynamic-mcp-servers"},{depth:3,text:"In-process MCP servers",id:"in-process-mcp-servers"},{depth:2,text:"MCP prompts and resources",id:"mcp-prompts-and-resources"},{depth:2,text:"MCP tasks (long-running tools)",id:"mcp-tasks-long-running-tools"},{depth:2,text:"Context and compaction",id:"context-and-compaction"},{depth:2,text:"In-process subagents",id:"in-process-subagents"}],raw:`
|
||||
# Go SDK
|
||||
|
||||
The \`pkg/kit\` package lets you embed Kit as a library in your Go applications.
|
||||
@@ -427,6 +448,33 @@ resources := host.ListMCPResources()
|
||||
content, _ := host.ReadMCPResource(ctx, "server", "file:///path")
|
||||
\`\`\`
|
||||
|
||||
## MCP tasks (long-running tools)
|
||||
|
||||
Kit advertises [MCP task support](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
during \`initialize\`, so cooperating servers can return a \`taskId\` immediately
|
||||
and let Kit poll \`tasks/get\` / \`tasks/result\` until the operation completes.
|
||||
This avoids HTTP/SSE proxy timeouts on long tools and gives you clean
|
||||
cancellation via context.
|
||||
|
||||
\`\`\`go
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskMode: map[string]kit.MCPTaskMode{
|
||||
"build-server": kit.MCPTaskModeAlways,
|
||||
},
|
||||
MCPTaskProgress: func(p kit.MCPTaskProgress) {
|
||||
log.Printf("%s: %s", p.TaskID, p.Status)
|
||||
},
|
||||
})
|
||||
|
||||
// Inspect / cancel in-flight tasks
|
||||
tasks, _ := host.ListMCPTasks(ctx, "build-server")
|
||||
_, _ = host.CancelMCPTask(ctx, "build-server", tasks[0].TaskID)
|
||||
\`\`\`
|
||||
|
||||
Defaults to \`MCPTaskModeAuto\` per server, so any existing MCP server keeps
|
||||
its previous synchronous behaviour. See [SDK options → MCP Tasks](/sdk/options#mcp-tasks)
|
||||
for the full surface.
|
||||
|
||||
## Context and compaction
|
||||
|
||||
Monitor and manage context usage:
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Complete reference for all Kit CLI subcommands.">
|
||||
<link rel="canonical" href="/cli/commands">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Commands","description":"Complete reference for all Kit CLI subcommands.","url":"https://go-kit.dev/cli/commands","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Complete reference for all Kit CLI flags.">
|
||||
<link rel="canonical" href="/cli/flags">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Global Flags","description":"Complete reference for all Kit CLI flags.","url":"https://go-kit.dev/cli/flags","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Configure Kit using config files, environment variables, and CLI flags.">
|
||||
<link rel="canonical" href="/configuration">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Configuration","description":"Configure Kit using config files, environment variables, and CLI flags.","url":"https://go-kit.dev/configuration","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -98,6 +98,11 @@ mcpServers:
|
||||
type: remote
|
||||
url: "https://pubmed.mcp.example.com"
|
||||
noOAuth: true # skip OAuth for public servers
|
||||
|
||||
builds:
|
||||
type: remote
|
||||
url: "https://builds.mcp.example.com"
|
||||
tasksMode: always # always run tools/call as async tasks (Phase 1 MVP)
|
||||
```
|
||||
|
||||
### MCP server fields
|
||||
@@ -111,9 +116,34 @@ mcpServers:
|
||||
| `allowedTools` | list | Whitelist of tool names to expose |
|
||||
| `excludedTools` | list | Blacklist of tool names to hide |
|
||||
| `noOAuth` | bool | Skip OAuth for this server (for public servers that don't require auth) |
|
||||
| `tasksMode` | string | When to augment `tools/call` with MCP task metadata: `auto` (default — only when the server advertises task support), `never`, or `always`. See [MCP tasks](#mcp-tasks-long-running-tools). |
|
||||
|
||||
A legacy format with `transport`, `args`, `env`, and `headers` fields is also supported.
|
||||
|
||||
### MCP tasks (long-running tools)
|
||||
|
||||
Kit advertises [MCP task support](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
during `initialize` so servers can respond to `tools/call` with a
|
||||
`CreateTaskResult` (a task ID + `working` status) instead of blocking until
|
||||
the operation finishes. Kit then polls `tasks/get` / `tasks/result` until the
|
||||
task reaches a terminal state, and best-effort `tasks/cancel`s on context
|
||||
cancellation.
|
||||
|
||||
This avoids HTTP/SSE proxy timeouts on long builds, deploys, and batch jobs,
|
||||
and lets the user/agent abort cleanly with Ctrl-C.
|
||||
|
||||
**Per-server `tasksMode`:**
|
||||
|
||||
| Value | Behaviour |
|
||||
|-------|-----------|
|
||||
| `auto` (default) | Augment `tools/call` with task metadata only when the server advertised `tasks/toolCalls` capability. Servers that don't advertise it run synchronously, exactly as before. |
|
||||
| `never` | Always issue `tools/call` synchronously, regardless of server capability. |
|
||||
| `always` | Always opt into task augmentation, even when the server didn't advertise the capability. The server may still respond synchronously — this just expresses client intent unconditionally. |
|
||||
|
||||
Defaults are safe: any existing MCP server keeps its previous behaviour
|
||||
bit-for-bit. SDK consumers can also override the mode programmatically and
|
||||
plug in a progress callback — see [SDK options](/sdk/options#mcp-tasks).
|
||||
|
||||
## Custom models
|
||||
|
||||
Define custom models in your `.kit.yml` for use with the `custom` provider. This is useful for self-hosted models or API endpoints not in the built-in database:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Build, test, and contribute to Kit.">
|
||||
<link rel="canonical" href="/development">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Development","description":"Build, test, and contribute to Kit.","url":"https://go-kit.dev/development","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="All extension capabilities — lifecycle events, tools, commands, widgets, and more.">
|
||||
<link rel="canonical" href="/extensions/capabilities">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Capabilities","description":"All extension capabilities — lifecycle events, tools, commands, widgets, and more.","url":"https://go-kit.dev/extensions/capabilities","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Catalog of example extensions included with Kit.">
|
||||
<link rel="canonical" href="/extensions/examples">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Examples","description":"Catalog of example extensions included with Kit.","url":"https://go-kit.dev/extensions/examples","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="How Kit discovers and loads extensions.">
|
||||
<link rel="canonical" href="/extensions/loading">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Loading Extensions","description":"How Kit discovers and loads extensions.","url":"https://go-kit.dev/extensions/loading","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Overview of Kit's Go-based extension system.">
|
||||
<link rel="canonical" href="/extensions/overview">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Extension System","description":"Overview of Kit's Go-based extension system.","url":"https://go-kit.dev/extensions/overview","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Write unit tests for your Kit extensions using the test package.">
|
||||
<link rel="canonical" href="/extensions/testing">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Testing Extensions","description":"Write unit tests for your Kit extensions using the test package.","url":"https://go-kit.dev/extensions/testing","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
|
||||
</style>
|
||||
<script type="module" crossorigin src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-D2udBQaa.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Di_r5hA0.css">
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","name":"Kit","url":"https://go-kit.dev","description":"Documentation site powered by Tome","potentialAction":{"@type":"SearchAction","target":"https://go-kit.dev/search?q={search_term_string}","query-input":"required name=search_term_string"}}</script>
|
||||
</head>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Install Kit using npm, bun, pnpm, Go, or build from source.">
|
||||
<link rel="canonical" href="/installation">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Installation","description":"Install Kit using npm, bun, pnpm, Go, or build from source.","url":"https://go-kit.dev/installation","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+136
@@ -665,6 +665,11 @@ mcpServers:
|
||||
type: remote
|
||||
url: "https://pubmed.mcp.example.com"
|
||||
noOAuth: true # skip OAuth for public servers
|
||||
|
||||
builds:
|
||||
type: remote
|
||||
url: "https://builds.mcp.example.com"
|
||||
tasksMode: always # always run tools/call as async tasks (Phase 1 MVP)
|
||||
```
|
||||
|
||||
### MCP server fields
|
||||
@@ -678,9 +683,34 @@ mcpServers:
|
||||
| `allowedTools` | list | Whitelist of tool names to expose |
|
||||
| `excludedTools` | list | Blacklist of tool names to hide |
|
||||
| `noOAuth` | bool | Skip OAuth for this server (for public servers that don't require auth) |
|
||||
| `tasksMode` | string | When to augment `tools/call` with MCP task metadata: `auto` (default — only when the server advertises task support), `never`, or `always`. See [MCP tasks](#mcp-tasks-long-running-tools). |
|
||||
|
||||
A legacy format with `transport`, `args`, `env`, and `headers` fields is also supported.
|
||||
|
||||
### MCP tasks (long-running tools)
|
||||
|
||||
Kit advertises [MCP task support](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
during `initialize` so servers can respond to `tools/call` with a
|
||||
`CreateTaskResult` (a task ID + `working` status) instead of blocking until
|
||||
the operation finishes. Kit then polls `tasks/get` / `tasks/result` until the
|
||||
task reaches a terminal state, and best-effort `tasks/cancel`s on context
|
||||
cancellation.
|
||||
|
||||
This avoids HTTP/SSE proxy timeouts on long builds, deploys, and batch jobs,
|
||||
and lets the user/agent abort cleanly with Ctrl-C.
|
||||
|
||||
**Per-server `tasksMode`:**
|
||||
|
||||
| Value | Behaviour |
|
||||
|-------|-----------|
|
||||
| `auto` (default) | Augment `tools/call` with task metadata only when the server advertised `tasks/toolCalls` capability. Servers that don't advertise it run synchronously, exactly as before. |
|
||||
| `never` | Always issue `tools/call` synchronously, regardless of server capability. |
|
||||
| `always` | Always opt into task augmentation, even when the server didn't advertise the capability. The server may still respond synchronously — this just expresses client intent unconditionally. |
|
||||
|
||||
Defaults are safe: any existing MCP server keeps its previous behaviour
|
||||
bit-for-bit. SDK consumers can also override the mode programmatically and
|
||||
plug in a progress callback — see [SDK options](/sdk/options#mcp-tasks).
|
||||
|
||||
## Custom models
|
||||
|
||||
Define custom models in your `.kit.yml` for use with the `custom` provider. This is useful for self-hosted models or API endpoints not in the built-in database:
|
||||
@@ -2810,6 +2840,12 @@ when embedding Kit as a library.
|
||||
| `MCPAuthHandler` | `MCPAuthHandler` | — | OAuth handler for remote MCP servers. `nil` disables OAuth (servers returning 401 fail with the authorization-required error). See [MCP OAuth](#mcp-oauth-authorization) below. |
|
||||
| `MCPTokenStoreFactory` | `func` | — | Custom OAuth token storage for MCP servers (default: JSON file in `$XDG_CONFIG_HOME/.kit/mcp_tokens.json`). |
|
||||
| `InProcessMCPServers` | `map[string]*MCPServer` | — | In-process mcp-go servers (no subprocess) |
|
||||
| `MCPTaskMode` | `map[string]MCPTaskMode` | — | Per-server override for task-augmented `tools/call`. Keys are server names; missing entries fall back to the `tasksMode` field of the matching `MCPServerConfig`. See [MCP Tasks](#mcp-tasks). |
|
||||
| `MCPTaskTimeout` | `time.Duration` | `15m` | Maximum wall-clock to wait for a task to reach a terminal state. Independent of any per-call context deadline. |
|
||||
| `MCPTaskTTL` | `time.Duration` | — | TTL hint sent in `TaskParams` for every task-augmented call. Zero omits the field and lets the server pick. |
|
||||
| `MCPTaskPollInterval` | `time.Duration` | `1s` | Fallback interval between `tasks/get` requests when the server does not suggest one. |
|
||||
| `MCPTaskMaxPollInterval` | `time.Duration` | `5s` | Cap on the polling interval (a server-supplied `pollInterval` can otherwise grow without bound). |
|
||||
| `MCPTaskProgress` | `MCPTaskProgressHandler` | — | Optional callback invoked once when a task is accepted and on every observed status transition. The final invocation always carries a terminal status. |
|
||||
|
||||
## MCP OAuth Authorization
|
||||
|
||||
@@ -2889,6 +2925,79 @@ authorization URL and hang until the 2-minute callback timeout fires. Always
|
||||
set `OnAuthURL`, or use a higher-level wrapper like `CLIMCPAuthHandler`.
|
||||
:::
|
||||
|
||||
## MCP Tasks
|
||||
|
||||
The [MCP Tasks utility](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
turns a synchronous `tools/call` into a pollable async job: the server
|
||||
returns a `taskId` with status `working` immediately, and the client polls
|
||||
`tasks/get` / `tasks/result` until the task reaches a terminal state.
|
||||
|
||||
Kit advertises task support during `initialize` and, by default, augments
|
||||
`tools/call` with task metadata only when the server advertises
|
||||
`tasks/toolCalls` capability — so any existing MCP server keeps its previous
|
||||
synchronous behaviour bit-for-bit. Long-running tools (builds, deployments,
|
||||
batch jobs, sub-agent runs) get HTTP/SSE timeout-resistance and clean
|
||||
cancellation "for free" once both sides opt in.
|
||||
|
||||
### Per-server mode
|
||||
|
||||
```go
|
||||
import "time"
|
||||
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskMode: map[string]kit.MCPTaskMode{
|
||||
"build-server": kit.MCPTaskModeAlways, // force task-augmented calls
|
||||
"chat-server": kit.MCPTaskModeNever, // force synchronous calls
|
||||
// any server not in the map honours its `tasksMode` config field
|
||||
// (default "auto")
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
| Mode | Behaviour |
|
||||
|---|---|
|
||||
| `MCPTaskModeAuto` (default) | Augment `tools/call` with `TaskParams` only when the server advertised `tasks/toolCalls`. |
|
||||
| `MCPTaskModeNever` | Always issue `tools/call` synchronously, ignoring server capability. |
|
||||
| `MCPTaskModeAlways` | Always opt in, even when the server didn't advertise the capability. The server may still respond synchronously. |
|
||||
|
||||
### Progress callbacks
|
||||
|
||||
```go
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskTimeout: 15 * time.Minute, // total wall-clock cap
|
||||
MCPTaskTTL: 30 * time.Minute, // server retention hint
|
||||
MCPTaskProgress: func(p kit.MCPTaskProgress) {
|
||||
log.Printf("%s/%s: %s %s", p.Server, p.TaskID, p.Status, p.Message)
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
The handler fires once when a task is accepted and again on every observed
|
||||
status transition. The final call always carries a terminal status
|
||||
(`MCPTaskStatusCompleted`, `MCPTaskStatusFailed`, or `MCPTaskStatusCancelled`).
|
||||
Do not block in the handler — dispatch long work on a goroutine.
|
||||
|
||||
### Inspecting and cancelling tasks
|
||||
|
||||
```go
|
||||
tasks, _ := host.ListMCPTasks(ctx, "build-server")
|
||||
for _, t := range tasks {
|
||||
fmt.Printf("%s: %s (%s)\n", t.TaskID, t.Status, t.StatusMessage)
|
||||
}
|
||||
|
||||
t, _ := host.GetMCPTask(ctx, "build-server", taskID)
|
||||
if !t.Status.IsTerminal() {
|
||||
_, _ = host.CancelMCPTask(ctx, "build-server", taskID)
|
||||
}
|
||||
```
|
||||
|
||||
`Kit.ListMCPTasks`, `Kit.GetMCPTask`, and `Kit.CancelMCPTask` work against any
|
||||
loaded MCP server that advertises the corresponding capability.
|
||||
`MCPTaskStatus.IsTerminal()` is the canonical check for completion.
|
||||
|
||||
Context cancellation also works end-to-end: cancelling the `ctx` passed to a
|
||||
tool execution triggers a best-effort `tasks/cancel` before the call returns.
|
||||
|
||||
## Precedence
|
||||
|
||||
For any given generation or provider field, the effective value is resolved
|
||||
@@ -3145,6 +3254,33 @@ resources := host.ListMCPResources()
|
||||
content, _ := host.ReadMCPResource(ctx, "server", "file:///path")
|
||||
```
|
||||
|
||||
## MCP tasks (long-running tools)
|
||||
|
||||
Kit advertises [MCP task support](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
during `initialize`, so cooperating servers can return a `taskId` immediately
|
||||
and let Kit poll `tasks/get` / `tasks/result` until the operation completes.
|
||||
This avoids HTTP/SSE proxy timeouts on long tools and gives you clean
|
||||
cancellation via context.
|
||||
|
||||
```go
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskMode: map[string]kit.MCPTaskMode{
|
||||
"build-server": kit.MCPTaskModeAlways,
|
||||
},
|
||||
MCPTaskProgress: func(p kit.MCPTaskProgress) {
|
||||
log.Printf("%s: %s", p.TaskID, p.Status)
|
||||
},
|
||||
})
|
||||
|
||||
// Inspect / cancel in-flight tasks
|
||||
tasks, _ := host.ListMCPTasks(ctx, "build-server")
|
||||
_, _ = host.CancelMCPTask(ctx, "build-server", tasks[0].TaskID)
|
||||
```
|
||||
|
||||
Defaults to `MCPTaskModeAuto` per server, so any existing MCP server keeps
|
||||
its previous synchronous behaviour. See [SDK options → MCP Tasks](/sdk/options#mcp-tasks)
|
||||
for the full surface.
|
||||
|
||||
## Context and compaction
|
||||
|
||||
Monitor and manage context usage:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Supported LLM providers and model configuration.">
|
||||
<link rel="canonical" href="/providers">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Providers","description":"Supported LLM providers and model configuration.","url":"https://go-kit.dev/providers","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Get up and running with Kit in minutes.">
|
||||
<link rel="canonical" href="/quick-start">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Quick Start","description":"Get up and running with Kit in minutes.","url":"https://go-kit.dev/quick-start","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Monitor tool calls and streaming output with the Kit Go SDK.">
|
||||
<link rel="canonical" href="/sdk/callbacks">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Callbacks","description":"Monitor tool calls and streaming output with the Kit Go SDK.","url":"https://go-kit.dev/sdk/callbacks","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+80
-1
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Configuration options for the Kit Go SDK.">
|
||||
<link rel="canonical" href="/sdk/options">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"SDK Options","description":"Configuration options for the Kit Go SDK.","url":"https://go-kit.dev/sdk/options","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -179,6 +179,12 @@ when embedding Kit as a library.
|
||||
| `MCPAuthHandler` | `MCPAuthHandler` | — | OAuth handler for remote MCP servers. `nil` disables OAuth (servers returning 401 fail with the authorization-required error). See [MCP OAuth](#mcp-oauth-authorization) below. |
|
||||
| `MCPTokenStoreFactory` | `func` | — | Custom OAuth token storage for MCP servers (default: JSON file in `$XDG_CONFIG_HOME/.kit/mcp_tokens.json`). |
|
||||
| `InProcessMCPServers` | `map[string]*MCPServer` | — | In-process mcp-go servers (no subprocess) |
|
||||
| `MCPTaskMode` | `map[string]MCPTaskMode` | — | Per-server override for task-augmented `tools/call`. Keys are server names; missing entries fall back to the `tasksMode` field of the matching `MCPServerConfig`. See [MCP Tasks](#mcp-tasks). |
|
||||
| `MCPTaskTimeout` | `time.Duration` | `15m` | Maximum wall-clock to wait for a task to reach a terminal state. Independent of any per-call context deadline. |
|
||||
| `MCPTaskTTL` | `time.Duration` | — | TTL hint sent in `TaskParams` for every task-augmented call. Zero omits the field and lets the server pick. |
|
||||
| `MCPTaskPollInterval` | `time.Duration` | `1s` | Fallback interval between `tasks/get` requests when the server does not suggest one. |
|
||||
| `MCPTaskMaxPollInterval` | `time.Duration` | `5s` | Cap on the polling interval (a server-supplied `pollInterval` can otherwise grow without bound). |
|
||||
| `MCPTaskProgress` | `MCPTaskProgressHandler` | — | Optional callback invoked once when a task is accepted and on every observed status transition. The final invocation always carries a terminal status. |
|
||||
|
||||
## MCP OAuth Authorization
|
||||
|
||||
@@ -258,6 +264,79 @@ authorization URL and hang until the 2-minute callback timeout fires. Always
|
||||
set `OnAuthURL`, or use a higher-level wrapper like `CLIMCPAuthHandler`.
|
||||
:::
|
||||
|
||||
## MCP Tasks
|
||||
|
||||
The [MCP Tasks utility](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
turns a synchronous `tools/call` into a pollable async job: the server
|
||||
returns a `taskId` with status `working` immediately, and the client polls
|
||||
`tasks/get` / `tasks/result` until the task reaches a terminal state.
|
||||
|
||||
Kit advertises task support during `initialize` and, by default, augments
|
||||
`tools/call` with task metadata only when the server advertises
|
||||
`tasks/toolCalls` capability — so any existing MCP server keeps its previous
|
||||
synchronous behaviour bit-for-bit. Long-running tools (builds, deployments,
|
||||
batch jobs, sub-agent runs) get HTTP/SSE timeout-resistance and clean
|
||||
cancellation "for free" once both sides opt in.
|
||||
|
||||
### Per-server mode
|
||||
|
||||
```go
|
||||
import "time"
|
||||
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskMode: map[string]kit.MCPTaskMode{
|
||||
"build-server": kit.MCPTaskModeAlways, // force task-augmented calls
|
||||
"chat-server": kit.MCPTaskModeNever, // force synchronous calls
|
||||
// any server not in the map honours its `tasksMode` config field
|
||||
// (default "auto")
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
| Mode | Behaviour |
|
||||
|---|---|
|
||||
| `MCPTaskModeAuto` (default) | Augment `tools/call` with `TaskParams` only when the server advertised `tasks/toolCalls`. |
|
||||
| `MCPTaskModeNever` | Always issue `tools/call` synchronously, ignoring server capability. |
|
||||
| `MCPTaskModeAlways` | Always opt in, even when the server didn't advertise the capability. The server may still respond synchronously. |
|
||||
|
||||
### Progress callbacks
|
||||
|
||||
```go
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskTimeout: 15 * time.Minute, // total wall-clock cap
|
||||
MCPTaskTTL: 30 * time.Minute, // server retention hint
|
||||
MCPTaskProgress: func(p kit.MCPTaskProgress) {
|
||||
log.Printf("%s/%s: %s %s", p.Server, p.TaskID, p.Status, p.Message)
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
The handler fires once when a task is accepted and again on every observed
|
||||
status transition. The final call always carries a terminal status
|
||||
(`MCPTaskStatusCompleted`, `MCPTaskStatusFailed`, or `MCPTaskStatusCancelled`).
|
||||
Do not block in the handler — dispatch long work on a goroutine.
|
||||
|
||||
### Inspecting and cancelling tasks
|
||||
|
||||
```go
|
||||
tasks, _ := host.ListMCPTasks(ctx, "build-server")
|
||||
for _, t := range tasks {
|
||||
fmt.Printf("%s: %s (%s)\n", t.TaskID, t.Status, t.StatusMessage)
|
||||
}
|
||||
|
||||
t, _ := host.GetMCPTask(ctx, "build-server", taskID)
|
||||
if !t.Status.IsTerminal() {
|
||||
_, _ = host.CancelMCPTask(ctx, "build-server", taskID)
|
||||
}
|
||||
```
|
||||
|
||||
`Kit.ListMCPTasks`, `Kit.GetMCPTask`, and `Kit.CancelMCPTask` work against any
|
||||
loaded MCP server that advertises the corresponding capability.
|
||||
`MCPTaskStatus.IsTerminal()` is the canonical check for completion.
|
||||
|
||||
Context cancellation also works end-to-end: cancelling the `ctx` passed to a
|
||||
tool execution triggers a best-effort `tasks/cancel` before the call returns.
|
||||
|
||||
## Precedence
|
||||
|
||||
For any given generation or provider field, the effective value is resolved
|
||||
|
||||
+28
-1
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Embed Kit in your Go applications.">
|
||||
<link rel="canonical" href="/sdk/overview">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Go SDK","description":"Embed Kit in your Go applications.","url":"https://go-kit.dev/sdk/overview","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -225,6 +225,33 @@ resources := host.ListMCPResources()
|
||||
content, _ := host.ReadMCPResource(ctx, "server", "file:///path")
|
||||
```
|
||||
|
||||
## MCP tasks (long-running tools)
|
||||
|
||||
Kit advertises [MCP task support](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks)
|
||||
during `initialize`, so cooperating servers can return a `taskId` immediately
|
||||
and let Kit poll `tasks/get` / `tasks/result` until the operation completes.
|
||||
This avoids HTTP/SSE proxy timeouts on long tools and gives you clean
|
||||
cancellation via context.
|
||||
|
||||
```go
|
||||
host, _ := kit.New(ctx, &kit.Options{
|
||||
MCPTaskMode: map[string]kit.MCPTaskMode{
|
||||
"build-server": kit.MCPTaskModeAlways,
|
||||
},
|
||||
MCPTaskProgress: func(p kit.MCPTaskProgress) {
|
||||
log.Printf("%s: %s", p.TaskID, p.Status)
|
||||
},
|
||||
})
|
||||
|
||||
// Inspect / cancel in-flight tasks
|
||||
tasks, _ := host.ListMCPTasks(ctx, "build-server")
|
||||
_, _ = host.CancelMCPTask(ctx, "build-server", tasks[0].TaskID)
|
||||
```
|
||||
|
||||
Defaults to `MCPTaskModeAuto` per server, so any existing MCP server keeps
|
||||
its previous synchronous behaviour. See [SDK options → MCP Tasks](/sdk/options#mcp-tasks)
|
||||
for the full surface.
|
||||
|
||||
## Context and compaction
|
||||
|
||||
Monitor and manage context usage:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Session management in the Kit Go SDK.">
|
||||
<link rel="canonical" href="/sdk/sessions">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"SDK Sessions","description":"Session management in the Kit Go SDK.","url":"https://go-kit.dev/sdk/sessions","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+9
-3
@@ -105,6 +105,7 @@
|
||||
"Environment variables",
|
||||
"MCP server configuration",
|
||||
"MCP server fields",
|
||||
"MCP tasks (long-running tools)",
|
||||
"Custom models",
|
||||
"Custom model fields",
|
||||
"Per-model settings",
|
||||
@@ -114,7 +115,7 @@
|
||||
"Preferences persistence"
|
||||
],
|
||||
"tags": [],
|
||||
"wordCount": 1215
|
||||
"wordCount": 1442
|
||||
},
|
||||
{
|
||||
"id": "development",
|
||||
@@ -362,11 +363,15 @@
|
||||
"Skills & configuration",
|
||||
"Compaction & MCP",
|
||||
"MCP OAuth Authorization",
|
||||
"MCP Tasks",
|
||||
"Per-server mode",
|
||||
"Progress callbacks",
|
||||
"Inspecting and cancelling tasks",
|
||||
"Precedence",
|
||||
"Tool configuration"
|
||||
],
|
||||
"tags": [],
|
||||
"wordCount": 1623
|
||||
"wordCount": 2133
|
||||
},
|
||||
{
|
||||
"id": "sdk/overview",
|
||||
@@ -385,11 +390,12 @@
|
||||
"Dynamic MCP servers",
|
||||
"In-process MCP servers",
|
||||
"MCP prompts and resources",
|
||||
"MCP tasks (long-running tools)",
|
||||
"Context and compaction",
|
||||
"In-process subagents"
|
||||
],
|
||||
"tags": [],
|
||||
"wordCount": 752
|
||||
"wordCount": 862
|
||||
},
|
||||
{
|
||||
"id": "sdk/sessions",
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="How Kit persists and manages conversation sessions.">
|
||||
<link rel="canonical" href="/sessions">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Session Management","description":"How Kit persists and manages conversation sessions.","url":"https://go-kit.dev/sessions","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Customize Kit's appearance with built-in themes, custom theme files, and the extension theme API.">
|
||||
<link rel="canonical" href="/themes">
|
||||
<link rel="stylesheet" href="/assets/index-Di_r5hA0.css">
|
||||
<script type="module" src="/assets/index-BgYtuixg.js"></script>
|
||||
<script type="module" src="/assets/index-D2udBQaa.js"></script>
|
||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Themes","description":"Customize Kit's appearance with built-in themes, custom theme files, and the extension theme API.","url":"https://go-kit.dev/themes","isPartOf":{"@type":"WebSite","name":"Kit","url":"https://go-kit.dev"}}</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user