Skip to main content

Using the Python SDK

The Shinzo Python SDK provides automatic instrumentation for MCP servers built with Python. Get started with comprehensive telemetry in just a few minutes.

Requirements

Package Installation

Install the Shinzo instrumentation SDK using pip:

Basic Setup

Once installed, instrument your MCP server with just a few lines of code:

FastMCP Example

Traditional MCP SDK Example

SDK Compatibility

Shinzo automatically detects and instruments your MCP server regardless of which Python SDK you use: Both SDKs receive the same comprehensive instrumentation with no additional configuration needed.

Environment Variables

For better security and configuration management, consider using environment variables:

Verification

1. Test with Console Exporter

For development, use the console exporter to see telemetry locally:

2. Execute a Tool

Run your server and execute any tool. You should see telemetry data in:
  • Console output (if using console exporter)
  • Shinzo Platform dashboard (if using HTTP exporter)

Troubleshooting Installation

Import Errors

If you encounter import errors:
  1. Check Python version: Ensure you’re using Python 3.10+.
  2. Verify installation: Run pip show shinzo to confirm it’s installed.
  3. Virtual environment: Make sure you’re in the correct virtual environment.

Type Errors

For type checking issues:
  1. Install type checker: pip install mypy.
  2. Check Python version: Ensure you’re using Python 3.10+ for proper type hints.

Network Issues

If telemetry isn’t reaching the Shinzo Platform:
  1. Check firewall: Ensure outbound HTTPS connections are allowed.
  2. Verify endpoint: Confirm the endpoint URL is correct.
  3. Test connectivity: Try curl https://api.app.shinzo.ai/health.

Next Steps

Now that you have the SDK installed:

Configuration

Learn about all available configuration options.
Need help? Contact us at austin@shinzolabs.com or check our GitHub repository.