Skip to main content

New Relic MCP Server

A command-line tool for monitoring and analyzing New Relic application metrics using MCP (Model Control Protocol).

Installation

Install directly from GitHub using pipx:

# Install
pipx install git+https://github.com/neoai-agent/newrelic-mcp.git

# Or run without installation
pipx run git+https://github.com/neoai-agent/newrelic-mcp.git

Quick Start

  1. Set up your environment variables:

    Method: Using .env file

    # Create a .env file in your project directory
    cat > .env << EOL
    # New Relic Credentials
    NEWRELIC_API_KEY=your-newrelic-api-key-here
    NEWRELIC_INSIGHTS_KEY=your-newrelic-insights-key-here
    NEWRELIC_ACCOUNT_ID=your-newrelic-account-id-here
    
    # OpenAI Credentials
    OPENAI_API_KEY=your-openai-api-key-here
    
    # Optional: Model Configuration
    MODEL=openai/gpt-4o-mini
    EOL
    
  2. Create agent.yaml:

- name: "New Relic Agent"
  description: "Agent to get all details of New Relic"
  mcp_servers: 
    - name: "New Relic MCP Server"
      args: ["--api-key=${NEWRELIC_API_KEY}", "--insights-key=${NEWRELIC_INSIGHTS_KEY}", "--account-id=${NEWRELIC_ACCOUNT_ID}", "--openai_api_key=${OPENAI_API_KEY}"]
      command: "newrelic-mcp"
  system_prompt: "You are a SRE devops engineer specialising in New Relic to get APM metrics at performance level. You can use the tools provided to you to get the details of the performnace of apm. Precisely use the tools to get the details of necessary metrics to get the valuable information."
  1. Run the server:
newrelic-mcp --api-key "YOUR_API_KEY" --insights-key "YOUR_INSIGHTS_KEY" --account-id "YOUR_ACCOUNT_ID" --openai_api_key "YOUR_OPENAI_API_KEY"

Available Tools

The server provides the following tools for New Relic APM analysis:

  1. Get transaction details for a specific endpoint:
await get_transaction_details_by_url_path(
    application_name="your-app-name",
    url_path="/api/v1/endpoint",
    time_range_minutes=30
)
  1. Get overall application metrics:
await get_application_metrics(
    application_name="your-app-name",
    time_range_minutes=30
)
  1. Get APM metrics for an application:
await get_newrelic_apm_metrics(
    application_name="your-app-name",
    time_range_minutes=30
)
  1. Get slow transaction details:
await get_application_slow_transactions_details(
    application_name="your-app-name",
    time_range_minutes=30
)
  1. Get top database operations:
await get_application_top_database_operations_details(
    application_name="your-app-name",
    time_range_minutes=30
)
  1. Get transaction breakdown segments:
await get_transaction_breakdown_segments(
    application_name="your-app-name",
    time_range_minutes=30
)

Development

For development setup:

git clone https://github.com/neoai-agent/newrelic-mcp.git
cd newrelic-mcp
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e ".[dev]"

License

MIT License - See LICENSE file for details

Metadata

Release files for iflow-mcp_neoai-agent-newrelic 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_neoai-agent-newrelic 0.1.0
File Size Uploaded
iflow_mcp_neoai_agent_newrelic-0.1.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_neoai-agent-newrelic 0.1.0
File Interpreter ABI Platform
iflow_mcp_neoai_agent_newrelic-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / iflow_mcp_neoai_agent_newrelic-0.1.0.tar.gz

Download URL iflow_mcp_neoai_agent_newrelic-0.1.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
51614950180ece7a0ffea7812a902df16921abe534ff384f7b1596e035860452
BLAKE2b-256 checksum
How to use checksums
ef3fde5df6db22b41246f34b192e1b6d73f8530bdc4c04b66c6ccf784a24f600
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_neoai_agent_newrelic-0.1.0-py3-none-any.whl

Download URL iflow_mcp_neoai_agent_newrelic-0.1.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
548f8dc3eec73e91184c15b0e9765268afccf98bd78d192c0a7fadeba67fa8f8
BLAKE2b-256 checksum
How to use checksums
ec5db9a8cbe7edb4545aa41c8ebe53d43630708ca89c9f1bac871632978a49e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page