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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@piekstras/newrelic-mcp-server

v0.1.0

Published

MCP server for New Relic APIs

Readme

New Relic MCP Server

A Model Context Protocol (MCP) server that provides programmatic access to New Relic APIs, enabling AI assistants and other tools to interact with New Relic monitoring and observability data.

Features

  • APM Application Management: List and retrieve application details, metrics, and metric data
  • NRQL Queries: Execute NRQL queries via NerdGraph
  • Alert Policies: List and manage alert policies
  • Synthetic Monitoring: Access synthetic monitor information
  • Dashboards: List and retrieve dashboard configurations
  • Entity Search: Search across all New Relic entities
  • Infrastructure: Monitor servers and infrastructure components
  • Deployments: Track and create application deployments
  • User Management: List and manage users
  • NerdGraph: Execute custom GraphQL queries

Installation

npm install @piekstras/newrelic-mcp-server

Configuration

The server requires the following environment variables:

# Required
export NEWRELIC_API_KEY="your-api-key-here"  # Your New Relic User API key

# Optional
export NEWRELIC_REGION="US"  # or "EU" (default: "US")
export NEWRELIC_ACCOUNT_ID="your-account-id"  # Required for some operations

Getting Your API Key

  1. Log in to New Relic
  2. Navigate to the API Keys page
  3. Create a new User API key (starts with NRAK)
  4. Copy the key and set it as the NEWRELIC_API_KEY environment variable

Usage

With Claude Desktop

Add the following to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "newrelic": {
      "command": "npx",
      "args": ["@piekstras/newrelic-mcp-server"],
      "env": {
        "NEWRELIC_API_KEY": "your-api-key-here",
        "NEWRELIC_REGION": "US",
        "NEWRELIC_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

With Other MCP Clients

# Start the server
npx @piekstras/newrelic-mcp-server

# Or if installed locally
npm start

Available Tools

Application Management

  • list_applications - List all APM applications
  • get_application - Get details for a specific application
  • get_application_metrics - Get available metrics for an application
  • get_application_metric_data - Get metric data with time range filtering

Querying

  • query_nrql - Execute NRQL queries for data analysis
  • nerdgraph_query - Execute custom NerdGraph GraphQL queries

Monitoring

  • list_alert_policies - List all alert policies
  • get_alert_policy - Get specific alert policy details
  • list_synthetic_monitors - List synthetic monitors
  • get_synthetic_monitor - Get synthetic monitor details

Dashboards & Visualization

  • list_dashboards - List all dashboards
  • get_dashboard - Get dashboard configuration and widgets

Infrastructure

  • list_servers - List monitored servers
  • get_server - Get server details
  • search_entities - Search across all entity types

Deployment Tracking

  • list_deployments - List application deployments
  • create_deployment - Record new deployments

User Management

  • list_users - List account users
  • get_user - Get user details

Examples

Query Application Performance

// List all applications
await tool.call('list_applications');

// Get specific application metrics
await tool.call('get_application_metric_data', {
  appId: '123456',
  metricNames: ['HttpDispatcher', 'Apdex'],
  from: '2024-01-01T00:00:00Z',
  to: '2024-01-02T00:00:00Z'
});

Execute NRQL Query

await tool.call('query_nrql', {
  accountId: '1234567',
  nrql: 'SELECT average(duration) FROM Transaction WHERE appName = "My App" SINCE 1 hour ago'
});

Search Entities

await tool.call('search_entities', {
  query: 'name LIKE "%production%"',
  limit: 50
});

Create Deployment Marker

await tool.call('create_deployment', {
  appId: '123456',
  revision: 'v2.0.1',
  description: 'Production deployment',
  user: 'deploy-bot',
  changelog: 'Fixed critical bug in payment processing'
});

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

# Run tests
npm test

# Type checking
npm run typecheck

# Linting
npm run lint

API Rate Limits

Be aware of New Relic's API rate limits:

  • REST API v2: Subject to rate limiting per account
  • NerdGraph: Higher rate limits but still enforced
  • Synthetic Monitoring API: 3 requests per second

Security

  • Never commit API keys to version control
  • Use environment variables for sensitive configuration
  • API keys should have minimal required permissions
  • Consider using separate keys for different environments

Troubleshooting

Authentication Errors

  • Ensure your API key starts with NRAK
  • Verify the key has the necessary permissions
  • Check if you're using the correct region (US/EU)

Rate Limiting

If you encounter rate limit errors:

  • Implement exponential backoff
  • Cache frequently accessed data
  • Batch operations where possible

Connection Issues

  • Verify network connectivity
  • Check firewall rules for API endpoints
  • Ensure correct base URLs for your region

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Support

For issues and questions: