Logging Advisor MCP

Logging Advisor MCP

An intelligent MCP server that analyzes logging quality in your code and provides improvement suggestions using LLM-powered insights.

Category
访问服务器

README

Logging Advisor MCP

"Just say 'check my logging' and let it handle everything automatically"

An intelligent MCP (Model Context Protocol) server that analyzes logging quality in your code and provides improvement suggestions using LLM-powered insights. Features natural language interaction and automated workflows.

Installation

npm install -g logging-advisor-mcp

MCP Client Setup

Claude Desktop

Add to your configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "logging-advisor": {
      "command": "npx",
      "args": ["logging-advisor-mcp"],
      "env": {}
    }
  }
}

Claude Code

claude mcp add logging-advisor -- npx -y logging-advisor-mcp

After configuration, restart your MCP client. The logging advisor tools will be available.

Natural Language Interface

Simply say:

  • "Check my logging"
  • "Is my logging code okay?"
  • "Too many console.log statements"
  • "Improve my error logging"
  • "Production deployment logging check"

The MCP automatically detects what you need and runs the appropriate workflow.

4-Step Automated Workflow

1. 🚀 setup_analysis_session - Smart Setup

  • Natural matching: Recognizes casual requests about logging
  • Auto-detection: Programming language, environment settings
  • Smart defaults: Production-ready configuration
  • Workflow guidance: Clear next steps

2. 📊 analyze_logging - Quality Analysis

  • Pattern detection: console.log/print overuse, error swallowing
  • Security scanning: Sensitive data exposure (passwords, tokens, PII)
  • Performance review: Blocking I/O, debug leaks in production
  • Multi-language: JavaScript, Python, Java, Go, C++, C#, Ruby

3. 🔧 suggest_improvements - ROI-Based Roadmap

  • Quick wins: Critical fixes (1-2 hours)
  • Line-by-line fixes: Exact code replacements
  • Implementation guide: Difficulty, time estimates, dependencies
  • Migration strategy: Gradual improvement avoiding big-bang changes

4. ✅ validate_production_readiness - Deployment Safety

  • Strict GO/NO-GO: Any critical issue blocks deployment
  • 5-gate validation: Security, Performance, Observability, Operations, Compliance
  • Real impact focus: Actual service disruption prevention

Example Usage

Natural Workflow

You: "Check my logging - is this code production ready?"

[Paste your code]

Claude: [Automatically runs setup_analysis_session]
→ "I'll analyze your JavaScript code for production deployment..."
→ [Runs analyze_logging, suggest_improvements, validate_production_readiness]
→ "❌ NO-GO: Critical security issue detected - password exposed in logs"
→ [Provides exact line-by-line fixes]

Manual Tool Usage

Please analyze this code with setup_analysis_session:

console.log('User:', username, password);
try {
  loginUser();
} catch(e) {
  // empty catch
}

Features

🎯 Natural Language Interface

  • Conversational: "Check my logging" → automatic workflow
  • Smart matching: Recognizes various ways of requesting logging help
  • Zero configuration: Works with smart defaults

🔍 Comprehensive Analysis

  • Security scanning: Sensitive data exposure (passwords, tokens, PII)
  • Performance review: Blocking I/O, excessive debug logging
  • Observability check: Correlation IDs, error context preservation
  • Multi-language: JavaScript, Python, Java, Go, C++, C#, Ruby

🚀 Production-Ready Focus

  • Environment-aware: Different standards for dev vs production
  • Strict validation: GO/NO-GO deployment decisions
  • Real-world impact: Focus on actual operational issues
  • ROI-based improvements: Quick wins prioritized

Deployment Decision Matrix

Decision Criteria Action
GO No Critical issues, <20% High issues Safe to deploy
⚠️ CONDITIONAL GO No Critical, some High issues Deploy with monitoring
NO-GO Any Critical issues present Fix required before deployment

Critical Blockers

  • Sensitive data in logs (passwords, tokens, PII)
  • Synchronous I/O logging (performance risk)
  • Empty error handling (lost error context)
  • Production debug logging enabled

Language Support

Primary: JavaScript/TypeScript, Python, Java, Go
Extended: C++, C#, Ruby, PHP, Rust, Kotlin, Swift

Development

Local Development Setup

git clone https://github.com/g-hyeong/logging-advisor-mcp.git
cd logging-advisor-mcp
npm install
npm run build

Testing with MCP Inspector

npx @modelcontextprotocol/inspector dist/index.js
# Open http://localhost:5173 in your browser
# Test all 4 tools: setup_analysis_session, analyze_logging, suggest_improvements, validate_production_readiness

Development Setup for Various Clients

Claude Desktop (Development):

{
  "mcpServers": {
    "logging-advisor": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"]
    }
  }
}

Cursor IDE (Development):

{
  "mcp": {
    "servers": {
      "logging-advisor": {
        "command": "node",
        "args": ["/absolute/path/to/dist/index.js"]
      }
    }
  }
}

Claude Code (Development):

{
  "claude.mcpServers": {
    "logging-advisor": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"]
    }
  }
}

Examples

Poor Logging Code

console.log('Login:', username, password); // Exposes sensitive data
try {
  doSomething();
} catch (e) {
  // Empty catch - ignores errors
}

Expected Analysis:

  • Score: 20-30
  • Issues: Critical security vulnerability, ignored errors
  • Recommendations: Use structured logger, remove sensitive data

Good Logging Code

logger.info('Login attempt', { 
  username, 
  timestamp: Date.now() 
});
try {
  doSomething();
} catch (error) {
  logger.error('Operation failed', { 
    error: error.message, 
    stack: error.stack 
  });
}

Expected Analysis:

  • Score: 85-95
  • Issues: None or minor
  • Patterns: Structured logging, consistent approach

Architecture

LLM-First + User-Friendly Design

  • Natural language interface: Conversational interaction patterns
  • Automated workflows: 4-step process with smart defaults
  • Minimal implementation: Maximum delegation to LLM capabilities
  • Context preservation: Session-aware tool chaining

Scripts

npm run dev        # Development mode with auto-restart
npm run build      # TypeScript build
npm run typecheck  # Type checking only
npm start          # Production execution

License

Apache-2.0

Contributing

Issues and pull requests are welcome on GitHub.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选