Quickstart

Get from zero to first event in under two minutes. Choose your language and follow along.

Prerequisites

  • An MCP server (any MCP-compatible server works)
  • An MCPWatch API key (get one free at app.mcpwatch.dev)
  • Node.js 18+ (TypeScript) or Python 3.10+ (Python)

TypeScript

1. Install the SDK

npm install @mcpwatch/sdk

2. Instrument your server

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { instrument } from "@mcpwatch/sdk";

const server = instrument(
  new McpServer({ name: "my-server", version: "1.0.0" }),
  {
    apiKey: process.env.MCPWATCH_API_KEY ?? "",
    debug: true,
  }
);

// Define tools as usual — they are automatically instrumented
server.tool("my_tool", { query: { type: "string" } }, async (args) => {
  return { content: [{ type: "text", text: `Result for ${args.query}` }] };
});

3. Set your API key

export MCPWATCH_API_KEY="your-api-key-here"

4. Start your server

Start your MCP server as usual. MCPWatch captures events automatically.

Python

1. Install the SDK

pip install mcpwatch

2. Instrument your server

import os
from mcp.server import Server
from mcpwatch import instrument

server = instrument(
    Server("my-server"),
    api_key=os.environ["MCPWATCH_API_KEY"],
    debug=True,
)

# Define tools as usual — they are automatically instrumented
@server.tool("my_tool")
async def my_tool(query: str) -> str:
    return f"Result for {query}"

3. Set your API key

export MCPWATCH_API_KEY="your-api-key-here"

4. Start your server

Run your MCP server normally. Events start flowing to your dashboard.

Verify it works

  1. Open your MCPWatch dashboard
  2. Trigger a tool call from any MCP client (Claude Desktop, Cursor, etc.)
  3. Check the dashboard for your event

With debug: true (TypeScript) or debug=True (Python), you’ll also see batch send confirmations in the console.

What’s next?

Last updated — MCPWatch Documentation