npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@savvagent/mcp-datadog

v1.0.1

Published

Savvagent Datadog MCP integration - Connect feature flags with Datadog APM and monitoring

Downloads

97

Readme

@savvagent/mcp-datadog

Datadog MCP integration for Savvagent. Exposes Datadog APM, metrics, logs, and monitoring data via MCP tools using StreamableHTTP transport with Bearer token authentication.

Features

  • get_errors: Fetch APM error traces
  • get_metrics: Query time-series metrics
  • get_traces: Fetch APM distributed traces
  • get_logs: Search and retrieve logs
  • get_monitors: Get monitor/alert status
  • get_service_health: Get APM service health overview
  • get_events: Get events from event stream

Installation

npm install @savvagent/mcp-datadog

Quick Start

import { DatadogMCPServer } from '@savvagent/mcp-datadog';
import { createHttpHandler } from '@savvagent/mcp-sdk';
import express from 'express';

const server = new DatadogMCPServer(
  { name: 'datadog-mcp', version: '1.0.0' },
  {
    apiKey: process.env.DD_API_KEY!,
    appKey: process.env.DD_APP_KEY!,
    site: 'datadoghq.com',
    environment: 'production',
    service: 'my-service',
  }
);

await server.initialize();

const app = express();
app.use(express.json());

app.post('/mcp', createHttpHandler(server, {
  auth: { token: process.env.MCP_AUTH_TOKEN! }
}));

app.get('/health', async (req, res) => {
  const health = await server.healthCheck();
  res.status(health.status === 'ok' ? 200 : 503).json(health);
});

app.listen(3000);

Configuration

DatadogConfig

interface DatadogConfig {
  apiKey: string;       // Datadog API key
  appKey: string;       // Datadog Application key
  site?: string;        // Datadog site (default: datadoghq.com)
  environment?: string; // Environment filter
  service?: string;     // Service filter
}

Getting Datadog Credentials

  1. API Key: Organization Settings → API Keys
  2. Application Key: Organization Settings → Application Keys
  3. Site: Your Datadog region (datadoghq.com, datadoghq.eu, us3.datadoghq.com, etc.)

Available Tools

get_errors

Fetch APM error traces from Datadog.

| Parameter | Type | Description | |-----------|------|-------------| | time_range | string | 15m, 1h, 4h, 1d, 2d, 7d | | service | string | Service name filter | | environment | string | Environment filter | | limit | integer | Max results (1-1000) |

get_metrics

Query time-series metrics.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | query | string | Yes | Datadog metrics query | | time_range | string | No | 15m, 1h, 4h, 1d, 7d |

get_traces

Fetch APM distributed traces.

| Parameter | Type | Description | |-----------|------|-------------| | service | string | Service name filter | | operation | string | Operation name filter | | time_range | string | 15m, 1h, 4h, 1d | | min_duration_ms | integer | Minimum duration | | status | string | ok or error | | limit | integer | Max results (1-100) |

get_logs

Search and retrieve logs.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | query | string | Yes | Log search query | | time_range | string | No | 15m, 1h, 4h, 1d, 7d | | limit | integer | No | Max results (1-1000) |

get_monitors

Get monitor/alert status.

| Parameter | Type | Description | |-----------|------|-------------| | name | string | Filter by name pattern | | tags | string | Filter by tags (comma-separated) | | status | string | Alert, Warn, No Data, OK |

get_service_health

Get APM service health overview.

| Parameter | Type | Description | |-----------|------|-------------| | service | string | Specific service name | | environment | string | Environment filter | | time_range | string | 15m, 1h, 4h, 1d |

get_events

Get events from event stream.

| Parameter | Type | Description | |-----------|------|-------------| | priority | string | normal or low | | sources | string | Comma-separated sources | | tags | string | Comma-separated tags | | time_range | string | 1h, 4h, 1d, 7d |

Environment Variables

MCP_AUTH_TOKEN=your-mcp-token
DD_API_KEY=your-api-key
DD_APP_KEY=your-app-key
DD_SITE=datadoghq.com
DD_ENV=production
DD_SERVICE=my-service
PORT=3000

Example Server

export MCP_AUTH_TOKEN=your-mcp-token
export DD_API_KEY=your-api-key
export DD_APP_KEY=your-app-key

npx ts-node example-server.ts

Testing

curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-mcp-token" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_service_health","arguments":{"time_range":"1h"}},"id":1}'

License

MIT