piekstra/newrelic-mcp
If you are the rightful owner of newrelic-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The New Relic MCP Server is a serverless API that allows AI assistants to query New Relic monitoring data directly, providing real-time insights into application performance and infrastructure health.
New Relic MCP Server
Connect Claude Desktop to your New Relic monitoring data with secure, local authentication.
🚀 Quick Setup
Choose your preferred deployment method:
Option A: Deploy to AWS Lambda (Recommended)
1. Prerequisites
- AWS CLI configured with appropriate permissions
- Node.js 18+ installed
2. Set Environment Variables
Copy the example environment file:
cp .env.example .env
Edit .env
and set your values:
NEW_RELIC_API_KEY
- Your New Relic User API key (Get it here)NEW_RELIC_ACCOUNT_ID
- Your account ID (from your New Relic URL)NEW_RELIC_REGION
-US
orEU
(default:US
)MCP_AUTH_TOKEN
- Generate with:openssl rand -hex 32
3. Deploy to AWS
# Load environment variables
source .env
# Deploy using the deployment script
./deploy.sh
Or deploy manually:
npm install
npm run deploy
4. Configure Claude Desktop
After deployment, note the API Gateway URL from the output and add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"newrelic": {
"command": "node",
"args": ["/path/to/newrelic-mcp-client.js"],
"env": {
"MCP_URL": "https://your-api-gateway-url/mcp",
"MCP_AUTH_TOKEN": "your-secure-auth-token-from-step-2"
}
}
}
}
Option B: Deploy to Vercel
1. Set Environment Variables in Vercel
NEW_RELIC_API_KEY
- Your New Relic User API key (Get it here)NEW_RELIC_ACCOUNT_ID
- Your account ID (from your New Relic URL:https://one.newrelic.com/accounts/YOUR_ID
)NEW_RELIC_REGION
-US
orEU
(default:US
)
2. Enable Vercel Deployment Protection
In your Vercel dashboard:
- Go to your deployment settings
- Enable "Deployment Protection"
- Set a secure bypass password
3. Configure Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"newrelic": {
"command": "node",
"args": ["/path/to/newrelic-mcp-client.js"],
"env": {
"MCP_URL": "https://your-deployment.vercel.app/api/mcp/secure",
"VERCEL_BYPASS_TOKEN": "your-bypass-password-from-step-2"
}
}
}
}
📦 Client Setup
Download the MCP client:
curl -o newrelic-mcp-client.js https://raw.githubusercontent.com/yourusername/newrelic-mcp-server/main/client.js
chmod +x newrelic-mcp-client.js
After configuring Claude Desktop, restart it to load the new MCP server.
🔒 Security Features
This MCP server is designed for secure, personal use with multiple deployment options:
AWS Lambda Security:
- API Gateway: Provides built-in DDoS protection and throttling
- MCP Authentication: Custom token-based authentication (
x-mcp-auth
header) - Environment Variables: Your New Relic credentials stored securely in AWS
- IAM Integration: Can be integrated with AWS IAM for additional access control
Vercel Security:
- Deployment Protection: Your entire deployment is protected by Vercel's built-in security
- Bypass Token: Only clients with your bypass token can access the deployment
- Environment Variables: Your New Relic credentials stay secure in Vercel environment
Both deployment options use:
- Local Client: Authentication happens locally through Claude Desktop
- HTTPS: All communication is encrypted in transit
💬 Usage
Ask Claude about your New Relic data:
- "Are there any errors in production?"
- "Show me the health of our api-service"
- "What alerts are currently firing?"
Available Tools
get_applications
- List all monitored applicationsget_alerts
- View active alert incidentsrun_nrql_query
- Execute custom NRQL queriescheck_service_errors
- Analyze service errorsget_service_health
- Get service health metricsget_infrastructure_hosts
- View infrastructure status
Examples
You: "Check if there are any errors in the payment-service"
Claude: [Uses check_service_errors tool to analyze recent errors]
You: "Run a NRQL query to show the slowest transactions"
Claude: [Executes NRQL query and displays results]
You: "What's the current health of all our applications?"
Claude: [Uses get_applications to show health status]
Troubleshooting
General Issues
MCP Connection Failed
- Verify your deployment is live and accessible
- Check the URL in your Claude config is correct
- Ensure you restarted Claude Desktop after config changes
- Test the health endpoint:
curl https://your-endpoint/health
Authentication Errors
- AWS: Verify
MCP_AUTH_TOKEN
matches between deployment and client config - Vercel: Verify
VERCEL_BYPASS_TOKEN
matches your deployment protection password - Check that Node.js is installed and accessible in your PATH
- Ensure the MCP client script has correct permissions (
chmod +x
)
New Relic API Errors
- Confirm you're using a User API key (not License key)
- Verify your account ID is correct
- Check you have the right region (US/EU)
- Test your credentials:
curl -H "X-Api-Key: YOUR_KEY" https://api.newrelic.com/v2/applications.json
AWS-Specific Issues
Deployment Failed
- Ensure AWS CLI is configured with proper permissions
- Check that your AWS credentials have Lambda and API Gateway permissions
- Verify the region is supported (default: us-east-1)
- Check CloudWatch logs for detailed error messages
Function Timeout
- The default timeout is 30 seconds, which should be sufficient for most New Relic API calls
- If you experience timeouts, check your New Relic API response times
Vercel-Specific Issues
Deployment Protection
- Ensure deployment protection is enabled in your Vercel dashboard
- Confirm the bypass token is correctly set in both Vercel and your client config
License
MIT