OCI Load Balancer Log MCP Server
Enables querying and analyzing Oracle Cloud Infrastructure Load Balancer custom logs, allowing LLMs to search by country, IP, location, and perform aggregated traffic analytics.
README
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.
Prerequisites
- OCI CLI Configured: You must have a valid OCI configuration file (usually at
~/.oci/config). - 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。