From 2cefc4ed0f3819f6feab3377a99909743ad05166 Mon Sep 17 00:00:00 2001 From: Diane Diaz Date: Wed, 12 Nov 2025 14:40:10 -0800 Subject: [PATCH 1/4] mcp sampling support --- .../docs/guides/interactive-chat/index.mdx | 20 ++++- documentation/docs/guides/mcp-sampling.md | 80 +++++++++++++++++++ .../docs/tutorials/custom-extensions.md | 69 +++++++++++++--- 3 files changed, 152 insertions(+), 17 deletions(-) create mode 100644 documentation/docs/guides/mcp-sampling.md diff --git a/documentation/docs/guides/interactive-chat/index.mdx b/documentation/docs/guides/interactive-chat/index.mdx index 607655596e9c..595d30f15318 100644 --- a/documentation/docs/guides/interactive-chat/index.mdx +++ b/documentation/docs/guides/interactive-chat/index.mdx @@ -10,7 +10,7 @@ import VideoCarousel from '@site/src/components/VideoCarousel';

Rich Interactive Chat with MCP-UI

- Goose Desktop supports extensions that transform text-only responses into graphical, interactive experiences. Instead of reading through lists and descriptions, you can click, explore, and interact with UI components directly in your conversations. + goose Desktop supports extensions that transform text-only responses into graphical, interactive experiences. Instead of reading through lists and descriptions, you can click, explore, and interact with UI components directly in your conversations.

@@ -29,12 +29,12 @@ import VideoCarousel from '@site/src/components/VideoCarousel';
@@ -45,7 +45,7 @@ import VideoCarousel from '@site/src/components/VideoCarousel';
+
@@ -72,6 +77,13 @@ import VideoCarousel from '@site/src/components/VideoCarousel'; + + 1. You ask goose: "What's wrong with my database performance?" + + 2. goose calls the database tool + + 3. The database tool returns raw metrics to goose: + ``` + Query times: 2.3s, 1.8s, 5.2s, 0.3s, 8.1s + Table sizes: users (1M rows), orders (5M rows) + Indexes: 3 on users, 1 on orders + ``` + + 4. goose responds to you with general recommendations: + ``` + Your database seems slow. Some queries are taking over 5 seconds. You might need more indexes. + ``` + + + + 1. You ask goose: "What's wrong with my database performance?" + + 2. goose calls the database tool + + 3. The database tool gets raw metrics: + ``` + Query times: 2.3s, 1.8s, 5.2s, 0.3s, 8.1s + Table sizes: users (1M rows), orders (5M rows) + Indexes: 3 on users, 1 on orders + ``` + + Then, the tool: + - Uses its domain expertise (query patterns, table relationships, database type) to ask goose's AI: "Given these metrics and knowing the JOIN patterns in this PostgreSQL database, what's the issue?" + - Returns an AI-enhanced response to goose + + 4. goose responds to you with targeted recommendations: + ``` + Your orders table is missing an index on customer_id which is causing the 5-8 second delays in your JOIN queries. The slow queries all involve customer lookups. Run: `CREATE INDEX idx_orders_customer ON orders(customer_id);` + ``` + + + + +### Use Cases + +MCP Sampling enables powerful capabilities like: +- **Smart documentation tools** that explain code in context +- **Intelligent search** that filters and ranks results +- **Database analyzers** that provide specific optimization recommendations +- **Multi-perspective analysis** where extensions generate and synthesize multiple AI viewpoints + +## For Extension Developers + +Want to add MCP Sampling to your own extensions? See our [Building Custom Extensions](/docs/tutorials/custom-extensions) tutorial to learn more about how MCP servers can leverage goose's AI capabilities. diff --git a/documentation/docs/tutorials/custom-extensions.md b/documentation/docs/tutorials/custom-extensions.md index bca16fec101e..a117a6840b31 100644 --- a/documentation/docs/tutorials/custom-extensions.md +++ b/documentation/docs/tutorials/custom-extensions.md @@ -1,22 +1,22 @@ --- title: Building Custom Extensions -description: Create your own custom MCP Server to use as a Goose extension +description: Create your own custom MCP Server to use as a goose extension --- import { PanelLeft } from 'lucide-react'; -# Building Custom Extensions with Goose +# Building Custom Extensions with goose -Goose allows you to extend its functionality by creating your own custom extensions, which are built as MCP servers. These extensions are compatible with Goose because it adheres to the [Model Context Protocol (MCP)][mcp-docs]. MCP is an open protocol that standardizes how applications provide context to LLMs. It enables a consistent way to connect LLMs to various data sources and tools, making it ideal for extending functionality in a structured and interoperable way.  +goose allows you to extend its functionality by creating your own custom extensions, which are built as MCP servers. These extensions are compatible with goose because it adheres to the [Model Context Protocol (MCP)][mcp-docs]. MCP is an open protocol that standardizes how applications provide context to LLMs. It enables a consistent way to connect LLMs to various data sources and tools, making it ideal for extending functionality in a structured and interoperable way.  -In this guide, we build an MCP server using the [Python SDK for MCP][mcp-python]. We’ll demonstrate how to create an MCP server that reads Wikipedia articles and converts them to Markdown, integrate it as an extension in Goose. You can follow a similar process to develop your own custom extensions for Goose. +In this guide, we build an MCP server using the [Python SDK for MCP][mcp-python]. We’ll demonstrate how to create an MCP server that reads Wikipedia articles and converts them to Markdown, integrate it as an extension in goose. You can follow a similar process to develop your own custom extensions for goose. You can checkout other examples in this [MCP servers repository][mcp-servers]. MCP SDKs are also available in [Typescript][mcp-typescript] and [Kotlin][mcp-kotlin]. :::info -Goose currently supports Tools and Resources for [MCP Server features](https://spec.modelcontextprotocol.io/specification/2024-11-05/server/). +goose currently supports Tools and Resources for [MCP Server features](https://spec.modelcontextprotocol.io/specification/2024-11-05/server/). We will be adding support for MCP Prompts soon. ::: @@ -243,9 +243,9 @@ build-backend = "hatchling.build" --- -## Step 5: Integrate with Goose +## Step 5: Integrate with goose -To add your MCP server as an extension in Goose: +To add your MCP server as an extension in goose: 1. Click the button in the top-left to open the sidebar 2. Click `Extensions` in the sidebar @@ -269,21 +269,64 @@ uvx mcp-wiki --- -## Step 6: Use Your Extension in Goose +## Step 6: Use Your Extension in goose -Once integrated, you can start using your extension in Goose. Open the Goose chat interface and call your tool as needed. +Once integrated, you can start using your extension in goose. Open the goose chat interface and call your tool as needed. -You can verify that Goose has picked up the tools from your custom extension by asking it "what tools do you have?" +You can verify that goose has picked up the tools from your custom extension by asking it "what tools do you have?" -![Goose Chat - Ask about tools](../assets/guides/custom-extension-tools.png) +![goose Chat - Ask about tools](../assets/guides/custom-extension-tools.png) Then, you can try asking questions that require using the extension you added. -![Goose Chat - Use custom extension](../assets/guides/custom-extension-chat.png) +![goose Chat - Use custom extension](../assets/guides/custom-extension-chat.png) -🎉 **Congratulations!** You’ve successfully built and integrated a custom MCP server with Goose. +🎉 **Congratulations!** You’ve successfully built and integrated a custom MCP server with goose. +--- + +## Advanced Features for MCP Extensions + +goose supports advanced MCP features that can enhance your extensions. + +### MCP Sampling: AI-Powered Tools + +**[MCP Sampling](/docs/guides/mcp-sampling)** allows your MCP servers to request AI completions from goose's LLM, transforming simple tools into intelligent agents. + +**Key Benefits:** +- Your MCP server doesn't need its own OpenAI/Anthropic API key +- Tools can analyze data, provide explanations, and make intelligent decisions +- Enhanced user experience with smarter, more contextual responses +- Secure by design: requests are isolated and attributed automatically + +**Getting Started:** +- Use the `sampling/createMessage` method in your MCP server to request AI assistance +- [goose's implementation](https://github.com/block/goose/blob/main/crates/goose/src/agents/mcp_client.rs) currently supports text and image content types +- goose automatically advertises sampling capability to all MCP servers + +**Use Cases:** Document summarization, smart search filtering, code analysis, data insights + +**Learn More:** See the [MCP Specification](https://modelcontextprotocol.io/specification/draft/client/sampling) for technical details. + +### MCP-UI: Interactive Extensions + +**[MCP-UI Extensions](/docs/guides/interactive-chat/mcp-ui)** enable rich, interactive user interfaces instead of text-only responses, transforming static MCP servers into dynamic, engaging experiences. + +**Key Benefits:** +- Your MCP server can return interactive UI components alongside or instead of text +- Components render securely in isolated environments within goose Desktop +- Real-time user interactions trigger callbacks to your MCP server +- Standardized protocol ensures consistent behavior across different clients + +**Getting Started:** +- Use MCP-UI SDKs in multiple programming languages to create `UIResource` objects in your MCP server +- Return UI components from tools or resources using the standardized specification +- goose Desktop automatically renders MCP-UI components when detected +- Components support multiple rendering approaches for flexible styling + +**Use Cases:** Interactive forms, seat selection maps, data visualization dashboards, booking interfaces, configuration wizards +**Learn More:** See the [MCP-UI Specification](https://mcpui.dev/guide/introduction) for technical details and implementation examples. [mcp-docs]: https://modelcontextprotocol.io/ [mcp-python]: https://github.com/modelcontextprotocol/python-sdk From 96d795d08fd6979f89f30bbf9a2318b6cb2e9012 Mon Sep 17 00:00:00 2001 From: Diane Diaz Date: Wed, 12 Nov 2025 15:42:06 -0800 Subject: [PATCH 2/4] clarify goose's AI --- documentation/docs/guides/mcp-sampling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/docs/guides/mcp-sampling.md b/documentation/docs/guides/mcp-sampling.md index a5b42a71b737..1710bb53504c 100644 --- a/documentation/docs/guides/mcp-sampling.md +++ b/documentation/docs/guides/mcp-sampling.md @@ -8,9 +8,9 @@ description: Transforms MCP servers into intelligent agents that can think, anal import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -MCP Sampling can transform extensions from simple data providers into intelligent agents. Instead of just returning raw information for goose to interpret, extensions can leverage goose's AI to provide expert-level guidance, perform contextual analysis, and create entirely new interaction patterns. +MCP Sampling can transform extensions from simple data providers into intelligent agents. Instead of just returning raw information for goose to interpret, extensions can leverage goose's AI capabilities to provide expert-level guidance, perform contextual analysis, and create entirely new interaction patterns. -This feature is automatically enabled in goose—no configuration required! Any MCP server extension that supports sampling will automatically have access to goose's AI. This means: +This feature is automatically enabled in goose—no configuration required! Any MCP server extension that supports sampling will automatically have access to goose's main configured LLM provider. This means: - goose users can get more targeted responses tailored to the extension's specific capabilities - Developers can add sampling support to their MCP servers to provide enhanced capabilities in goose From b034d2e29c7f3ada8c742f94d86fbf0450d8c93e Mon Sep 17 00:00:00 2001 From: dianed-square <73617011+dianed-square@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:16:40 -0800 Subject: [PATCH 3/4] Apply suggestion from @angiejones Co-authored-by: Angie Jones --- documentation/docs/guides/mcp-sampling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/guides/mcp-sampling.md b/documentation/docs/guides/mcp-sampling.md index 1710bb53504c..ac00bc5c853d 100644 --- a/documentation/docs/guides/mcp-sampling.md +++ b/documentation/docs/guides/mcp-sampling.md @@ -12,7 +12,7 @@ MCP Sampling can transform extensions from simple data providers into intelligen This feature is automatically enabled in goose—no configuration required! Any MCP server extension that supports sampling will automatically have access to goose's main configured LLM provider. This means: - goose users can get more targeted responses tailored to the extension's specific capabilities -- Developers can add sampling support to their MCP servers to provide enhanced capabilities in goose +- developers can add sampling support to their MCP servers to provide enhanced capabilities in goose :::info [MCP Sampling](https://modelcontextprotocol.io/specification/draft/client/sampling) is a feature in the Model Context Protocol. From d5672dfbda7c22cd6eb9474a17812a7cf6b2462b Mon Sep 17 00:00:00 2001 From: Diane Diaz Date: Wed, 12 Nov 2025 17:09:13 -0800 Subject: [PATCH 4/4] use friendly description --- documentation/docs/guides/mcp-sampling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/guides/mcp-sampling.md b/documentation/docs/guides/mcp-sampling.md index ac00bc5c853d..3eb7f0fbb733 100644 --- a/documentation/docs/guides/mcp-sampling.md +++ b/documentation/docs/guides/mcp-sampling.md @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem'; MCP Sampling can transform extensions from simple data providers into intelligent agents. Instead of just returning raw information for goose to interpret, extensions can leverage goose's AI capabilities to provide expert-level guidance, perform contextual analysis, and create entirely new interaction patterns. -This feature is automatically enabled in goose—no configuration required! Any MCP server extension that supports sampling will automatically have access to goose's main configured LLM provider. This means: +This feature is automatically enabled in goose, no configuration required! Any MCP server extension that supports sampling will automatically have access to the LLM that goose is using. This means: - goose users can get more targeted responses tailored to the extension's specific capabilities - developers can add sampling support to their MCP servers to provide enhanced capabilities in goose