A Model Context Protocol (MCP) server for NewRelic integration, enabling AI agents (Claude Code, etc.) to query and analyze your NewRelic observability data.
- NRQL Queries — Execute NRQL with configurable LIMIT (1–10,000+), solving the hardcoded LIMIT 10 restriction in other MCP servers
- Alert Management — List and inspect alert policies
- APM Integration — Access application performance data
- Incident Analysis — AI-powered root cause analysis
- Log Queries — Search and analyze log data
- MCP Protocol — Supports versions
2024-11-05and2025-06-18 - Caching — Built-in result caching for performance
git clone https://github.com/buallen/newrelic-mcp-server.git
cd newrelic-mcp-server
npm install
npm run buildNEWRELIC_API_KEY=your_api_key_here
NEWRELIC_ACCOUNT_ID=your_account_idCreate a .env file or pass them directly.
Add to your ~/.claude/settings.json:
"newrelic": {
"command": "node",
"args": ["/path/to/newrelic-mcp-server/working-mcp-main.js"],
"env": {
"NEWRELIC_API_KEY": "your_api_key_here",
"NEWRELIC_ACCOUNT_ID": "your_account_id"
}
}# Build and start
docker compose -f docker-compose.mcp.yml up -d
# Or use the helper script
./start-mcp-docker.shSee DOCKER_SETUP.md for full Docker configuration.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "nrql_query",
"arguments": {
"query": "SELECT average(duration) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago LIMIT 100"
}
}
}{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "analyze_incident",
"arguments": {
"incidentId": "12345"
}
}
}┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AI Agent │ │ MCP Server │ │ NewRelic │
│ (Claude Code) │ │ │ │ │
│ ┌─────────────┐ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ MCP Client │◄┼────┼►│ Protocol │ │ │ │ REST API │ │
│ └─────────────┘ │ │ │ Handler │ │ │ └─────────────┘ │
│ │ │ └─────────────┘ │ │ │
│ │ │ ┌─────────────┐ │ │ ┌─────────────┐ │
│ │ │ │ Service │◄┼────┼►│ NerdGraph │ │
│ │ │ │ Layer │ │ │ │ (GraphQL) │ │
│ │ │ └─────────────┘ │ │ └─────────────┘ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Node.js 18+
- NewRelic account and API key
git clone https://github.com/buallen/newrelic-mcp-server.git
cd newrelic-mcp-server
npm install
cp .env.example .env # then edit with your credentials
npm run devnpm test # run all tests
npm run test:coverage # with coverage report
npm run test -- tests/unit/ # unit tests onlynpm run build # compile TypeScript to dist/
npm start # run production build- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes
- Push and open a Pull Request
MIT — see LICENSE for details.