MCP Pyrefly

MCP Pyrefly is an MCP server that integrates Pyrefly's high-speed type checker to provide real-time Python code validation and consistency analysis for LLM-driven coding workflows. It connects AI assistants like Claude to Python linting, type-checking, and naming consistency engines, allowing developers and automated agents to catch code defects immediately upon generation. Pyrefly evaluates source files, identifies syntax and typing errors, checks naming patterns such as camelCase versus snake_case, and suggests actionable corrections across multiple files. The server introduces an experimental gamification and reinforcement mechanism—termed the Lollipop System—designed to prompt AI models to actively fix discovered issues rather than simply identifying them. By providing dedicated tools for error detection, identifier tracking, and fix verification, MCP Pyrefly helps software engineers and AI agents maintain code quality, eliminate import issues, and ensure strict consistency across Python codebases.

Category: Developer Tools & Code Intelligence

Tags: code analysis, linting, python, validation

Visit MCP Pyrefly

How to install and configure MCP Pyrefly

  1. Install the package using pip: pip install mcp-pyrefly (or clone the repository and run pip install -e .). 2. Open your Claude Desktop configuration file (claude_desktop_config.json). 3. Add the server under the mcpServers object: json { "mcpServers": { "pyrefly": { "command": "mcp-pyrefly" } } } 4. Alternatively, register it with Claude Code by running claude mcp add mcp-pyrefly -- mcp-pyrefly. 5. Restart your MCP client to start validating Python code.

What you can do with MCP Pyrefly

  • Validating Python code snippets in real time to catch type errors and syntax bugs before execution. - Enforcing naming convention consistency across multiple Python files during automated code generation. - Providing LLM assistants with contextual fix suggestions for complex type mismatches and import errors. - Tracking variable and function identifiers across multiple edits to avoid broken references during refactoring. - Submitting corrected code to verify fixes and confirm that all reported errors have been resolved.

Key facts

  • https://github.com/kimasplund/mcp-pyrefly
  • Developer Tools & Code Intelligence
  • code analysis, linting, python, validation

Part of MCP Servers

Related MCP servers

  • MCP LaTeX Server — MCP LaTeX Server is an MCP server that provides tools for creating, editing, validating, and compiling LaTeX documents directly through…
  • MCP JSON — MCP JSON is an MCP server collection that bundles tools for file system operations, Google search, browser-based web automation, and…
  • MCP Jupyter Complete — MCP Jupyter Complete is an MCP server that provides tools for manipulating Jupyter notebook files through position-based cell operations and…
  • MCP LSP Go — MCP LSP Go is an MCP server that connects AI assistants to the official Go Language Server Protocol implementation, gopls,…
  • MCP Manager — MCP Manager is an MCP server management tool that connects directly to your Claude Desktop environment, enabling users to discover,…
  • MCP Lab — MCP Lab is an MCP server development environment designed for building, testing, and debugging custom Model Context Protocol servers integrated…

What is MCP Pyrefly?

MCP Pyrefly is a Model Context Protocol server that integrates the Pyrefly type checker. It validates Python code for type errors, syntax issues, and naming inconsistencies, returning error reports and fix suggestions directly to AI coding assistants.

How do I install MCP Pyrefly?

You can install it directly from PyPI by running pip install mcp-pyrefly, or by cloning the repository and running pip install -e . in the source directory. Then add the mcp-pyrefly command to your MCP client configuration.

Which MCP clients work with MCP Pyrefly?

MCP Pyrefly works with any client supporting standard Model Context Protocol servers over stdio, including Claude Desktop and Claude Code using the command-line integration.

What tools are provided by MCP Pyrefly?

It provides validation tools including check_code, track_identifier, check_consistency, and suggest_fix, along with gamification tools like submit_fixed_code, check_lollipop_status, and check_persona_effectiveness to prompt models to resolve detected errors.

Is MCP Pyrefly open source?

Yes, MCP Pyrefly is open source and distributed under the MIT license on GitHub by Kim Asplund.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories