Lucidity MCP
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Provides git-aware analysis that examines changes directly from git diff, making it ideal for pre-commit reviews of code quality issues before they're committed to the repository.
âĻ Lucidity MCP ð
Clarity in Code, Confidence in Creation
Lucidity is a Model Context Protocol (MCP) server designed to enhance the quality of AI-generated code through intelligent, prompt-based analysis. By providing structured guidance to AI coding assistants, Lucidity helps identify and address common quality issues, resulting in cleaner, more maintainable, and more robust code.
Before you commit, just ask Lucidity to analyze the changes instead of vibe-coding yourself into a nightmare hellscape! ðą ðĨ ðŦ
ðŦ Features
- ðŪ Comprehensive Issue Detection - Covers 10 critical quality dimensions from complexity to security vulnerabilities
- ð Contextual Analysis - Compares changes against original code to identify unintended modifications
- ð Language Agnostic - Works with any programming language the AI assistant understands
- ðŊ Focused Analysis - Option to target specific issue types based on project needs
- ð Structured Outputs - Guides AI to provide actionable feedback with clear recommendations
- ðĪ MCP Integration - Seamless integration with Claude and other MCP-compatible AI assistants
- ðŠķ Lightweight Implementation - Simple server design with minimal dependencies
- ð§Đ Extensible Framework - Easy to add new issue types or refine analysis criteria
- ð Flexible Transport - Supports both stdio for terminal-based interaction and SSE for network-based communication
- ð Git-Aware Analysis - Analyzes changes directly from git diff, making it ideal for pre-commit reviews
ð Installation
ð Prerequisites
- Python 3.13 or higher
- Git (for analyzing code changes)
- UV package manager (recommended for dependency management)
ðŪ Quick Start
Run the Lucidity server
Using with AI Assistants
- Start Lucidity in SSE mode:
- Connect your AI assistant using the MCP protocol URI:
- The AI can now invoke the
analyze_changes
tool to get code quality feedback!
ð§ Analysis Dimensions
Lucidity analyzes code across 10 critical quality dimensions:
- Unnecessary Complexity - Identifies overly complex algorithms, excessive abstractions, and convoluted logic
- Poor Abstractions - Detects leaky or inappropriate abstractions and unclear separation of concerns
- Unintended Code Deletion - Catches accidental removal of critical functionality or validation
- Hallucinated Components - Finds references to non-existent functions, classes, or APIs
- Style Inconsistencies - Spots deviations from project coding standards and conventions
- Security Vulnerabilities - Identifies potential security issues in code changes
- Performance Issues - Detects inefficient algorithms or operations that could impact performance
- Code Duplication - Finds repeated logic or functionality that should be refactored
- Incomplete Error Handling - Spots missing or inadequate exception handling
- Test Coverage Gaps - Identifies missing tests for critical functionality
ð Example AI Assistant Queries
With an AI assistant connected to Lucidity, try these queries:
- "Analyze the code quality in my latest git changes"
- "Check for security vulnerabilities in my JavaScript changes"
- "Make sure my Python code follows best practices"
- "Identify any performance issues in my recent code changes"
- "Are there any unintended side effects in my recent refactoring?"
- "Help me improve the abstractions in my code"
- "Check if I've accidentally removed any important validation"
- "Find any hallucinated API calls in my latest commit"
- "Is my error handling complete and robust?"
- "Are there any test coverage gaps in my new feature?"
ð ïļ Available MCP Tools
Tools
analyze_changes
- Prepares git changes for analysis through MCP- Parameters:
workspace_root
: The root directory of the workspace/git repositorypath
: Optional specific file path to analyze
- Parameters:
ðŧ Development
Lucidity uses UV for dependency management and development workflows. UV is a fast, reliable Python package manager and resolver.
ð§ Logging Behavior
Lucidity handles logging differently depending on the transport:
- SSE transport: Full console logging is enabled
- Stdio transport with --log-file: All logs go to the file, console is disabled
- Stdio transport without --log-file: Only warnings and errors go to stderr, info logs are disabled
This ensures that stdio communication isn't broken by logs appearing on stdout.
ðïļ Command-line Options
ðĪ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Set up your development environment with UV
- Make your changes
- Run tests and linting
- Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
ð License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Created by Stefanie Jane ð
If you find Lucidity useful, buy me a Monster Ultra Violet âĄïļ
This server cannot be installed
A Model Context Protocol server that enhances AI-generated code quality through comprehensive analysis across 10 critical dimensions, helping identify issues before they become problems.
- ðŦ Features
- ð Installation
- ð Prerequisites
- ðŪ Quick Start
- ð§ Analysis Dimensions
- ð Example AI Assistant Queries
- ð ïļ Available MCP Tools
- ðŧ Development
- ð§ Logging Behavior
- ðïļ Command-line Options
- ðĪ Contributing
- ð License