contextpulse
Back to Docs Overview
Getting Started

Quickstart

Get your MCP server monitored in under 2 minutes with one line of code.

1. Install the SDK

Install the ContextPulse package for your runtime environment (Node.js or Python).

TypeScript / Node.js
npm install @contextpulse/sdk
# or
pnpm add @contextpulse/sdk
# or
yarn add @contextpulse/sdk
Python
pip install contextpulse
# or
uv add contextpulse

2. Obtain your API Key

Log into the ContextPulse dashboard at https://app.contextpulse.online, create a project workspace, and copy your API key.

Store this key as an environment variable (CONTEXTPULSE_KEY or CONTEXTPULSE_API_KEY) in your server deployment environment.

3. Wrap your MCP Server

Pass your server instance into `withContextPulse` (TypeScript) or `contextpulse.wrap()` (Python).

TypeScript / Stdio Server
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { withContextPulse } from "@contextpulse/sdk";

const server = new McpServer({
  name: "acme-mcp-server",
  version: "1.0.0"
});

// Register your tools normally
server.tool("search_docs", "Search company knowledge base", {}, async () => {
  return { content: [{ type: "text", text: "Results..." }] };
});

// Wrap server at export or execution boundary
export default withContextPulse(server, {
  apiKey: process.env.CONTEXTPULSE_KEY,
  service: "acme-mcp-server",
  environment: process.env.NODE_ENV || "production",
});
Python / FastMCP Server
from mcp.server.fastmcp import FastMCP
from contextpulse import with_contextpulse
import os

mcp = FastMCP("acme-python-server")

@mcp.tool()
def search_docs(query: str) -> str:
    """Search internal documentation."""
    return f"Results for {query}"

# Wrap server with ContextPulse telemetry
server = with_contextpulse(
    mcp,
    api_key=os.environ.get("CONTEXTPULSE_KEY"),
    service="acme-python-server",
    environment="production"
)

if __name__ == "__main__":
    server.run()