Skip to content

Commit eb98498

Browse files
docs: convert the goose example from an E2E to an example (#1356)
**Description** The goose example has been non-stop flakey tests because the model we can use in CI is not strong enough to be predictable. This converts it to an example instead, Signed-off-by: Adrian Cole <[email protected]> Co-authored-by: Takeshi Yoneda <[email protected]>
1 parent fb9c972 commit eb98498

File tree

4 files changed

+81
-150
lines changed

4 files changed

+81
-150
lines changed

examples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Examples demonstrating how to configure the MCP Gateway to connect AI agents to
1717
- OAuth authentication with Keycloak
1818
- Combining LLM routes and MCP routes on the same Gateway
1919

20+
### [Goose Integration](./goose/)
21+
22+
Shows how to integrate the Goose AI agent framework with MCP tools,
23+
demonstrating unified routing of both LLM and MCP calls through the Envoy AI
24+
Gateway for single-agent origin.
25+
2026
## Advanced Features
2127

2228
### [Provider Fallback](./provider_fallback/)

examples/goose/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Goose MCP Recipe Example
2+
3+
## Overview
4+
5+
This example demonstrates how to use [Goose][goose], an AI agent framework by
6+
Block, with the Envoy AI Gateway (aigw). It shows how to create a single agent
7+
that handles both LLM (Large Language Model) calls and MCP (Model Context
8+
Protocol) tool calls through the same gateway.
9+
10+
Goose is an AI agent framework for tools and LLMs. MCP connects AI models to
11+
external tools. The [example recipe](kiwi_recipe.yaml) searches for flights
12+
from New York to Los Angeles on a specified date using the Kiwi flight search.
13+
14+
This demonstrates single-agent origin, where all AI interactions, LLM and MCP,
15+
flow through the Envoy AI Gateway for observability, security, and routing.
16+
17+
## Prerequisites
18+
19+
- Ollama installed and running.
20+
- Goose installed.
21+
- aigw binary installed.
22+
23+
## Manual Steps
24+
25+
1. **Start Ollama** on your host machine:
26+
27+
Run Ollama on all interfaces with a large context size to support access from Docker and handle complex tasks.
28+
29+
```bash
30+
OLLAMA_CONTEXT_LENGTH=131072 OLLAMA_HOST=0.0.0.0 ollama serve
31+
```
32+
33+
2. **Start aigw with MCP configuration**:
34+
35+
Launch aigw in standalone mode to route LLM requests to Ollama and MCP requests to the Kiwi flight search server.
36+
37+
```bash
38+
OPENAI_BASE_URL=http://localhost:11434/v1 OPENAI_API_KEY=unused aigw run --mcp-json '{"mcpServers":{"kiwi":{"type":"http","url":"https://mcp.kiwi.com"}}}'
39+
```
40+
41+
3. **Run the Goose recipe**:
42+
43+
Execute the flight search recipe with Goose, directing it to the Envoy AI Gateway (port 1975) for both LLM and MCP access.
44+
45+
```bash
46+
OPENAI_HOST=http://127.0.0.1:1975 OPENAI_API_KEY=test-key \
47+
goose run --provider openai --model qwen3:1.7b --recipe kiwi_recipe.yaml --params flight_date=31/12/2025
48+
```
49+
50+
- Replace `qwen3:1.7b` with your preferred Ollama model.
51+
- Set `flight_date` to a future date in DD/MM/YYYY format.
52+
53+
4. **Verify the output**:
54+
55+
The recipe outputs a JSON structure with the top 3 flight options from New
56+
York to Los Angeles, including airline, flight number, and price.
57+
58+
Example output:
59+
60+
```json
61+
{
62+
"contents": [
63+
{
64+
"airline": "Example Airlines",
65+
"flight_number": "EA123",
66+
"price": "$299"
67+
},
68+
...
69+
]
70+
}
71+
```
72+
73+
---
74+
75+
[goose]: https://block.github.io/goose/

tests/e2e-aigw/testdata/kiwi_recipe.yaml renamed to examples/goose/kiwi_recipe.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ prompt: |
3131
3232
***********ANY FLIGHT IS FINE. DO NOT CONSIDER ANY USER PREFERENCES.************
3333
34-
# Start aigw like this to use Ollama and Kiwi MCP backends:
35-
# OPENAI_BASE_URL=http://localhost:11434/v1 OPENAI_API_KEY=unused aigw run --mcp-json '{
36-
# "mcpServers": {
37-
# "kiwi": {
38-
# "type": "http",
39-
# "url": "https://mcp.kiwi.com"
40-
# }
41-
# }
42-
# }'
43-
#
44-
# Then, run goose like this to use Envoy AI Gateway for both LLM and MCP:
45-
# OPENAI_HOST=http://127.0.0.1:1975 OPENAI_API_KEY=test-key goose run --provider openai --model qwen3:1.7b --recipe kiwi_recipe.yaml --params flight_date=31/12/2025
4634
extensions:
4735
- name: mcp_gateway
4836
type: streamable_http

tests/e2e-aigw/goose_test.go

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)