{"_id":"@davidcrocq/newrelic-mcp-server","name":"@davidcrocq/newrelic-mcp-server","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@davidcrocq/newrelic-mcp-server","version":"1.0.0","description":"New Relic MCP Server for Claude Desktop - Monitor applications, run NRQL queries, manage alerts via Model Context Protocol","type":"module","main":"./build/index.js","types":"./build/index.d.ts","bin":{"newrelic-mcp-server":"build/index.js","newrelic-mcp":"build/index.js"},"publishConfig":{"access":"restricted"},"scripts":{"build":"tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"","dev":"tsc --watch","start":"node build/index.js","clean":"rm -rf build","rebuild":"npm run clean && npm run build","prepublishOnly":"npm run rebuild"},"keywords":["mcp","model-context-protocol","new-relic","newrelic","monitoring","observability","apm","nrql","alerts","claude","claude-desktop","ai","llm","anthropic","npx"],"author":{"name":"David Crocq"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dcrocq/newrelic-mcp-local.git"},"homepage":"https://github.com/dcrocq/newrelic-mcp-local#readme","bugs":{"url":"https://github.com/dcrocq/newrelic-mcp-local/issues"},"engines":{"node":">=18.0.0"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^20.10.0","typescript":"^5.3.0"},"_id":"@davidcrocq/newrelic-mcp-server@1.0.0","gitHead":"ab70d14c325469c49dc76b163c4113a7393c4e6b","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-zUvSwI8HkgTCLT1V2vJZLpXyBcPLqZTuXTuT2xmEPM860NXOIPcMJqGL8eG5Iz+vgJEsvWDfcHRlQ+h8uE9Rlg==","shasum":"08bc0061b20d92fcf169cdfcab321aae0130ff91","tarball":"https://registry.npmjs.org/@davidcrocq/newrelic-mcp-server/-/newrelic-mcp-server-1.0.0.tgz","fileCount":35,"unpackedSize":125453,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNBAFXbOpD/IMXfF6G0pFTlgDF8Cc8yo9UiY+NVhNG6AIgatV0N/bLWAfSRr66nHl5werPkvjD7V9wyFvHdjQyitM="}]},"_npmUser":{"name":"davidcrocq","email":"dcrocq@gmail.com"},"directories":{},"maintainers":[{"name":"davidcrocq","email":"dcrocq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/newrelic-mcp-server_1.0.0_1768345172095_0.3331690994095746"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-13T22:59:31.964Z","1.0.0":"2026-01-13T22:59:32.252Z","modified":"2026-01-13T22:59:32.511Z"},"maintainers":[{"name":"davidcrocq","email":"dcrocq@gmail.com"}],"description":"New Relic MCP Server for Claude Desktop - Monitor applications, run NRQL queries, manage alerts via Model Context Protocol","homepage":"https://github.com/dcrocq/newrelic-mcp-local#readme","keywords":["mcp","model-context-protocol","new-relic","newrelic","monitoring","observability","apm","nrql","alerts","claude","claude-desktop","ai","llm","anthropic","npx"],"repository":{"type":"git","url":"git+https://github.com/dcrocq/newrelic-mcp-local.git"},"author":{"name":"David Crocq"},"bugs":{"url":"https://github.com/dcrocq/newrelic-mcp-local/issues"},"license":"MIT","readme":"# New Relic MCP Server\n\n[![npm version](https://badge.fury.io/js/@davidcrocq%2Fnewrelic-mcp-server.svg)](https://www.npmjs.com/package/@davidcrocq/newrelic-mcp-server)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA TypeScript-based Model Context Protocol (MCP) server for New Relic, designed for use with Claude Desktop. Query your New Relic data, monitor applications, run NRQL queries, and manage alerts directly from Claude.\n\n## Features\n\nThis MCP server provides 13 tools across 4 categories for interacting with New Relic:\n\n### Entity Tools\n- **newrelic-list-entities** - Search for entities (applications, hosts, services, etc.)\n- **newrelic-get-entity** - Get detailed entity information by GUID\n- **newrelic-get-golden-metrics** - Retrieve golden metrics for an entity\n\n### NRQL Tools\n- **newrelic-execute-nrql** - Execute NRQL queries\n- **newrelic-get-dashboards** - List all dashboards\n- **newrelic-get-dashboard** - Get dashboard details\n\n### APM Tools\n- **newrelic-list-applications** - List all APM applications\n- **newrelic-get-application-metrics** - Get application performance metrics\n- **newrelic-get-transactions** - Get transaction data\n- **newrelic-get-errors** - Get error analytics\n\n### Alert Tools\n- **newrelic-list-alert-policies** - List alert policies\n- **newrelic-get-open-incidents** - Get open incidents\n- **newrelic-get-incident-details** - Get incident details\n\n## Prerequisites\n\n- **Node.js 18+** - Required for running the server\n- **New Relic Account** - You need a New Relic account with API access\n- **New Relic API Key** - A User API key from New Relic\n\n### Getting Your New Relic Credentials\n\n1. **API Key**: Go to [New Relic API Keys](https://one.newrelic.com/api-keys) and create a new User API key (type: `NRAK-...`)\n\n2. **Account ID**: Find your account ID in the URL when logged into New Relic:\n   - `https://one.newrelic.com/...?account=YOUR_ACCOUNT_ID`\n   - Or go to **Administration** → **Access Management** → **Accounts**\n\n## Installation\n\n### Quick Start with npx (Recommended)\n\nNo installation required! Configure Claude Desktop to use npx directly (see Configuration section below).\n\n### Global Installation\n\n```bash\nnpm install -g @davidcrocq/newrelic-mcp-server\n```\n\n### Install from Source\n\n```bash\ngit clone https://github.com/dcrocq/newrelic-mcp-local.git\ncd newrelic-mcp-local\nnpm install\nnpm run build\n```\n\n## Configuration\n\n### Environment Variables\n\nThe server requires two environment variables:\n\n| Variable | Description | Example |\n|----------|-------------|---------|\n| `NEW_RELIC_API_KEY` | Your New Relic User API Key | `NRAK-XXXXXXXXXXXXXXXXXXXX` |\n| `NEW_RELIC_ACCOUNT_ID` | Your New Relic Account ID | `1234567` |\n\n### Claude Desktop Configuration\n\nAdd the following to your Claude Desktop configuration file:\n\n**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n\n**Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n**Linux**: `~/.config/Claude/claude_desktop_config.json`\n\n#### Using npx (Recommended - No Installation Required)\n\n```json\n{\n  \"mcpServers\": {\n    \"newrelic\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@davidcrocq/newrelic-mcp-server\"],\n      \"env\": {\n        \"NEW_RELIC_API_KEY\": \"NRAK-your-api-key-here\",\n        \"NEW_RELIC_ACCOUNT_ID\": \"your-account-id\"\n      }\n    }\n  }\n}\n```\n\n#### Using Global Installation\n\n```json\n{\n  \"mcpServers\": {\n    \"newrelic\": {\n      \"command\": \"newrelic-mcp-server\",\n      \"env\": {\n        \"NEW_RELIC_API_KEY\": \"NRAK-your-api-key-here\",\n        \"NEW_RELIC_ACCOUNT_ID\": \"your-account-id\"\n      }\n    }\n  }\n}\n```\n\n#### Using Local Installation (from source)\n\n```json\n{\n  \"mcpServers\": {\n    \"newrelic\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/newrelic-mcp-local/build/index.js\"],\n      \"env\": {\n        \"NEW_RELIC_API_KEY\": \"NRAK-your-api-key-here\",\n        \"NEW_RELIC_ACCOUNT_ID\": \"your-account-id\"\n      }\n    }\n  }\n}\n```\n\n> **Important**: Replace the API key and account ID with your actual New Relic credentials.\n\n### Verify Configuration\n\nAfter updating the configuration:\n\n1. Restart Claude Desktop completely (quit and reopen)\n2. Look for the MCP server icon (hammer icon) in the input area\n3. Click it to see the available New Relic tools\n\n## Usage Examples\n\nOnce configured, you can ask Claude to use the New Relic tools:\n\n### Query Entities\n> \"List all APM applications in my New Relic account\"\n\n> \"Get details for the entity with GUID MTIzNDU2...\"\n\n### Run NRQL Queries\n> \"Run this NRQL query: SELECT count(*) FROM Transaction SINCE 1 hour ago\"\n\n> \"Show me the average response time by transaction name for my app\"\n\n### APM Monitoring\n> \"Show me the top 10 slowest transactions for my-app\"\n\n> \"What errors occurred in my-app in the last hour?\"\n\n### Check Alerts\n> \"List all my alert policies\"\n\n> \"Are there any open incidents right now?\"\n\n## Development\n\n### Build Commands\n\n```bash\n# Build the TypeScript code\nnpm run build\n\n# Watch mode for development\nnpm run dev\n\n# Clean build directory\nnpm run clean\n\n# Rebuild from scratch\nnpm run rebuild\n```\n\n### Project Structure\n\n```\nnewrelic-mcp-server/\n├── src/\n│   ├── index.ts              # Main server entry point\n│   ├── types.ts              # TypeScript type definitions\n│   ├── client.ts             # New Relic GraphQL client\n│   ├── logger.ts             # Logging utility\n│   └── tools/\n│       ├── entity-tools.ts   # Entity search & golden metrics\n│       ├── nrql-tools.ts     # NRQL queries & dashboards\n│       ├── apm-tools.ts      # APM monitoring\n│       └── alert-tools.ts    # Alert policies & incidents\n├── build/                    # Compiled JavaScript (after build)\n├── package.json\n├── tsconfig.json\n├── LICENSE\n└── README.md\n```\n\n### Testing the Server\n\nYou can test the server directly by running:\n\n```bash\n# Set environment variables\nexport NEW_RELIC_API_KEY=\"NRAK-your-key\"\nexport NEW_RELIC_ACCOUNT_ID=\"your-account-id\"\n\n# Run the server\nnpm start\n```\n\nThe server will start and wait for MCP protocol messages on stdin.\n\n## Logging\n\nThe MCP server logs all New Relic API requests and tool calls to a log file for debugging and auditing purposes.\n\n### Log File Location\n\nThe log file is located at:\n\n```\n~/.newrelic-mcp/newrelic-mcp.log\n```\n\n- **macOS/Linux**: `~/.newrelic-mcp/newrelic-mcp.log`\n- **Windows**: `C:\\Users\\<username>\\.newrelic-mcp\\newrelic-mcp.log`\n\n### Viewing Logs\n\n**Real-time monitoring (macOS/Linux)**:\n```bash\ntail -f ~/.newrelic-mcp/newrelic-mcp.log\n```\n\n**View recent logs**:\n```bash\n# Last 50 lines\ntail -50 ~/.newrelic-mcp/newrelic-mcp.log\n\n# Search for errors\ngrep ERROR ~/.newrelic-mcp/newrelic-mcp.log\n\n# Search for specific tool calls\ngrep \"Tool Call\" ~/.newrelic-mcp/newrelic-mcp.log\n```\n\n**Windows PowerShell**:\n```powershell\n# View log file\nGet-Content $env:USERPROFILE\\.newrelic-mcp\\newrelic-mcp.log\n\n# Real-time monitoring\nGet-Content $env:USERPROFILE\\.newrelic-mcp\\newrelic-mcp.log -Wait -Tail 50\n```\n\n### Log Format\n\nEach log entry includes:\n- **Timestamp**: ISO 8601 format\n- **Level**: DEBUG, INFO, WARN, or ERROR\n- **Context**: Component that generated the log\n- **Message**: Description of the event\n- **Data**: Additional JSON data (for requests/responses)\n\nExample log entries:\n```\n[2025-01-13T10:30:45.123Z] [INFO] [MCPServer] Tool Call: newrelic-list-applications\n{\n  \"tool\": \"newrelic-list-applications\",\n  \"arguments\": {}\n}\n[2025-01-13T10:30:45.456Z] [INFO] [NewRelicClient] API Request: ListApplications\n{\n  \"operation\": \"ListApplications\",\n  \"variables\": { \"cursor\": null }\n}\n[2025-01-13T10:30:46.789Z] [INFO] [NewRelicClient] API Response: ListApplications\n{\n  \"operation\": \"ListApplications\",\n  \"durationMs\": 1333,\n  \"success\": true\n}\n```\n\n### Log Rotation\n\n- The log file is automatically rotated when it exceeds 10MB\n- The previous log is saved as `newrelic-mcp.log.old`\n- Only one backup file is kept\n\n### Clearing Logs\n\nTo clear the log file:\n```bash\n# macOS/Linux\nrm ~/.newrelic-mcp/newrelic-mcp.log\n\n# Windows PowerShell\nRemove-Item $env:USERPROFILE\\.newrelic-mcp\\newrelic-mcp.log\n```\n\n---\n\n## Troubleshooting\n\n### Server Not Appearing in Claude\n\n1. Ensure the build was successful: `npm run build`\n2. Check the path in `claude_desktop_config.json` is correct and absolute\n3. Verify environment variables are set in the config\n4. Restart Claude Desktop completely\n\n### Authentication Errors\n\n1. Verify your API key starts with `NRAK-`\n2. Ensure the API key has not expired\n3. Check that your account ID is correct\n\n### GraphQL Errors\n\n1. Some queries may require specific permissions\n2. Ensure your API key has access to the account\n3. Check New Relic's [API Explorer](https://api.newrelic.com/graphiql) to test queries\n\n### Debug Mode\n\nTo see server output, run Claude Desktop from a terminal:\n\n**macOS**:\n```bash\n/Applications/Claude.app/Contents/MacOS/Claude\n```\n\nServer logs will appear in the terminal (stderr).\n\n## API Reference\n\n### New Relic GraphQL API\n\nThis server uses the [New Relic GraphQL API](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/) (NerdGraph) for all operations.\n\n### MCP Protocol\n\nLearn more about the Model Context Protocol at [modelcontextprotocol.io](https://modelcontextprotocol.io/).\n\n## License\n\nMIT License - See [LICENSE](LICENSE) for details.\n","readmeFilename":"README.md","_rev":"1-8ce88304c6fc66749e87e636d225f091"}