Agentic Log Search Platform
Provides integration with Elasticsearch for full-text search indexing, enabling fast search of ingested log records.
Provides integration with SQLite as a metadata store and fallback search backend, using SQL LIKE queries for search.
Click on "Deploy 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., "@Agentic Log Search Platformsearch application logs for error messages"
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.
Agentic Log Search Platform (MCP-Based)
A small Python project that ingests Windows application log files, indexes them for fast full-text search, and exposes the ingest and search operations as both HTTP endpoints (Flask) and MCP tools (FastMCP).
Project duration: Feb 14 – 20, 2026
Author: Bharath Kumar Kalavakunta
Features
Agent-based design via FastMCP — two tools (
ingest_logs,search_logs) callable from any MCP-compatible clientDual-backend indexing — Elasticsearch for fast full-text search; SQLite as the always-on metadata store and fallback
Pandas data pipeline — parses and cleans 300+ sample log records before indexing
Performance benchmark —
/benchmarkendpoint compares grep-style linear scan vs indexed search (~60 % faster)gRPC contract — a
.protofile documents the agent-to-backend communication contract (illustrative; HTTP endpoints are the active interface)Test suite — 5 pytest cases covering parsing, indexing, and search (including the empty-result case)
Related MCP server: Unified History MCP
Project Structure
.
├── app.py # Flask app + FastMCP tool definitions
├── core/
│ ├── log_ingestor.py # LogIngestor: parse raw log files with Pandas
│ ├── log_indexer.py # LogIndexer: write to Elasticsearch + SQLite
│ └── log_search_agent.py # LogSearchAgent: query indexed records
├── proto/
│ └── log_search.proto # gRPC service contract (illustrative)
├── data/
│ ├── sample_app1.log # 184 sample entries — WindowsUpdateClient
│ └── sample_app2.log # 144 sample entries — SecurityCenterService
├── tests/
│ └── test_core.py # 5 pytest cases
├── DESIGN.md # Architecture and design decisions
├── requirements.txt
└── conftest.py # Adds project root to sys.path for pytestSetup
1. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate2. Install dependencies
pip install -r requirements.txt3. Elasticsearch (optional)
The application works without Elasticsearch — it falls back to SQLite LIKE
search automatically. If you have access to an Elasticsearch cluster
(local or cloud trial), set the host in app.py:
indexer = LogIndexer(es_host="http://localhost:9200")
agent = LogSearchAgent(es_host="http://localhost:9200")If Elasticsearch is not reachable the application prints:
[LogIndexer] Elasticsearch unreachable — using SQLite only.No other changes are needed.
Running the Application
python app.pyThe Flask development server starts on http://localhost:5000.
Ingest sample logs
curl -X POST http://localhost:5000/ingestOr ingest specific files:
curl -X POST http://localhost:5000/ingest \
-H "Content-Type: application/json" \
-d '{"filenames": ["sample_app1.log"]}'Search indexed logs
curl -X POST http://localhost:5000/search \
-H "Content-Type: application/json" \
-d '{"query": "error", "max_results": 20}'Example response:
{
"count": 8,
"backend": "sqlite",
"elapsed_ms": 1.42,
"results": [
{
"id": 3,
"source_file": "sample_app1.log",
"module": "WindowsUpdateClient",
"level": "ERROR",
"message": "Failed to reach update server: timeout after 30s",
"timestamp": "2026-02-14 10:00:01",
"ingested_at": "2026-02-14 08:14:30"
}
]
}Run the performance benchmark
curl "http://localhost:5000/benchmark?q=error"Example response:
{
"query": "error",
"grep_ms": 0.18,
"indexed_ms": 0.07,
"reduction_pct": 61.1
}Health check
curl http://localhost:5000/healthRunning Tests
pytest tests/ -v --cov=core --cov-report=term-missingExpected output: 5 tests passing with ≥ 80 % coverage on the three core classes.
gRPC Contract
The file proto/log_search.proto defines the agent-to-backend communication
contract. It is illustrative — the active interface is the Flask HTTP API.
To compile Python stubs from the proto:
python -m grpc_tools.protoc -I proto \
--python_out=proto --grpc_python_out=proto \
proto/log_search.protoSee DESIGN.md §5 for details.
Architecture
See DESIGN.md for a full description of the agent architecture, the three core classes, the MCP tools, and the gRPC contract.
Notes
Elasticsearch integration is fully implemented but optional. If unavailable, the system uses SQLite without any code changes required.
The gRPC contract is not wired into the Flask app — the HTTP endpoints serve the same semantic purpose and are the active interface.
The benchmark endpoint measures real timing on the sample dataset; results vary by machine but consistently show a meaningful reduction.
This server cannot be deployed
Maintenance
Related MCP Connectors
Syslog receiver and MCP server for homelab log intelligence.
Syslog receiver and MCP server for homelab log intelligence.
Ingest and search LogsLoom logs from coding agents.
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides programmatic access to ingest and query Windows event logs (especially Sysmon logs), enabling security monitoring, incident response, and log analysis automation.5MIT
- AlicenseAqualityBmaintenanceConfig-driven MCP server for cross-domain full-text search across agent session logs, meeting transcripts, and notification files.71MIT
- AlicenseAqualityBmaintenanceConfig-driven MCP server for cross-domain full-text search across agent session logs, meeting transcripts, and notification files.7MIT
- FlicenseNot gradedqualityCmaintenanceRead-only MCP server for Elasticsearch log querying. Enables natural language search, filtering, context retrieval, and aggregation of logs.-