psql
command-line client.hotels
table with some sample data.
Connect to PostgreSQL using the psql
command. You may need to adjust the command based on your PostgreSQL setup (e.g., if you need to specify a host or a different superuser).
hotels
table and insert some data:
psql
by typing \q
.
tools.yaml
configuration file, and run the MCP Toolbox server.
For macOS users, the easiest way to install is with Homebrew:
tools.yaml
file. This file defines the data sources MCP Toolbox can connect to and the tools it can expose to your agent. For production use, always use environment variables for secrets.
toolbox
. If you downloaded the binary manually, you’ll need to run ./toolbox
from the directory where you saved it:
http://127.0.0.1:5000
by default and will hot-reload if you make changes to your tools.yaml
file.
ChatVertexAI
for the model and ToolboxClient
to load our tools. The create_react_agent
from langgraph.prebuilt
creates a robust agent that can reason about which tools to call.
Note: Ensure your MCP Toolbox server is running in a separate terminal before executing the code below.
ToolboxClient
.
For more information, see the following resources:
MCP Toolbox has a variety of features to make developing Gen AI tools for databases seamless: