Metadata-Version: 2.4
Name: dbay-sre-mcp
Version: 0.1.0
Summary: MCP server exposing SRE-style log diagnostics (search, trace, errors, stats) over a Postgres-backed log store
Project-URL: Homepage, https://github.com/MatrixDriver/lakeon/tree/main/dbay-sre-mcp
Project-URL: Repository, https://github.com/MatrixDriver/lakeon
Project-URL: Issues, https://github.com/MatrixDriver/lakeon/issues
Author-email: Jacky Li <jackylk@apache.org>
License: Apache-2.0
Keywords: agent,llm,logs,mcp,postgres,sre
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Requires-Dist: fastmcp>=2.0
Requires-Dist: psycopg2-binary>=2.9
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

# dbay-sre-mcp

MCP (Model Context Protocol) server exposing SRE-style log diagnostics over a Postgres-backed log store. Designed for use by LLM agents that need to query structured application logs.

## Tools exposed

| Tool | Purpose |
|---|---|
| `log_search(component, level, keyword, tenant_id, db_id, since, limit)` | Flexible search across the `logs` table |
| `log_trace(request_id)` | Follow all log rows belonging to a single request chain |
| `log_errors(since, component)` | Recent error spike summary |
| `log_stats(since)` | Overview of activity by level/component |

## Install

```bash
pip install dbay-sre-mcp
```

## Configure

Point at your Postgres log store via either:

- `LOG_DB_DSN` environment variable, or
- `~/.dbay/sre-config.json` with key `"dsn"`

Expected `logs` table schema:

```
logs(id, ts, level, component, request_id, tenant_id, db_id, logger, msg, duration_ms, extra, thread)
```

## Use as MCP server

```bash
dbay-sre-mcp
```

Then connect from any MCP-compatible client (Claude Code, Hermes, Codex, custom).

## License

Apache-2.0
