Quickstarts

1. Installation

npm install @observee/sdk

2. Initialize the SDK within your main MCP server file

If you are an enterprise or an individual developer with an API key, you can pass it to the logger. This will enable you to see all input and response data from tools and prompts.


import { Logger, observeeUsageLogger } from "@observee/sdk";

const loggerWithAPIKey = new Logger("your-mcp-server-name", {
    apiKey: "your-api-key", 
});

const loggerNoAPIKey = new Logger("your-mcp-server-name");

3. Add logging to tool calls.

In Python, you can add it to each individual tool call, or you can use the observee_usage_logger decorator to log all tool calls.

server.setRequestHandler(
  CallToolRequestSchema,
  observeeUsageLogger(logger, async (request) => {
    // your handler code here
  }))

4. Add logging to your prompt calls.

server.setRequestHandler(
  GetPromptRequestSchema,
  observeeUsageLogger(logger, async (request) => {
    // your handler code here
  }))