Skip to main content
Glama
hyperb1iss
by hyperb1iss

✨ 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

Related MCP server: CodeAlive MCP

🚀 Installation

# 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

# 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:

    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.

# 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 ⚡️

Available Tools

1 tool
analyze_changesA

Prepare git changes for analysis through MCP.

This tool examines the current git diff, extracts changed code, and prepares structured data with context for the AI to analyze.

The tool doesn't perform analysis itself - it formats the git diff data and provides analysis instructions which get passed back to the AI model through the Model Context Protocol.

Args: workspace_root: The root directory of the workspace/git repository path: Optional specific file path to analyze

Returns: Structured git diff data with analysis instructions for the AI

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo
workspace_rootNo

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that the tool 'examines the current git diff' and 'formats the git diff data,' implying it's a read-only operation without side effects. However, it doesn't mention behavioral traits like error handling, performance considerations, or specific constraints (e.g., git repository must be initialized). It adds some context but isn't comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose. It uses bullet points for Args and Returns, which improves structure. However, some sentences could be more concise (e.g., 'through the Model Context Protocol' is slightly redundant), and the overall flow is clear but not maximally efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema coverage, and no output schema, the description is moderately complete. It covers purpose, parameters, and return value at a high level, but lacks details on error cases, output structure, or operational constraints. For a tool with two parameters and no structured support, it's adequate but has gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains both parameters: 'workspace_root: The root directory of the workspace/git repository' and 'path: Optional specific file path to analyze.' This adds clear meaning beyond the schema's basic titles. However, it doesn't detail format constraints (e.g., absolute vs. relative paths), so it's not a perfect 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'examines the current git diff, extracts changed code, and prepares structured data with context for the AI to analyze.' It specifies the verb (examines, extracts, prepares) and resource (git diff/changed code). However, since there are no sibling tools, it doesn't need to distinguish from alternatives, so it doesn't reach the full 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating 'Prepare git changes for analysis through MCP' and 'The tool doesn't perform analysis itself,' which suggests it's a preprocessing step. However, it lacks explicit guidance on when to use it versus other potential tools (e.g., direct analysis tools) or prerequisites, as there are no siblings to compare against.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.5/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'analyze_changes' has a clearly defined and distinct purpose of preparing git changes for analysis, making it impossible to confuse with other tools.

Naming Consistency5/5

The single tool name 'analyze_changes' follows a clear verb_noun pattern (analyze + changes). Since there is only one tool, there is no inconsistency to evaluate, and the naming is straightforward and descriptive.

Tool Count2/5

A single tool is too few for most practical server purposes, as it limits functionality and scope. While the tool is well-defined, a server with only one tool feels thin and incomplete for handling git analysis or broader tasks, indicating a mismatch in scope.

Completeness2/5

The server's domain appears to be git change analysis, but with only one tool that prepares data without performing analysis, there are significant gaps. Missing operations like actual analysis, history review, or commit management make the surface severely incomplete for the inferred purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    A Model Context Protocol server that enhances AI agents by providing deep semantic understanding of codebases, enabling more intelligent interactions through advanced code search and contextual awareness.
    88
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that helps AI coding assistants identify critical design issues in code, rather than just focusing on cosmetic problems when asked to improve code.
    1
    23
    27
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server providing pre-curated canonical memory, prose/code provenance checking, and benchmark metrics to improve accuracy and reduce costs across AI tools.
    AGPL 3.0

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/hyperb1iss/lucidity-mcp'

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