OpenSearch Logs MCP Server
Provides tools for querying OpenTelemetry logs stored in OpenSearch, supporting search by Lucene syntax, trace ID, service name, error levels, field values, and index mapping across development and production environments.
Enables querying and analysis of OpenTelemetry log data, including structured logs with attributes, resource information, and trace-based correlation for distributed tracing workflows.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenSearch Logs MCP Serversearch errors in prod from the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenSearch Logs MCP Server
MCP (Model Context Protocol) server for querying OpenTelemetry logs in OpenSearch. Supports development (dev) and production (prod) environments.
Architecture
The server follows SOLID principles and Clean Architecture:
src/
├── index.ts # Entry point
├── server.ts # MCP Server setup
├── config/
│ └── environments.ts # Environment configuration
├── types/
│ └── index.ts # Type definitions
├── services/
│ ├── opensearch-client.ts # HTTP client for OpenSearch
│ └── log-search.service.ts # Business logic
├── tools/
│ ├── tool-definitions.ts # Tool schemas
│ └── tool-handlers.ts # Tool execution
└── utils/
├── query-builder.ts # Query construction (Builder pattern)
└── time-range.ts # Time utilitiesApplied Principles
Single Responsibility (SRP): Each module has a single responsibility
Open/Closed (OCP): Easy to add new tools without modifying existing code
Dependency Inversion (DIP): Services depend on abstractions (interfaces)
Builder Pattern:
QueryBuilderfor fluent query construction
Related MCP server: otel-mcp-server
Installation
cd Tools/mcp-opensearch-logs
npm install
npm run buildConfiguration in Cursor
Add this to your Cursor configuration (~/.cursor/mcp.json):
{
"mcpServers": {
"opensearch-logs": {
"command": "node",
"args": ["/ruta/al/proyecto/Tools/mcp-opensearch-logs/dist/index.js"],
"env": {
"OPENSEARCH_DEV_USERNAME": "tu-usuario-dev",
"OPENSEARCH_DEV_PASSWORD": "tu-password-dev",
"OPENSEARCH_PROD_USERNAME": "tu-usuario-prod",
"OPENSEARCH_PROD_PASSWORD": "tu-password-prod"
}
}
}
}Available Tools
search_logs
Free-text search with Lucene syntax.
Parameter | Type | Required | Description | ||||
environment |
|
| ✅ | Environment to query | |||
query | string | ✅ | Query in Lucene syntax | ||||
timeRange |
|
|
|
|
| ❌ | Time range (default: 1h) |
size | number | ❌ | Maximum results (default: 50, max: 200) |
Examples:
"Search for logs containing 'error' in dev from the last hour"
"Search for logs with status 500 in prod from the last 6 hours"
search_by_trace
Search all logs for an OpenTelemetry trace.
Parameter | Type | Required | Description | |
environment |
|
| ✅ | Environment to query |
traceId | string | ✅ | Trace ID | |
size | number | ❌ | Maximum results (default: 100) |
Example:
"Give me all logs for trace abc123 in dev"
search_by_service
Filter logs by service name.
Parameter | Type | Required | Description | ||||
environment |
|
| ✅ | Environment to query | |||
serviceName | string | ✅ | Service name | ||||
level |
|
|
|
|
| ❌ | Log level |
query | string | ❌ | Additional query | ||||
timeRange | string | ❌ | Time range | ||||
size | number | ❌ | Maximum results |
Examples:
"Search for logs from the stori-ios service in prod"
"Give me errors from the stori-ios service in dev"
search_errors
Search for logs with level ERROR or higher (severityNumber >= 17).
Parameter | Type | Required | Description | |
environment |
|
| ✅ | Environment to query |
serviceName | string | ❌ | Filter by service | |
query | string | ❌ | Additional query | |
timeRange | string | ❌ | Time range | |
size | number | ❌ | Maximum results |
Examples:
"Give me errors from the last hour in prod"
"Search for errors related to KYC in dev"
get_field_values
Get the most common values for a field (aggregation).
Parameter | Type | Required | Description | |
environment |
|
| ✅ | Environment to query |
field | string | ✅ | Field to aggregate | |
size | number | ❌ | Maximum unique values (default: 20) |
Examples:
"What values does the 'event' field have in prod?"
"Give me the most common error types in dev"
search_by_field
Search by a specific field and value.
Parameter | Type | Required | Description | |
environment |
|
| ✅ | Environment to query |
field | string | ✅ | Field name | |
value | string | ✅ | Value to search | |
timeRange | string | ❌ | Time range | |
size | number | ❌ | Maximum results |
Example:
"Search for logs with transactionId=abc123 in prod"
get_mapping
Get the index field mapping.
Parameter | Type | Required | Description | |
environment |
|
| ✅ | Environment to query |
Example:
"What fields are available in the prod logs?"
get_sample_log
Get a sample log to see the structure.
Parameter | Type | Required | Description | |
environment |
|
| ✅ | Environment to query |
Example:
"Give me a sample log from prod to see the structure"
Lucene Search Syntax
The query field supports full Lucene syntax:
Syntax | Description | Example |
| Search in any field |
|
| Search in specific field |
|
| Wildcard |
|
| Both terms |
|
| Either term |
|
| Exclude term |
|
| Range |
|
| Exact match |
|
Time Ranges
Value | Description |
| Last 15 minutes |
| Last hour (default) |
| Last 6 hours |
| Last 24 hours |
| Last 7 days |
Development
# Desarrollo con watch mode
npm run dev
# Build
npm run build
# Lint
npm run lintOpenTelemetry Log Structure
Logs follow the OpenTelemetry schema:
{
"time": "2024-01-15T10:30:00.000Z",
"severityText": "ERROR",
"severityNumber": 17,
"body": "Error message",
"attributes": {
"event": "kyc_error",
"kycFlow": "creditL1",
"transactionId": "abc123"
},
"resource": {
"service.name": "stori-ios",
"service.version": "1.0.0"
}
}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProvides 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
- Alicense-qualityDmaintenanceEnables natural language querying and analysis of OpenTelemetry traces, metrics, and logs stored in Elasticsearch/OpenSearch, allowing AI assistants to investigate performance issues, find root causes, and explore system behavior.2514MIT
- FlicenseAqualityDmaintenanceEnables searching and analyzing AWS CloudWatch logs with support for configurable log groups, time-based searches, and service-specific log stream filtering.5
- AlicenseAqualityDmaintenanceEnables querying and analyzing Datadog logs through search, aggregation, and index listing.331MIT
Related MCP Connectors
Read-only access to Auralogs production logs: search logs, inspect errors, review AI analyses.
Investigate errors, track deployments, analyze performance, and manage application monitoring
Search public open-source code, documentation, metadata, vulnerabilities, changelogs, and examples.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/luis-dominguez-stori/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server