LogAI MCP Server
About
An MCP server for log analysis using the LogAI framework, with optional Grafana and GitHub integrations.
Details
- Author
- getsherlog
- Categories
- Developer Tools, Other, Infrastructure
Jump to
Setup
Install LogAI MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/getsherlog/mcp-sherlog-log-analysis
Follow the installation instructions in the repository README, then restart your MCP client.
An MCP server for log analysis using the LogAI framework, with optional Grafana and GitHub integrations.
A powerful Model Context Protocol (MCP) server that provides a persistent IPython shell per session. The server only exposes a limited number of tools and at the core of it just exposes the following 2 -
And the rest of the tools are more for supporting the LLM to write the code or call the appropriate cli to complete the task. There are some tools for code retrieval based on tree sitter but thats pretty much it.
For example, installing packages or installing cli. Or doing introspection of variables in the ipython shell.
The server also supports adding external mcp servers. The idea here is you can run mcp servers inside the shell that allows you to persist results in the shell with variables and results etc.
One of the primary things I have noticed is that LLMs mess up when provided with a lot of tools and also as is quite evident by now. There are multiple articles and videos (written and shared by people way more qualified than me) and they main theme across them is the problems with tools overload and context limitation.
This server is my attempt at "solving" that problem.
- All tool calls are persisted to a variable in the shell and the LLM would then write code to inspect the variable, slice/dice and get the required part out of a "gigantic" payload. My idea was similar to when us engineers work with large data we get them into dataframes and then slice/dice to get the required part out.
- CLI calls are composable and that helps the LLM to get only the required content
Both are ways of not polluting the context with useless info.
Sherlog MCP Server transforms Claude Desktop into a stateful data analysis powerhouse by providing:
- Session-Aware IPython Shells: Isolated workspaces per session with automatic persistence
- DataFrame-Centric Architecture: Every operation returns DataFrames, creating a unified data model
- Multi-Session Support: Handle up to 4 concurrent sessions with automatic lifecycle management
- MCP Proxy: Seamlessly integrates any external MCP server, executing all operations within the same IPython context
Think of it as giving Claude a persistent Python notebook that maintains separate workspaces for different conversations, where every piece of data is immediately available for the next operation.
Sherlog MCP Server supports different deployment scenarios through specialized Docker containers:
A lightweight, general-purpose environment optimized for data analysis and development workflows.
- GitHub CLI (gh)- Complete GitHub integration for repository management, issues, PRs, and workflows
- Python Ecosystem- Full scientific computing stack (pandas, numpy, matplotlib, etc.)
- System Utilities- Essential command-line tools for file operations and system management
Best For:Data analysis, web scraping, API integrations, general development tasks
A specialized environment for Android development and testing workflows.
- Android SDK & Build Tools- Complete Android development environment
- Java Development Kit (JDK)- Required Java runtime and development tools
- GitHub CLI (gh)- Version control and repository management
- BrowserStack CLI- Real device testing and debugging capabilities
- ADB & Fastboot- Android device communication tools
Best For:Android app development, device testing, mobile automation, CI/CD pipelines
Sherlog MCP Server includes built-in Google OAuth 2.0 support for accessing Google Workspace services (Gmail, Drive, Calendar) directly within IPython sessions. OAuth tokens are securely stored with encryption and automatically refreshed as needed.
Configure withGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETenvironment variables. When running with HTTP transport, OAuth endpoints are available at/auth/google/*for authentication flow.
- Environment Isolation: Each container provides a complete, reproducible environment
- Tool Integration: All CLI tools are accessible through the unifiedcall_cliinterface
- Persistent State: Session data persists across container restarts
- Extensibility: Easy to add new tools or create custom container variants
Sherlog MCP supports connecting from remote Claude instances via HTTP transport. SeeRemote Connection Guidefor detailed setup instructions.
# Session Management export MCP_AUTO_RESET_THRESHOLD=200 # Operations before auto-cleanup (default: 200) export MCP_AUTO_RESET_ENABLED=true # Enable automatic memory management export MCP_MAX_OUTPUT_SIZE=50000 # Max output size per buffer (default: 50KB) export MCP_MAX_SESSIONS=4 # Maximum concurrent sessions (default: 4) # Logging export LOG_LEVEL=INFO
Connect any MCP server to execute within the IPython workspace:
export EXTERNAL_MCPS_JSON='{ "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"] }, "postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres"], "env": { "DATABASE_URL": "$DATABASE_URL" } } }'
While Sherlog MCP includes many tools natively, you can connect any MCP server to extend functionality. External tools are automatically integrated into the IPython workspace:
- External tools are prefixed:external_[server]_[tool]
- Results automatically convert to DataFrames
- Full access to the same IPython namespace
"-e", "EXTERNAL_MCPS_JSON={\"postgres\":{\"command\":\"npx\",\"args\":[\"-y\",\"@modelcontextprotocol/server-postgres\"],\"env\":{\"DATABASE_URL\":\"$DATABASE_URL\"}}}"
This MCP server is designed to be deployed on Railway with persistent session storage.
The server automatically persists IPython shell sessions across container restarts using:
- Session State: Individual session files stored in/app/data/sessions/
- Session Metadata: Tracked insession_metadata.jsonfor session timing and state
- Active Session Registry: Maintained insession_registry.jsonto restore shells on startup
When deploying to Railway, the/app/datadirectory is automatically persisted through Railway's persistent storage. This ensures that:
- User sessions survive container restarts
- IPython shell state (variables, imports, etc.) is maintained
- Session metadata persists for proper session management
No additional configuration is needed for Railway deployment - the persistent volume is automatically mounted.
Claude Desktop ↓ Sherlog MCP Server (http) ↓ Session Middleware (manages shells) ↓ IPython Shells (one per session) ├── Built-in Tools (return DataFrames) ├── External MCP Tools (via proxy) └── User Code (execute_python_code) └── User CLI (call_cli)
External MCP tools integrate seamlessly:
- Results automatically convert to DataFrames
- Stored in IPython namespace with tool name
- Available for subsequent operations
- PostgreSQL MCP queries database → result stored as DataFrame
- LogAI tools analyze the data → create new DataFrames
- Custom Python code combines results → final analysis
Apache License 2.0 - seeLICENSEfile for details.
Armin's articleHow to fix your contextMCPs are Boring- Recommended using eval as the only toolAlita paper- This paper kind of influenced me as well
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
A server for querying Loki logs from Grafana.
A Go-based server to query Grafana Loki logs using the Model Context Protocol (MCP).
An MCP server for querying Loki logs via logcli.
Seamlessly bring real-time production context—logs, metrics, and traces—into your local environment to auto-fix code faster.
Provides access to OpenTelemetry traces and metrics through Logfire.
Access and manage Grafana resources, including dashboards, datasources, Prometheus, Loki, and alerting.
Debug and investigate app issues using AI and Grafana Loki
An MCP server for querying distributed tracing data from Grafana Tempo.
Fetch logs, metrics, traces, and events from the Chronosphere observability platform.
Access Grafana resources like dashboards, datasources, Prometheus, Loki, and alerts.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





