# Logflare MCP for AI Agents AI Agent Connect

> Logflare (Log Management Analytics) MCP lets you manage your logs and run analytics through your AI agent. You can send log events, run complex SQL queries against your data, and trigger specific endpoints to get structured reports without switching tabs or writing manual queries every time.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_vSM9IZDkylvc37x5hEtMMSqMh2HqlPP3QUInZire/ai-agent-connect
- **Tags:** logging, bigquery, sql-analytics, observability, real-time-logs

## Description

The Logflare MCP lets you talk to your logs like they were a conversation. Instead of jumping between different dashboards and writing SQL from scratch, you just tell your AI client what you need to find. This Connector connects your Logflare account to your agent, letting you pull specific data points or check the health of your infrastructure instantly. If you need to see why a service is failing, you can ask for the latest errors. If you need to see how many users signed up today, you can run a query to get that number. It is about moving from asking how to find data to simply getting the answer. By hosting this in the Vinkius catalog, you can connect once to access this and over 4,000 other Connectors from your preferred AI client. You no longer have to worry about the syntax of a complex query or the friction of multiple browser tabs. You can quickly check for a spike in 500 errors or look for a specific user ID in a sea of traffic. Your agent handles the heavy lifting of the retrieval. You get a direct line to your data, making it easier to spot trends, debug issues, and share accurate metrics with your team. This setup removes the manual overhead of log management and puts the power of your BigQuery-backed storage directly into your chat interface.

## Tools

### ingest_logs_by_name
Send log events to a Logflare source using a human-readable name. This makes it easier to send logs to specific destinations using clear labels.

### management_query
Execute an ad-hoc SQL query against your Logflare data, including a required timestamp filter. You can use this to find specific patterns or troubleshoot issues in your logs.

### query_endpoint_by_id
Call a Logflare Endpoint by its UUID to retrieve data using a JSON object for parameters. This allows for precise data retrieval when you have a specific endpoint ID.

### query_endpoint_by_name
Call a Logflare Endpoint by its name to get a structured analytical report with custom parameters. This helps you get specific data summaries without writing custom code.

### ingest_logs_by_id
Send log events to a specific Logflare source using its unique UUID. This is useful for automated systems that need to route logs to specific buckets.

## Prompt Examples

**Prompt:** 
```
Find all error logs from the 'auth-service' in the last 5 minutes.
```

**Response:** 
```
I've analyzed the logs for the 'auth-service' from the last 5 minutes. Here are the errors found:

| Timestamp | Error Message | Request ID |
| :--- | :--- | :--- |
| 14:02:01 | Connection timeout | req_8821 |
| 14:02:45 | Database connection refused | req_8830 |
| 14:03:12 | Auth token expired | req_8845 |

**Summary:** The most frequent issue is a database connection refusal, which may indicate a pool exhaustion or a downstream service outage.
```

**Prompt:** 
```
Get the daily summary for October 27th.
```

**Response:** 
```
I've retrieved the summary for October 27th from the analytics endpoint.

**Daily Summary: 2023-10-27**
* **Total Events:** 15,420
* **Successful Signups:** 432
* **Failed Logins:** 12
* **Average Latency:** 240ms

Would you like me to break down the signup count by region or device type?
```

**Prompt:** 
```
Send a log to 'payment-gateway' saying 'Retry failed' with a status of 503.
```

**Response:** 
```
I've successfully sent the log event to the 'payment-gateway' source. 

**Status:** Success
**Source:** payment-gateway
**Message:** Retry failed
**Metadata:** {"status": 503}
```

## Capabilities

### Send log events
Push batches of logs to specific sources using names or IDs.

### Run SQL queries
Execute complex BigQuery or PostgreSQL queries on your log data.

### Trigger endpoints
Call pre-configured endpoints with custom parameters for reports.

### Monitor app status
Get instant updates on your infrastructure and application health.

### Ingest custom logs
Send your own application logs for real-time debugging.

## Use Cases

### Finding a production bug
A DevOps engineer asks the agent to find all 500 errors from the last 10 minutes. The agent uses `management_query` to pull the logs and identifies a database timeout.

### Daily usage reporting
A data analyst asks for a summary of new signups today. The agent calls `query_endpoint_by_name` with the date parameter to return a clean table.

### Live debugging
A developer sends a batch of test logs to a specific source using `ingest_logs_by_id` to see how the new feature handles edge cases.

### Infrastructure health check
An engineer asks the agent for the current status of the auth service. The agent queries the latest logs to confirm the service is responding.

## Benefits

- Get instant answers to production questions without writing SQL. Use `management_query` to find errors in seconds. This lets you identify the root cause of an incident immediately without having to switch to a separate database tool.
- Automate report generation by calling specific endpoints. Use `query_endpoint_by_name` to get structured data for your team. This turns a manual data gathering task into a simple natural language request for your agent.
- Speed up debugging by sending custom logs directly from your app. Use `ingest_logs_by_name` to see live data. This is perfect for watching real-time flow during a testing phase or a deployment.
- Reduce context switching between your IDE and your log dashboard. Query your logs directly from your favorite AI client. You can stay in your flow while your agent pulls the specific log lines you need.
- Simplify log ingestion by using human-readable names. Use `ingest_logs_by_id` to organize your data sources clearly. This makes it much easier to manage multiple different log streams from different services.

## How It Works

The bottom line is you get instant access to your log data through natural language instead of manual SQL.

1. Connect your Logflare API key to the Connector.
2. Describe the log data or query you need to your AI client.
3. Get the results, summaries, or logs directly in your chat interface.

## Frequently Asked Questions

**Can I use the Logflare MCP to run SQL queries?**
Yes, you can use it to run ad-hoc SQL queries against your data to find specific patterns or troubleshoot issues.

**Does the Logflare MCP support BigQuery?**
It allows you to execute queries against BigQuery-backed log storage using natural language.

**Can I send logs to Logflare using this Connector?**
You can ingest log events into specific sources using either a unique ID or a human-readable name.

**How does the Logflare MCP help with reporting?**
You can trigger pre-configured endpoints with custom parameters to get structured analytical reports.

**Can I use this to monitor my app in real-time?**
Yes, you can query your logs instantly to see the current status of your infrastructure.

**Is the Logflare MCP good for DevOps?**
It helps DevOps engineers identify the root cause of incidents faster by querying logs without leaving their workspace.

**What are the requirements for running a management query?**
You must provide a valid BigQuery SQL string. Crucially, Logflare requires a WHERE filter on the timestamp field to optimize the query. You can also optionally provide a PostgreSQL version of the query using the `management_query` tool.

**Can I ingest logs using just the source name instead of a UUID?**
Yes! You can use the `ingest_logs_by_name` tool. Simply provide the human-readable name of your source and the array of log events you wish to send.

**How do I pass parameters to a pre-configured Logflare Endpoint?**
Use the `query_endpoint_by_name` or `query_endpoint_by_id` tools and provide a JSON object in the `params` field. For example: `{"user_id": "123", "status": "active"}`.