Skip to main content

Model Context Protocol (MCP)

Unizo offers an MCP server that integrates observability platforms with any LLM provider supporting the MCP protocol. This enables your AI agent to analyze logs, metrics, and traces, investigate issues, and automate monitoring workflows across Datadog, New Relic, Splunk, and other observability tools via a single MCP server.

Supported Tools & Use Cases

The following tools are available in the Observability MCP Server:

Tool NameDescription
observability_list_connectorsGet list of available observability services
observability_list_integrationsGet integrations for a specific observability service
observability_list_logsBrowse logs with filtering and pagination
observability_get_log_detailsRetrieve detailed log entry information

Tool Reference

Service Discovery Tools

observability_list_connectors

Get list of available observability services

Parameters: None

Returns: List of available observability services (e.g., Datadog, Splunk, Elastic)

Example Response:

[
{"name": "datadog"},
{"name": "splunk"},
{"name": "elastic"},
{"name": "new_relic"}
]

observability_list_integrations

Get integrations for a specific observability service

Parameters:

  • connector (string, required): Name of the service (e.g., "datadog", "splunk")

Returns: List of integrations available for the specified service

Example Response:

[
{
"id": "integration-123",
"name": "Production Datadog"
},
{
"id": "integration-456",
"name": "Development Splunk"
}
]

Log Management Tools

observability_list_logs

Browse logs with filtering and pagination

Parameters:

  • integration_id (string, required): Unique identifier for the integration

Returns: Paginated list of log entries

Example Response:

{
"status": "success",
"message": "Retrieved 25 logs",
"data": {
"logs": [
{
"id": "log-2024-11-06-14-30-45-abc123",
"level": "ERROR",
"message": "Failed to process payment transaction: Connection timeout after 30s",
"source": "payment-service",
"timestamp": "2024-11-06T14:30:45Z",
"metadata": {
"service": "payment-service",
"environment": "production",
"region": "us-east-1",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"spanId": "b7ad6b7169203331",
"hostname": "payment-service-01",
"version": "1.2.3",
"tags": ["payment", "transaction", "timeout"]
},
"changeLog": {
"createdDateTime": "2024-11-06T14:30:45Z",
"lastUpdatedDateTime": "2024-11-06T14:30:45Z"
}
},
{
"id": "log-2024-11-06-14-35-12-def456",
"level": "WARNING",
"message": "High memory usage detected: 85% of allocated heap memory in use",
"source": "payment-service",
"timestamp": "2024-11-06T14:35:12Z",
"metadata": {
"service": "payment-service",
"environment": "production",
"region": "us-east-1",
"traceId": "00-1bf8762027de54ee9559fc322d91429d-c8ce6c8280643442-01",
"spanId": "c8ce6c8280643442",
"hostname": "payment-service-01",
"version": "1.2.3",
"tags": ["memory", "performance", "alert"]
},
"changeLog": {
"createdDateTime": "2024-11-06T14:35:12Z",
"lastUpdatedDateTime": "2024-11-06T14:35:12Z"
}
},
{
"id": "log-2024-11-06-14-40-28-ghi789",
"level": "INFO",
"message": "Successfully processed payment transaction for order ORD-2024-1234",
"source": "payment-service",
"timestamp": "2024-11-06T14:40:28Z",
"metadata": {
"service": "payment-service",
"environment": "production",
"region": "us-east-1",
"traceId": "00-2cf9873138ef65ff0670ad433e02539e-d9df7d9391754553-01",
"spanId": "d9df7d9391754553",
"hostname": "payment-service-02",
"version": "1.2.3",
"tags": ["payment", "transaction", "success"]
},
"changeLog": {
"createdDateTime": "2024-11-06T14:40:28Z",
"lastUpdatedDateTime": "2024-11-06T14:40:28Z"
}
},
{
"id": "log-2024-11-06-14-45-33-jkl012",
"level": "CRITICAL",
"message": "Database connection pool exhausted: Unable to acquire connection after 60s",
"source": "order-service",
"timestamp": "2024-11-06T14:45:33Z",
"metadata": {
"service": "order-service",
"environment": "production",
"region": "us-east-1",
"traceId": "00-3dfa984249f076000781be544f13640f-eae09e0402865664-01",
"spanId": "eae09e0402865664",
"hostname": "order-service-03",
"version": "2.1.0",
"tags": ["database", "connection", "critical"]
},
"changeLog": {
"createdDateTime": "2024-11-06T14:45:33Z",
"lastUpdatedDateTime": "2024-11-06T14:45:33Z"
}
},
{
"id": "log-2024-11-06-14-50-05-mno345",
"level": "DEBUG",
"message": "Processing webhook event: customer.subscription.updated",
"source": "webhook-processor",
"timestamp": "2024-11-06T14:50:05Z",
"metadata": {
"service": "webhook-processor",
"environment": "production",
"region": "us-west-2",
"traceId": "00-4efb095360g187111892cf655g24751g-faf10f1513976775-01",
"spanId": "faf10f1513976775",
"hostname": "webhook-processor-01",
"version": "3.0.1",
"tags": ["webhook", "subscription", "event"]
},
"changeLog": {
"createdDateTime": "2024-11-06T14:50:05Z",
"lastUpdatedDateTime": "2024-11-06T14:50:05Z"
}
}
],
"pagination": {
"total": 15420,
"offset": 0,
"limit": 20,
"next": 20,
"previous": null
},
"total_count": 15420
}
}

observability_get_log_details

Retrieve detailed log entry information

Parameters:

  • integration_id (string, required): Unique identifier for the integration
  • log_id (string, required): Unique identifier of the log entry

Returns: Comprehensive log entry details

Example Response:

{
"status": "success",
"message": "Retrieved log details for log-2024-11-06-14-30-45-abc123",
"data": {
"log": {
"id": "log-2024-11-06-14-30-45-abc123",
"level": "ERROR",
"message": "Failed to process payment transaction: Connection timeout after 30s while attempting to communicate with payment gateway. Transaction ID: TXN-20241106-54321. Retry attempts exhausted (3/3).",
"source": "payment-service",
"timestamp": "2024-11-06T14:30:45.123Z",
"stackTrace": "java.net.SocketTimeoutException: Connection timeout\n at com.acme.payment.gateway.GatewayClient.processTransaction(GatewayClient.java:145)\n at com.acme.payment.service.PaymentService.executePayment(PaymentService.java:89)\n at com.acme.payment.controller.PaymentController.processPayment(PaymentController.java:67)",
"metadata": {
"service": "payment-service",
"environment": "production",
"region": "us-east-1",
"traceId": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
"spanId": "b7ad6b7169203331",
"parentSpanId": "a6f3c4b8d9e21743",
"hostname": "payment-service-01.prod.acme-corp.internal",
"version": "1.2.3",
"pid": 12345,
"threadId": "payment-worker-3",
"tags": [
"payment",
"transaction",
"timeout",
"gateway-error",
"retry-exhausted"
],
"custom": {
"transactionId": "TXN-20241106-54321",
"customerId": "CUST-98765",
"amount": 150.00,
"currency": "USD",
"gatewayEndpoint": "https://api.payment-gateway.example.com/v1/charge",
"retryCount": 3,
"timeoutMs": 30000
}
},
"context": {
"request": {
"method": "POST",
"url": "/api/v1/payments/process",
"headers": {
"content-type": "application/json",
"user-agent": "Acme-Payment-Client/1.2.3"
},
"body": {
"transactionId": "TXN-20241106-54321",
"amount": 150.00,
"currency": "USD"
}
},
"response": null,
"user": {
"id": "USER-54321",
"email": "customer@example.com"
}
},
"relatedLogs": [
{
"id": "log-2024-11-06-14-30-15-xyz789",
"level": "INFO",
"message": "Attempting payment transaction TXN-20241106-54321",
"timestamp": "2024-11-06T14:30:15Z"
},
{
"id": "log-2024-11-06-14-30-25-uvw456",
"level": "WARNING",
"message": "Retry attempt 1/3 for transaction TXN-20241106-54321",
"timestamp": "2024-11-06T14:30:25Z"
},
{
"id": "log-2024-11-06-14-30-35-rst123",
"level": "WARNING",
"message": "Retry attempt 2/3 for transaction TXN-20241106-54321",
"timestamp": "2024-11-06T14:30:35Z"
}
],
"changeLog": {
"createdDateTime": "2024-11-06T14:30:45.123Z",
"lastUpdatedDateTime": "2024-11-06T14:30:45.123Z",
"createdBy": {
"href": "https://api.unizo.ai/api/v1/users/system-logger-001",
"id": "system-logger-001",
"firstName": "System",
"lastName": "Logger"
}
}
}
}
}

Installation

Prerequisites

  • A Unizo API key
  • An active Observability integration (Datadog, New Relic, Splunk, Elastic)
  • Node.js v20 or higher

MCP Configuration

Here is an example configuration for setting up the Unizo Observability MCP server:

{
"mcpServers": {
"unizo-observability": {
"command": "npx",
"args": [
"mcp-remote",
"https://api.unizo.ai/mcp",
"--header",
"apikey:${UNIZO_API_KEY}",
"--header",
"x-mcp-scopes:observability"
],
"env": {
"UNIZO_API_KEY": "your_api_key"
}
}
}
}

Client Setup

For detailed setup instructions with specific AI clients:

Environment Variables

The following environment variables are required:

  • UNIZO_API_KEY: Your Unizo API key

Error Handling

All tools return errors in a consistent format:

{
"status": "error",
"message": "Log 'log-2024-11-06-14-30-45-abc123' not found",
"traceback": "..."
}