Skip to main content

New Relic MCP Server for monitoring and metrics

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_neoai_agent_newrelic_mcp-0.1.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_neoai_agent_newrelic_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_neoai_agent_newrelic_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for iflow_mcp_neoai_agent_newrelic_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b4224c7159c1cf365ec5603006e29b4c3376c14bce27e0f3c264a842292c6a0
MD5 f76fd68210689b2dd9ed853ba19e41a5
BLAKE2b-256 7b6b51d416c35a9698b579b30d39bfae06e4e958f4d0cb3bc4ff47be36a1c5de

See more details on using hashes here.

File details

Details for the file iflow_mcp_neoai_agent_newrelic_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_neoai_agent_newrelic_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for iflow_mcp_neoai_agent_newrelic_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e706afc23d9f322dd07edc2b06ae2d9c2dca82f6300be8a3e8308107e88d17af
MD5 cf1e3253e0d9da5e63d6cfcd4fed61d7
BLAKE2b-256 cb7d851f9bc5cc341a2cd52e57a9b719ab53c7fd5e101bba665d52f8d2452e1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page