Installation
The Shinzo TypeScript SDK provides automatic instrumentation for MCP servers built with the@modelcontextprotocol/sdk
. Get started with comprehensive telemetry in just a few minutes.
Requirements
- Node.js: Version 18 or higher
- TypeScript: Version 4.5 or higher (if using TypeScript)
- MCP SDK:
@modelcontextprotocol/sdk
version 1.15.1 or higher
Package Installation
Install the Shinzo instrumentation SDK using your preferred package manager:Peer Dependencies
The SDK requires the MCP SDK as a peer dependency. If you haven’t already installed it:Basic Setup
Once installed, instrument your MCP server with just a few lines of code:Environment Variables
For better security and configuration management, use environment variables:Verification
To verify the installation is working correctly:1. Check Console Output
The SDK logs initialization information:2. Test with Console Exporter
For development, use the console exporter to see telemetry locally:3. 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)
TypeScript Configuration
If you’re using TypeScript, ensure yourtsconfig.json
includes the correct settings:
Build Configuration
ES Modules
The SDK is built as ES modules. Ensure yourpackage.json
includes:
CommonJS Support
If you need CommonJS support, you can use dynamic imports:Docker Installation
If deploying with Docker, include the SDK in your Dockerfile:Troubleshooting Installation
Module Resolution Issues
If you encounter module resolution errors:- Check Node.js version: Ensure you’re using Node.js 18+
- Verify package.json: Make sure
type: "module"
is set - Update dependencies: Run
npm update
to get latest versions
Type Errors
For TypeScript type errors:- Install type definitions:
npm install @types/node
- Update TypeScript: Ensure you’re using TypeScript 4.5+
- Check imports: Use
.js
extensions in import paths
Network Issues
If telemetry isn’t reaching Shinzo Platform:- Check firewall: Ensure outbound HTTPS connections are allowed
- Verify endpoint: Confirm the endpoint URL is correct
- Test connectivity: Try
curl https://api.app.shinzo.ai/health