Skip to content

Commit 4442d30

Browse files
committed
docs: update agent example
1 parent 2496b24 commit 4442d30

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

agent.ipynb.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## Demo agent for Burger MCP
2+
3+
This simple agent uses [GenAIScript](https://microsoft.github.io/genaiscript/) to demonstrate how to interact with the Burger MCP server. You can try changing the prompts and see how the agent behaves.
4+
5+
### Starting the MCP server
6+
Before running the agent, you first need to run the Burger MCP server on your machine. You can do this by running the following command in the root of the repository:
7+
8+
```sh
9+
npm start
10+
```
11+
12+
This command will start all services required, including the Burger API, dashboard, and other components.
13+
14+
> **NOTE:** You can run this command without the need to deploy anything, as all services can running locally if no cloud resources are found.
15+
16+
### Running the agent
17+
To run the agent, you need to have the [GenAIScript extension](https://marketplace.visualstudio.com/items?itemName=genaiscript.genaiscript-vscode) installed in your VS Code, and an LLM configured.
18+
19+
#### Configuring the LLM model
20+
By default, it uses GitHub models, but you can change it to use any other model by modifying the `model` property in the script. See the [GenAIScript documentation](https://microsoft.github.io/genaiscript/configuration/#model-selection) for more details on how to configure the model.
21+
22+
To allow using GitHub models, you need to set the `GITHUB_TOKEN` environment variable with a valid GitHub token that has access to the models. For this, you need to [create a GitHub personal access token](https://github.com/settings/personal-access-tokens/new?name=GitHub+Models+token&description=Used%20to%20call%20GitHub%20Models%20APIs%20to%20easily%20run%20LLMs%3A%20https%3A%2F%2Fdocs.github.com%2Fgithub-models%2Fquickstart%23step-2-make-an-api-call&user_models=read), with the `models:read` permissions.
23+
24+
If you already deployed the application to Azure, GenAIScript will automatically use the deployed LLM model as set in the root `.env` file.
25+
26+
#### Running the script
27+
Once you're set, simply select the ▶️ (**Execute Cell**) button in the top left of the code cell below.
28+
29+
You can edit the question to try different requests to the MCP server.
30+
```js
31+
script({
32+
// Wraps MCP servers with their own agent and system prompt
33+
mcpAgentServers: {
34+
burgerMcp: {
35+
description: 'Manages burger orders and menu',
36+
instructions: 'You\'re an assistant that helps users with managing burger orders and menu information. Use ONLY provided tools to get information and perform actions on behalf of the user. If you can\'t do the specified task, say that you can\'t do it.',
37+
url: 'http://localhost:3000/mcp',
38+
}
39+
},
40+
// Uncomment the following line to use a specific model, default is 'github:gpt-4.1-mini' (uses GitHub models)
41+
// model: 'github:gpt-5-mini',
42+
});
43+
44+
// Example prompt, you can change it to test different scenarios
45+
$`Can you suggest a vegan burger with extra mushrooms and no cheese?`;
46+
```
47+
48+
<!-- genaiscript output start -->
49+
50+
<details>
51+
<summary>👤 user</summary>
52+
53+
```md
54+
Can you suggest a vegan burger with extra mushrooms and no cheese?
55+
```
56+
57+
</details>
58+
59+
<details open>
60+
<summary>🤖 assistant </summary>
61+
62+
<details>
63+
<summary>📠 tool call <code>agent_burgerMcp</code> (<code>call_B27g8HvC5VmXJ92yP323MI45</code>)</summary>
64+
65+
```yaml
66+
query: Suggest a vegan burger with extra mushrooms and no cheese.
67+
```
68+
69+
</details>
70+
71+
</details>
72+
73+
<details>
74+
<summary>🛠️ tool output <code>call_B27g8HvC5VmXJ92yP323MI45</code></summary>
75+
76+
```json
77+
Plan: find a vegan burger on the menu, confirm toppings, add mushrooms, ensure no cheese.
78+
79+
Suggestion:
80+
- Spiced Chickpea Vegan Burger (id: 7) — crispy spiced chickpea patty with vegan tzatziki, arugula, tomato, pickled cucumbers, red onion. (Vegan)
81+
- Customization: add extra Grilled Mushrooms (topping id: 5); no cheese (this burger has no cheese by default).
82+
- Price estimate: $10.99 (burger) + $0.80 (extra mushrooms) = $11.79.
83+
84+
If you want me to place the order, provide <MISSING_INFO>: userId and quantity.
85+
```
86+
87+
</details>
88+
89+
<details open>
90+
<summary>🤖 assistant </summary>
91+
92+
```md
93+
Recommended: Spiced Chickpea Vegan Burger (Vegan)
94+
95+
- Description: Crispy spiced chickpea patty with vegan tzatziki, arugula, tomato, pickled cucumbers, red onion.
96+
- Customization: add extra Grilled Mushrooms (topping id: 5); no cheese (burger is already vegan/no cheese).
97+
- Price estimate: $10.99 (burger) + $0.80 (extra mushrooms) = $11.79.
98+
```
99+
100+
</details>
101+
102+
<!-- genaiscript output end -->
103+
104+
105+
106+
107+

0 commit comments

Comments
 (0)