Step 1: Install Agnost
Step 2: Import and Initialize
Step 3: Define Your Tools
Add your tools as normal:Step 4: Add Analytics
Create the mandatory configuration object and add analytics:Step 5: Run Your Server
Complete Example
Here’s a complete working example:Configuration Options
The config object is mandatory and must include all 3 fields:Field | Type | Description |
---|---|---|
endpoint | str | API endpoint URL |
disable_input | bool | Whether to disable input tracking |
disable_output | bool | Whether to disable output tracking |
Troubleshooting
Server not starting?- Check that FastMCP is properly installed:
pip install fastmcp
- Verify your tool definitions are correct
- Ensure no port conflicts
- Verify your organization ID is correct
- Check that the Agnost backend is running on the configured endpoint
- Look for any error messages in your server logs
- Update Agnost:
pip install --upgrade agnost
- Ensure you’re using the correct FastMCP import path