Skip to main content
Glama
OCI Load Balancer Log MCP Server

OCI Load Balancer Log MCP Server

by mamorett

OCI Load Balancer Log MCP Server

A Model Context Protocol (MCP) server for querying and analyzing Oracle Cloud Infrastructure (OCI) Load Balancer custom logs. This server allows LLMs to directly search through traffic logs by country, IP, location, and perform aggregated traffic analytics.

Features

  • Search by Country: Filter logs by country name or ISO country code.

  • Search by IP: Look up specific IP addresses or CIDR-style prefixes.

  • Geographic Search: Find traffic originating from specific latitude/longitude bounding boxes.

  • Traffic Analytics: Get top talkers, country distribution, and protocol statistics.

  • Zero Hardcoding: Fully configurable via environment variables.

Related MCP server: Kibana MCP Server

Prerequisites

  1. OCI CLI Configured: You must have a valid OCI configuration file (usually at ~/.oci/config).

  2. Environment Variables: You need the OCIDs for your compartment, log group, and the specific custom log.

Installation & Usage

Running via uvx

You can run the MCP server directly from GitHub without manual installation using uvx:

export OCI_COMPARTMENT_ID="ocid1.tenancy.oc1..xxxx"
export OCI_LOG_GROUP_ID="ocid1.loggroup.oc1.xxxx"
export OCI_LOG_ID="ocid1.log.oc1.xxxx"

uvx --from git+https://github.com/mamorett/oci_lb_log_custom_mcp.git oci-lb-logs

Configuration for MCP Hosts (e.g., Claude Desktop)

Add the following entry to your claude_desktop_config.json:

{
  "mcpServers": {
    "oci-lb-logs": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mamorett/oci_lb_log_custom_mcp.git",
        "oci-lb-logs"
      ],
      "env": {
        "OCI_COMPARTMENT_ID": "ocid1.tenancy.oc1..your_compartment_ocid",
        "OCI_LOG_GROUP_ID": "ocid1.loggroup.oc1.your_region.your_log_group_ocid",
        "OCI_LOG_ID": "ocid1.log.oc1.your_region.your_custom_log_ocid",
        "OCI_CONFIG_PROFILE": "DEFAULT",
        "OCI_CONFIG_FILE": "/absolute/path/to/your/.oci/config"
      }
    }
  }
}

Tools Exposed

IP Tools

list_unique_ips

List all unique IP addresses seen in the logs, deduplicated and sorted by request count. Optionally filter by country to get all IPs from a specific origin.

  • time_range (string): Time window to search (e.g., "24h", "7d"). Default: "24h".

  • limit (integer): Max raw log entries to scan. Default: 500.

  • country (string, optional): Filter by full country name (e.g., "Germany").

  • country_code (string, optional): Filter by ISO country code (e.g., "DE").

Returns a list of IPSummary objects: ip, request_count, country, country_code, city, isp, protocols.

get_top_ips

Return the top N IP addresses ranked by request count over the given time range. Samples a large window of logs to find the noisiest sources.

  • time_range (string): Time window to analyze. Default: "24h".

  • top_n (integer): Number of top IPs to return. Default: 20.

  • sample_limit (integer): Max raw log entries to scan. Default: 5000.

Returns a list of IPSummary objects sorted by request_count descending.

get_ips_by_country

Return unique IP addresses grouped by country, with per-country request totals and unique IP counts. Useful for a full breakdown of all traffic sources by origin.

  • time_range (string): Time window to analyze. Default: "24h".

  • limit (integer): Max raw log entries to scan. Default: 2000.

Returns a list of IPsByCountry objects sorted by total_requests descending. Each entry contains: country, country_code, total_requests, unique_ip_count, and a full ips list of IPSummary.


Search / Filter Tools

search_logs_by_country

Search raw log entries by country name or country code.

  • country (string, optional): Full country name (e.g., "United States").

  • country_code (string, optional): ISO country code (e.g., "US").

  • time_range (string): Time window to search. Default: "24h".

  • limit (integer): Maximum number of entries to return. Default: 100.

search_logs_by_ip

Search raw log entries by a specific IP address or an IP range prefix.

  • ip_address (string, optional): Exact IP address.

  • ip_range (string, optional): IP prefix (e.g., "192.168").

  • time_range (string): Time window to search. Default: "24h".

  • limit (integer): Maximum number of entries to return. Default: 100.

search_logs_by_location

Search raw log entries within a geographic bounding box.

  • lat_min, lat_max, lon_min, lon_max (float): Bounding box coordinates.

  • time_range (string): Time window to search. Default: "24h".

  • limit (integer): Maximum number of entries to return. Default: 100.


Analytics Tools

get_traffic_analytics

Get aggregated traffic statistics (counts only, no IPs). Use the IP tools above if you need actual addresses.

  • group_by (string): Field to aggregate by ("country", "city", "isp", or "protocol"). Default: "country".

  • time_range (string): Time window to analyze. Default: "24h".

  • limit (integer): Number of raw log entries to sample. Default: 1000.

Environment Variables

Variable

Description

Default

OCI_COMPARTMENT_ID

Required. OCID of the OCI Compartment.

N/A

OCI_LOG_GROUP_ID

Required. OCID of the OCI Log Group.

N/A

OCI_LOG_ID

Required. OCID of the OCI Custom Log.

N/A

OCI_CONFIG_PROFILE

Profile name in your OCI config file.

DEFAULT

OCI_CONFIG_FILE

Path to your OCI config file.

~/.oci/config

License

MIT

Available Tools

7 tools
get_ips_by_countryA

Return unique IP addresses grouped by country, with per-country totals. Useful for understanding which countries have the most unique sources.

Inputs: limit, time_range. Returns: result

get_top_ipsB

Return the top N IP addresses ranked by request count over the given time range.

Inputs: top_n, time_range, sample_limit. Returns: result

get_traffic_analyticsC

Get aggregated traffic statistics from OCI Load Balancer logs.

Inputs: limit, group_by, time_range. Returns: top_isps, top_items, time_range, unique_ips, +3 more

list_unique_ipsC

List all unique IP addresses seen in the logs with their request count, country, city, ISP and protocols. Optionally filter by country name or country code.

Inputs: limit, country, time_range, country_code. Returns: result

search_logs_by_countryB

Search OCI Load Balancer logs by country or country code.

Inputs: limit, country, time_range, country_code. Returns: result

search_logs_by_ipA

Search OCI Load Balancer logs by IP address or IP range (prefix).

Inputs: limit, ip_range, ip_address, time_range. Returns: result

search_logs_by_locationC

Search OCI Load Balancer logs within geographic bounds.

Inputs: lat_max (required), lat_min (required), lon_max (required), lon_min (required), +2 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: searching logs by different criteria (country, IP, location), getting aggregate analytics, listing unique IPs, top IPs, and IPs grouped by country. Even overlapping tools like list_unique_ips and get_top_ips differ in scope (all vs. top N) and output details.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with lowercase and underscores: search_logs_by_*, get_traffic_analytics, list_unique_ips, get_top_ips, get_ips_by_country. The verbs (search, get, list) are clear and used consistently.

    Tool Count5/5

    Seven tools is an appropriate size for a log analysis server. Each tool provides a distinct function without being redundant, and the count is neither too sparse nor overwhelming for the domain.

    Completeness4/5

    The tool set covers common log search and analytics operations: filtering by country/IP/location, aggregate traffic stats, and IP-focused queries. Minor gaps exist such as no explicit search by status code or user-agent, but the core workflows for analyzing load balancer logs are well covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      C
      maintenance
      Enables LLMs like Claude to interact directly with Oracle Cloud Infrastructure resources, supporting dynamic profile switching between tenancies and comprehensive management of compute instances, database systems, and OCI resources through natural language.
      85
      4
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides seamless access to Kibana and Periscope logs through a unified API with KQL and SQL querying, AI-powered log analysis, and support for searching across 1.3+ billion logs in 9 indexes.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural-language access to Oracle Cloud Infrastructure resources, allowing users to query compute instances, OKE clusters, networking, and Object Storage via MCP tools.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects Claude to OCI Logging Analytics for natural language querying and analysis of security logs, including detection catalog, MITRE ATT&CK integration, and cross-log correlation.
      2
      MIT