check_codeLABSCO SUMMARY
Errors caught while the code is being written, including the ones a type checker alone would miss.
The type checking is Pyrefly's; what this adds is a session memory of the identifiers already used, so the drift that normally surfaces at import time is caught where it is introduced. Its replies are wrapped in a deliberate reward-and-streak layer aimed at keeping an agent fixing errors until none are left.
What it is
A type-checking server built on Pyrefly. Code is passed in and comes back with errors and suggested fixes, and it keeps a record of the identifiers seen so far in the session, so drift between getUserData and get_user_data is caught rather than shipped.
What you get
- Type errors from Pyrefly, a static type checker for Python
- Naming inconsistencies flagged across edits — an identifier that changed shape between one file and the next
- Suggested fixes attached to common errors, not only the location of the failure
- Related files taken into account, so the check runs against context rather than an isolated snippet
- A session memory of the identifiers already used, which is what makes the consistency check possible
Requirements
Pyrefly does the analysis locally. Code is passed to the server rather than read out of a repository, so any related files you want considered have to be handed over with it.
Setup effort
Build from source — git clone https://github.com/kimasplund/mcp-pyrefly
USE CASES
Validating code before it is written to disk
Pass the block through and read back type errors with suggested fixes, so the file that lands is one that imports.
Keeping names consistent across an editing session
The identifiers seen earlier are remembered, so a helper referred to by a different spelling than the one defined gets flagged immediately.
Checking a change against the files it touches
Related files go in with the snippet, which turns a locally valid edit into one checked against the code that calls it.
7 tools
Listed in project docs. Your client may show a different list.
track_identifiercheck_consistencysuggest_fixsubmit_fixed_codecheck_lollipop_statuscheck_persona_effectivenessBEFORE YOU INSTALL
What to know first
Tools you get
7 tools named in the project's documentation.
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/kimasplund/mcp-pyrefly
cd mcp-pyrefly
pip install -e .MCP Clients
Claude Desktop
{
"mcpServers": {
"pyrefly": {
"command": "mcp-pyrefly"
}
}
}Claude Code
claude mcp add mcp-pyrefly -- mcp-pyrefly