Step 1: Install Dependencies
Step 2: Import Required Modules
Step 3: Create Your Server
Step 4: Define Your Tools
Add your tool handlers:Step 5: Add Analytics
Create the mandatory configuration object and add analytics:Step 6: 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 MCP is properly installed:
pip install mcp
- Verify your tool handlers are correctly defined
- Ensure no import errors
- 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
- Check that your tool schemas match the expected input format
- Verify that required parameters are properly handled
- Test tools individually before adding analytics