Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Model Context Protocol

This example demonstrates how to use MCP tools in a ReAct agent.

Prerequisites

Quick Start

Set the environment variables for your model:

export MODEL_ID="your-model-id"
export MODEL_BASE_URL="your-base-url"
export MODEL_API_KEY="your-api-key"

Run the MCP server:

python examples/react-mcp/server.py

Run the agent:

python examples/react-mcp/agent.py
I'll check the weather in Beijing for you right away.
[tool#call_hs9xiswsunbcynv946n43z46 call: get_weather]

[tool#call_hs9xiswsunbcynv946n43z46 progress: Getting weather for Beijing]

[tool#call_hs9xiswsunbcynv946n43z46 output: The weather in Beijing is sunny.]
The weather in Beijing is sunny today! It looks like a beautiful day there.