Lucidity MCP

Lucidity MCP

Intelligent prompt-based code quality analysis for AI coding assistants.

72
Stars
20
Forks
72
Watchers
7
Issues
Lucidity MCP is a Model Context Protocol (MCP) server that empowers AI coding assistants to deliver high-quality code through intelligent, prompt-driven analysis. It offers comprehensive detection of code issues across multiple quality dimensions, providing structured and actionable feedback. With language-agnostic capabilities, extensible framework, and flexible transport options, Lucidity MCP seamlessly integrates into developer workflows and AI systems.

Key Features

Comprehensive issue detection across 10 critical quality dimensions
Contextual analysis by comparing code changes to the original
Language-agnostic design for broad compatibility
Targeted analysis for specific issue types
Structured, actionable feedback output
Seamless integration with Claude and other MCP-compatible assistants
Lightweight server architecture with minimal dependencies
Extensible framework for custom issue types and criteria
Supports stdio and server-sent events (SSE) as transport mechanisms
Direct git diff analysis for pre-commit reviews

Use Cases

Automated AI-assisted code reviews in development pipelines
Pre-commit quality analysis for software teams
Integrating contextual quality checks with coding assistants like Claude
Identifying and mitigating code security vulnerabilities
Providing focused feedback on large, complex code changes
Analyzing multi-language codebases for consistency and errors
Personal developer workflows to reduce manual code inspection
Teaching programming best practices through structured recommendations
Preventing accidental deletion or hallucination of functionality by AI agents
Maintaining codebase quality in collaborative, multi-developer projects

README

✨ Lucidity MCP 🔍

Python 3.13+ License Status Code Style Type Check

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

bash
# Clone the repository
git clone https://github.com/hyperbliss/lucidity-mcp.git
cd lucidity-mcp

# Set up a virtual environment with UV
uv venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies with UV
uv sync

📋 Prerequisites

  • Python 3.13 or higher
  • Git (for analyzing code changes)
  • UV package manager (recommended for dependency management)

🔮 Quick Start

Run the Lucidity server

bash
# Start with stdio transport (for terminal use)
lucidity-mcp

# Start with SSE transport (for network use)
lucidity-mcp --transport sse --host 127.0.0.1 --port 6969

# Run with debug logging
lucidity-mcp --debug

# Run with file logging
lucidity-mcp --log-file lucidity.log

Using with AI Assistants

  1. Start Lucidity in SSE mode:

    bash
    lucidity-mcp --transport sse
    
  2. Connect your AI assistant using the MCP protocol URI:

    sse://localhost:6969/sse
    
  3. The AI can now invoke the analyze_changes tool to get code quality feedback!

🧠 Analysis Dimensions

Lucidity analyzes code across 10 critical quality dimensions:

  1. Unnecessary Complexity - Identifies overly complex algorithms, excessive abstractions, and convoluted logic
  2. Poor Abstractions - Detects leaky or inappropriate abstractions and unclear separation of concerns
  3. Unintended Code Deletion - Catches accidental removal of critical functionality or validation
  4. Hallucinated Components - Finds references to non-existent functions, classes, or APIs
  5. Style Inconsistencies - Spots deviations from project coding standards and conventions
  6. Security Vulnerabilities - Identifies potential security issues in code changes
  7. Performance Issues - Detects inefficient algorithms or operations that could impact performance
  8. Code Duplication - Finds repeated logic or functionality that should be refactored
  9. Incomplete Error Handling - Spots missing or inadequate exception handling
  10. 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 repository
      • path: Optional specific file path to analyze

💻 Development

Lucidity uses UV for dependency management and development workflows. UV is a fast, reliable Python package manager and resolver.

bash
# Update dependencies
uv sync

# Run tests
pytest

# Run linting
ruff check .

# Run type checking
mypy .

🔧 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

usage: lucidity-mcp [-h] [--debug] [--host HOST] [--port PORT] [--transport {stdio,sse}]
                [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--verbose]
                [--log-file LOG_FILE]

options:
  -h, --help            show this help message and exit
  --debug               Enable debug logging
  --host HOST           Host to bind the server to (use 0.0.0.0 for all interfaces)
  --port PORT           Port to listen on for network connections
  --transport {stdio,sse}
                        Transport type to use (stdio for terminal, sse for network)
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level
  --verbose             Enable verbose logging for HTTP requests
  --log-file LOG_FILE   Path to log file (required for stdio transport if logs enabled)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Set up your development environment with UV
  4. Make your changes
  5. Run tests and linting
  6. Commit your changes (git commit -m 'Add some amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. 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 ⚡️

Star History

Star History Chart

Repository Owner

hyperb1iss
hyperb1iss

User

Repository Details

Language Python
Default Branch main
Size 113 KB
Contributors 1
License Apache License 2.0
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Topics

ai-tools claude code-analysis code-quality code-review cursor developer-tools fastmcp git-analysis language-agnostic mcp prompts python static-analysis vibes

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Unichat MCP Server

    Unichat MCP Server

    Universal MCP server providing context-aware AI chat and code tools across major model vendors.

    Unichat MCP Server enables sending standardized requests to leading AI model vendors, including OpenAI, MistralAI, Anthropic, xAI, Google AI, DeepSeek, Alibaba, and Inception, utilizing the Model Context Protocol. It features unified endpoints for chat interactions and provides specialized tools for code review, documentation generation, code explanation, and programmatic code reworking. The server is designed for seamless integration with platforms like Claude Desktop and installation via Smithery. Vendor API keys are required for secure access to supported providers.

    • 37
    • MCP
    • amidabuddha/unichat-mcp-server
  • Semgrep MCP Server

    Semgrep MCP Server

    A Model Context Protocol server powered by Semgrep for seamless code analysis integration.

    Semgrep MCP Server implements the Model Context Protocol (MCP) to enable efficient and standardized communication for code analysis tasks. It facilitates integration with platforms like LM Studio, Cursor, and Visual Studio Code, providing both Docker and Python (PyPI) deployment options. The tool is now maintained in the main Semgrep repository with continued updates, enhancing compatibility and support across developer tools.

    • 611
    • MCP
    • semgrep/mcp
  • Exa MCP Server

    Exa MCP Server

    Fast, efficient web and code context for AI coding assistants.

    Exa MCP Server provides a Model Context Protocol (MCP) server interface that connects AI assistants to Exa AI’s powerful search capabilities, including code, documentation, and web search. It enables coding agents to retrieve precise, token-efficient context from billions of sources such as GitHub, StackOverflow, and documentation sites, reducing hallucinations in coding agents. The platform supports integration with popular tools like Cursor, Claude, and VS Code through standardized MCP configuration, offering configurable access to various research and code-related tools via HTTP.

    • 3,224
    • MCP
    • exa-labs/exa-mcp-server
  • OpenAI MCP Server

    OpenAI MCP Server

    Bridge between Claude and OpenAI models using the MCP protocol.

    OpenAI MCP Server enables direct querying of OpenAI language models from Claude via the Model Context Protocol (MCP). It provides a configurable Python server that exposes OpenAI APIs as MCP endpoints. The server is designed for seamless integration, requiring simple configuration updates and environment variable setup. Automated testing is supported to verify connectivity and response from the OpenAI API.

    • 77
    • MCP
    • pierrebrunelle/mcp-server-openai
  • Azure DevOps MCP Server

    Azure DevOps MCP Server

    Standardized AI access to Azure DevOps via Model Context Protocol.

    Implements the Model Context Protocol (MCP) to enable AI assistants to securely and efficiently interact with Azure DevOps resources. Provides a standardized bridge for managing projects, work items, repositories, pull requests, and pipelines through natural language interfaces. Supports modular authentication and a feature-based architecture for scalability and integration. Facilitates seamless integration with AI tools such as Claude Desktop and Cursor AI.

    • 306
    • MCP
    • Tiberriver256/mcp-server-azure-devops
  • sentry-mcp

    sentry-mcp

    Remote MCP middleware for developer workflow and debugging tools.

    sentry-mcp provides a remote Model Context Protocol server designed as middleware for Sentry's API, specifically optimized for human-in-the-loop coding agents and developer-oriented workflows. It enables integration with coding assistants like Cursor and Claude Code, offering both remote and stdio transports for varied environments, including self-hosted instances. The project also supports AI-powered search tools for querying events and issues, leveraging OpenAI API for natural language processing. Additionally, an Inspector tool is included for service testing and integration validation.

    • 424
    • MCP
    • getsentry/sentry-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results