The AI Toolkit currently supports Python and TypeScript MCP servers.
Learning objectives
By the end of this lesson you will be able to:- Consume an MCP server from the AI Toolkit Agent Builder
- Configure an agent with a system prompt and model
- Use MCP tools via natural-language prompts
- Add new tools to an MCP server and reload the agent
Prerequisites
Visual Studio Code
Download and install VS Code if you haven’t already.
AI Toolkit extension
Install AI Toolkit from the VS Code Marketplace.
Exercise: Building a calculator agent
Add the GPT-4o model to AI Toolkit
- Open the AI Toolkit extension from the Activity Bar.
- In the Catalog section, select Models to open the Model Catalog.
- Search for OpenAI GPT-4o and click + Add — make sure to select the GitHub-hosted variant.
- Confirm the model appears in My Models in the Activity Bar.
Create an agent
- In the AI Toolkit Tools section, select Agent (Prompt) Builder.
- Click + New Agent and enter the name Calculator Agent.
- For the Model field, select OpenAI GPT-4o (via GitHub).
Generate a system prompt
- Click the Generate system prompt button.
-
In the Generate a prompt window, enter:
- Click Generate. The system prompt will appear in the System prompt field.
- Review and modify the prompt if needed.
Create the calculator MCP server
- In the Tools section of the Agent Builder, click + MCP Server.
- Select + Add Server → Create a New MCP Server.
- Choose the python-weather template.
- Select Default folder as the save location.
- Name the server Calculator.
- A new VS Code window opens. Select Yes, I trust the authors.
-
In the terminal, create and activate a virtual environment:
-
Install the dependencies:
-
Open src/server.py and replace its contents with the calculator implementation:
Run the agent
- Press F5 to start debugging the MCP server. The Agent Builder opens.
-
In the User prompt field, enter:
- Click Run. The agent should respond that you paid $55.
-
Inspect the Tool Response panel to see the individual tool calls:
multiply(3, 25)→ 75subtract(75, 20)→ 55
- Try more prompts to exercise additional tools.
- When finished, stop the server with Ctrl/Cmd+C in the terminal.
Assignment
Add asquare_root tool to server.py:
- “What is the square root of 225?”
- “I need the square root of 16 plus 7.”
Key takeaways
- The AI Toolkit Agent Builder is a complete environment for building and testing MCP-powered agents.
- You can add new tools to MCP servers at any time and reload the agent to pick them up.
- The AI Toolkit includes Python and TypeScript templates to accelerate server creation.
- Natural-language prompts trigger tool calls automatically — the LLM selects and invokes the right tools.