MCP Pyrefly MCP Server

An MCP (Model Context Protocol) server that integrates Pyrefly for real-time Python code validation, featuring a revolutionary gamification system

Local serverstdioPython

What is the MCP Pyrefly MCP server?

MCP Pyrefly MCP server exists for a simple reason — assistants are far more useful when they can act on MCP Pyrefly directly instead of describing what you should do. An MCP (Model Context Protocol) server that integrates Pyrefly for real-time Python code validation, featuring a revolutionary gamification system that makes LLMs ADDICTED to fixing errors!.

What you get

  • Real-time Type Checking — Leverages Pyrefly's blazing-fast type checker (1.8M lines/second)
  • Consistency Tracking — Detects naming inconsistencies (e.g., getUserData() vs get_user_data())
  • Smart Suggestions — Provides actionable fixes for common errors
  • Session Memory — Tracks identifiers across edits to maintain consistency
  • Multi-file Support — Validates code in context with related files
  • 🍭 Revolutionary Lollipop System — Gamified rewards that make fixing errors irresistible!

What the assistant can call

Once MCP Pyrefly is connected, these are the calls the assistant has available:

  • check_code — Validates Python code for type errors and consistency issues
  • track_identifier — The track_identifier tool exposed by this server
  • check_consistency — The check_consistency tool exposed by this server
  • suggest_fix — Get fix suggestions for specific error messages with principled coding reminders
  • submit_fixed_code — The submit_fixed_code tool exposed by this server
  • check_lollipop_status — The check_lollipop_status tool exposed by this server

Setting it up

Installation goes through your MCP client rather than a global install: point it at mcp-pyrefly on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Choosing this one

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. MCP Pyrefly's toolset — check_code, track_identifier, check_consistency and 3 more — is a fair guide to whether it matches your workflow. It is maintained by kimasplund; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcp pyrefly mcp server does with a few real requests.

Available tools

ToolWhat it does
check_codeValidates Python code for type errors and consistency issues.
track_identifierThe track_identifier tool exposed by this server.
check_consistencyThe check_consistency tool exposed by this server.
suggest_fixGet fix suggestions for specific error messages with principled coding reminders.
submit_fixed_codeThe submit_fixed_code tool exposed by this server.
check_lollipop_statusThe check_lollipop_status tool exposed by this server.

How to install the MCP Pyrefly MCP server

{
  "mcpServers": {
    "pyrefly": {
      "command": "mcp-pyrefly"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use MCP Pyrefly to check code.
  • Use MCP Pyrefly to track identifier.
  • Use MCP Pyrefly to check consistency.

Frequently asked questions

It connects MCP Pyrefly to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (check_code, track_identifier, check_consistency, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP Pyrefly directly.