Code
Secure the instance withOS_SECURITY_KEY. Every request to the API and to /mcp must then carry Authorization: Bearer <key>.
mcp_server_example.py
Define a Local Test Client
The client connects to/mcp with the security key in the Authorization header and drives the built-in tools.
test_client.py
Usage
1
Set up your virtual environment
2
Set Environment Variables
3
Install dependencies
4
Run Server
Save the code above as
mcp_server_example.py, then run:5
Run Test Client