Skip to main content
Glama

๐Ÿ” MCP Log Analyzer

The MCP Log Analyzer is an AI-powered Streamlit app designed to analyze system log files, identify errors and warnings, and recommend fixes. It uses FastMCP, LangGraph ReAct agents, and Anthropic Claude LLM to build a powerful multi-agent system.


## ๐Ÿ“ Project Structure โ”œโ”€โ”€ analyzer.py # MCP server with two tools: analyze_logs & suggest_fix โ”œโ”€โ”€ streamlit_ui.py # Streamlit web interface โ”œโ”€โ”€ streamlit_client.py # MCP client invoking tools via LangGraph + Claude โ”œโ”€โ”€ mcp_config_2.json # JSON config for MCP server commands โ”œโ”€โ”€ test_model.py # Placeholder test script โ”œโ”€โ”€ README.md # โ† You're here โ”œโ”€โ”€ temp/ # Temporary files โ”œโ”€โ”€ Test logs/ # Sample or uploaded logs โ”œโ”€โ”€ Screenshots/ # UI screenshots โ”œโ”€โ”€ .venv/ # Python virtual environment

Create Virtual Environment

python -m venv .venv ..venv\Scripts\activate

Related MCP server: Log Analyzer MCP

Install Dependencies

pip install -r requirements.txt

If requirements.txt doesn't exist, here are the needed packages:

pip install streamlit langchain langgraph langchain-anthropic anyio nest_asyncio pip install mcp langchain-mcp-adapters

๐Ÿงช Run MCP Tool Server

python analyzer.py

๐Ÿง  Run the Streamlit Client App

streamlit run streamlit_ui.py

๐Ÿงพ Sample mcp_config_2.json

{ "mcpServers": { "LogAnalyzer": { "command": "{Your-directory}\uv.EXE", "args": [ "run", "--with", "mcp[cli]", "mcp", "run", "{Your-directory}\analyzer.py" ] } } }

๐Ÿ“ฆ Log File Format

Uploaded logs should be a list of JSON objects like:

[ { "timestamp": "2025-07-26T12:30:01Z", "level": "ERROR", "component": "DataProcessor", "message": "NullPointerException in AuthService", "stack_trace": "java.lang.NullPointerException..." }, ... ]

๐Ÿ“Œ Notes

Claude API key is required in streamlit_client.py. Replace 'Your-API-Key' with your actual key.

If using TCP transport instead of stdio (recommended on Windows), modify the server and client configs accordingly.

You can customize or add new tools in analyzer.py and expose them via @mcp.tool().

๐Ÿง  Credits

Built using:

LangChain MCP :- https://github.com/langchain-ai/langchain/tree/main/libs/langchain-mcp-adapters

Anthropic Claude :- https://www.anthropic.com/

Streamlit :- https://streamlit.io/

LangGraph Agents :- https://github.com/langchain-ai/langgraph

๐Ÿ› ๏ธ Future Improvements

Add support for batch analysis or CSV uploads

Save session history

Enable tool reordering / multiple MCPs

Deploy to Hugging Face / Streamlit Cloud

Screenshots :-

๐Ÿ“ƒ License

MIT License

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tushar-Shrivastava/Loganalyzer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server