Skip to main content

MCP server wrapping the Rapid7 InsightOps REST API (EU region) for log search and analysis

Project description

Rapid7 InsightOps MCP Server

An MCP (Model Context Protocol) server that wraps the Rapid7 InsightOps REST API for log search and analysis. Designed for use with Devin Web (app.devin.ai) as an STDIO MCP server, enabling AI agents to search, query, and analyze production logs directly.

Region: EU only (eu.rest.logs.insight.rapid7.com). Other regions are not supported.

Installation

# From PyPI (once published)
pip install rapid7-mcp-server

# Or directly via uvx
uvx rapid7-mcp-server

# Or from source
pip install git+https://github.com/YOUR_ORG/rapid7-mcp-server.git

Devin Web Setup

  1. Open app.devin.ai and go to Settings > MCP Marketplace
  2. Click "Add Your Own"
  3. Paste this configuration:
{
  "transport": "STDIO",
  "command": "uvx",
  "args": ["rapid7-mcp-server"],
  "env_variables": {
    "RAPID7_API_KEY": "<your Rapid7 API key>"
  }
}
  1. Save. The server will start automatically when Devin uses any Rapid7 tool.

Environment Variables

Variable Required Description
RAPID7_API_KEY Yes Your Rapid7 InsightOps API key (read-only permission is sufficient)

If RAPID7_API_KEY is not set, the server starts but every tool returns a clear error message.

Available Tools

Tool Description
rapid7_list_logs List all available logs to discover log key UUIDs. Optional name filter.
rapid7_list_log_sets List all log sets. Optional name filter.
rapid7_query_log Search a single log using a LEQL query with time range, pagination.
rapid7_query_multiple_logs Search across multiple logs simultaneously (POST-based).
rapid7_query_log_set Search all logs within a log set by name or ID.
rapid7_get_context Get surrounding log lines before/after a specific log entry.
rapid7_download_logs Download raw log data as plain text (max 10 logs).
rapid7_search_trace High-level convenience: search for a traceId across multiple logs.

LEQL Quick Reference

LEQL (Log Entry Query Language) is used in the query parameter:

# Text search (case-insensitive substring)
where(error)
where(NullPointerException)

# Key-value search
where(traceId=abc-123-def)
where(statusCode>=400 AND statusCode<500)

# Regex search
where(/timeout.*connection/i)

# Boolean operators
where(error AND NOT healthcheck)
where(level=ERROR OR level=FATAL)

# Statistical queries (returns counts/aggregates, not log lines)
calculate(COUNT)
where(level=ERROR) calculate(COUNT)
where(statusCode>=500) calculate(COUNT) groupby(service)
calculate(AVERAGE:responseTime) groupby(endpoint)

Time Range Examples

Relative: last 5 minutes, last 1 hour, last 24 hours, last 7 days, yesterday, today

Absolute: Use from_timestamp and to_timestamp (UNIX milliseconds).

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/

# Run the server locally (for testing)
RAPID7_API_KEY=your-key rapid7-mcp-server

License

MIT

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

rapid7_mcp_server-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

rapid7_mcp_server-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rapid7_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rapid7_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8efda2e66b70b302f000a8f36247f69038d79164d4e39716d3baf5c47a3f459d
MD5 317a7dfac434a101babe75d028843b83
BLAKE2b-256 caac55976f0060f2d69b2be93294064edb854bc8a94c2fa4108ba020d2d11554

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rapid7_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b002523de2425163b4ee33789f8b5d827cd8d4f7e48fb79d9e8e399240958152
MD5 0b40555686a744dd60ab8f29e419120e
BLAKE2b-256 3d7d5b3a0422099c7d03708ed6b925fd189682ba3100a617809e66107c85a58d

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