Skip to main content
Glama
guff192

wemake-python-mcp

by guff192

wemake-python-mcp

Model Context Protocol (MCP) server providing automated code linting, rule explanations, and configuration templates for wemake-python-styleguide (WPS).


Features

  • Automatic Venv Resolution: Automatically detects project virtualenvs (.venv, venv, uv) to execute flake8 --select=WPS.

  • Structured Violation Output: Returns JSON violation reports with file, line, column, rule code, title, category, and message.

  • Offline WPS Rule Database: Bundled offline lookup database covering all 263 WPS rules (WPS000WPS699).

  • Live Scraper & Updater: Scrapes official documentation to keep rule definitions and links up to date.

  • FastMCP Protocol Support: Implements tools and resources via standard stdio transport.


Related MCP server: mcp-lint-tools

Prerequisites

  • Python 3.10+

  • wemake-python-styleguide (installed in target project virtual environment or system environment)

  • uv (recommended) or pip


Installation

Using uv (Recommended)

Clone the repository and install dependencies into a local virtualenv:

git clone https://github.com/your-org/wemake-python-mcp.git
cd wemake-python-mcp
uv venv
uv pip install -e .

Using pip

pip install -e .

Usage & MCP Client Configuration

CLI Usage

Run the server over stdio transport:

wemake-python-mcp --transport stdio

Check version:

wemake-python-mcp --version

Claude Desktop / Cursor / MCP Client Configuration

Add the following to your MCP client configuration file (e.g., claude_desktop_config.json):

Using uv (Recommended)

{
  "mcpServers": {
    "wemake-python": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/wemake-python-mcp",
        "run",
        "wemake-python-mcp"
      ]
    }
  }
}

Direct Executable

{
  "mcpServers": {
    "wemake-python": {
      "command": "/absolute/path/to/wemake-python-mcp/.venv/bin/wemake-python-mcp",
      "args": []
    }
  }
}

Tools Reference

Tool Name

Parameters

Description

lint_file

path: str

Lints a single .py file using wemake-python-styleguide rules.

lint_project

directory: str = "."

Recursively lints a Python project directory.

lint_code

code: str

Lints a raw Python code string snippet.

explain_rule

code: str

Returns documentation, title, category, and URL for a rule (e.g. WPS432 or 432).

update_rule_db

None

Scrapes official readthedocs documentation and updates the local rule database.

Sample Tool Output (lint_file / lint_code)

{
  "success": false,
  "violation_count": 1,
  "violations": [
    {
      "file": "example.py",
      "line": 1,
      "column": 5,
      "code": "WPS432",
      "title": "Forbid magic numbers",
      "category": "Best practices",
      "message": "Found magic number: 42"
    }
  ],
  "summary": "Found 1 wemake-python-styleguide violation across 1 file."
}

Resources Reference

Resource URI

Mime Type

Description

wemake://rules

application/json

Categorized index of all WPS rule codes and titles.

wemake://rules/{code}

text/markdown

Full Markdown documentation for a specific rule (e.g., wemake://rules/WPS432).

wemake://config/template

text/plain

Recommended setup.cfg configuration template for wemake-python-styleguide.


Environment Variables

  • WPS_FLAKE8_PATH: Explicit path to flake8 executable. Overrides auto-detection logic.


Development & Testing

Run tests and type checks:

# Run unit tests
uv run pytest

# Type check
uv run mypy src/ tests/

# Ruff linting
uv run ruff check src/ tests/ scripts/

# WPS styleguide compliance check
uv run flake8 src/ tests/ --select=WPS

Available Tools

5 tools
explain_ruleA

Explain a wemake-python-styleguide rule by code (e.g. WPS432, 432).

Args: code: WPS violation code (e.g. 'WPS432' or '432').

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits itself. It only states the purpose and parameter format but does not describe return behavior, error handling, or any side effects. For a read-only explanation tool, some mention of expected output or failure modes would be helpful; the absence leaves the agent with unmet expectations.

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

Conciseness5/5

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

The description is concise and front-loaded: a single purpose sentence followed by a clear 'Args' section. It avoids unnecessary words and is appropriately sized for a simple one-parameter tool.

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

Completeness4/5

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

Given the tool's simplicity (one parameter, output schema available), the description adequately covers purpose and parameter semantics. It does not elaborate on behavior or usage contexts, but the output schema likely documents return values. A small decrement is warranted due to the lack of usage guidance and behavioral transparency.

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

Parameters5/5

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

The input schema has 0% description coverage, but the tool description compensates fully by documenting the 'code' parameter with format and examples ('WPS432' or '432'). This adds meaning beyond the raw schema and ensures the agent knows exactly what to pass.

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

Purpose5/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: 'Explain a wemake-python-styleguide rule by code'. It uses a specific verb (explain) and resource (wemake-python-styleguide rule), and the scope is unambiguous. This distinguishes it from sibling tools like lint_file or update_rule_db, which operate on files or the rule database rather than providing rule explanations.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description and parameter documentation do not mention any conditions, prerequisites, or exclusions relative to sibling tools such as lint_code or lint_project. The usage context is implied by the name but not explicitly stated.

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

lint_codeA

Lint a raw Python code string using wemake-python-styleguide rules.

Args: code: Python source code string to lint.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

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

No annotations are provided, so the description must cover behavioral traits. It mentions the ruleset but does not disclose whether the operation is read-only, whether it executes the code, or how results are returned. This lack of safety and return-state info is a significant gap for a tool with no other metadata.

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

Conciseness5/5

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

The description is exceptionally concise—two short sentences—with no redundant wording or filler. Every word contributes useful information about the purpose and the single parameter.

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

Completeness4/5

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

Given the tool's simplicity (one parameter) and the presence of an output schema (so return format need not be explained), the description is mostly complete. It captures the core function and input semantics. Minor omissions like explicit read-only assurance or behavioral disclaimers are not critical here but slightly reduce completeness.

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

Parameters3/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 adds 'Python source code string to lint,' clarifying that the input is raw source text rather than a file path, which adds value beyond the schema's minimal type/title. However, it omits any constraints, examples, or format details that could further aid usage.

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

Purpose5/5

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

The description clearly states the action (lint), the resource (raw Python code string), and the specific ruleset (wemake-python-styleguide). This distinctly separates it from siblings like lint_file and lint_project, which presumably operate on files or projects.

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

Usage Guidelines4/5

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

The phrase 'raw Python code string' implicitly signals that this tool is for ad-hoc code snippets rather than files or projects, aiding selection among siblings. However, it does not explicitly mention alternatives or exclusion criteria, so a small gap remains.

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

lint_fileA

Lint a single Python file using wemake-python-styleguide rules.

Args: path: Path to the Python (.py) file to lint.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not mention read-only behavior, error handling, output format, or any side effects. Even though an output schema exists, the description itself offers no transparency beyond stating the basic action.

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

Conciseness5/5

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

The description is extremely concise, containing only two sentences plus the argument documentation. It front-loads the core purpose and includes no redundant information, earning a perfect score for efficiency.

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

Completeness4/5

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

The tool is simple with a single parameter and an output schema, so the description does not need to explain return values. It covers the essential purpose and parameter semantics. However, the lack of usage guidance and behavioral details slightly reduces completeness, but given the simplicity, it remains adequate.

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?

The schema has no descriptions (0% coverage), but the description compensates by explaining the parameter 'path' as a path to a Python (.py) file, adding file-type specificity and intent. This is valuable and goes beyond the schema's bare 'string' type.

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

Purpose5/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 with a specific verb ('Lint'), a specific resource ('a single Python file'), and the applicable rule set ('wemake-python-styleguide rules'). This distinguishes it from sibling tools like 'lint_project' and 'lint_code', which likely handle different scopes.

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 for a single Python file, which differentiates it from project-level linting. However, it does not explicitly state when to prefer this tool over alternatives or provide exclusions, leaving the decision partially implicit.

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

lint_projectA

Lint an entire Python project directory recursively using wemake-python-styleguide rules.

Args: directory: Path to the target project directory (defaults to current directory).

ParametersJSON Schema
NameRequiredDescriptionDefault
directoryNo.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that linting is recursive and uses a specific rule set, and mentions the default directory. However, it does not state whether the operation is read-only, what the output looks like, or how errors are handled, leaving some behavioral ambiguity.

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

Conciseness5/5

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

The description is two sentences long, front-loading the main purpose and then documenting the argument. There is no extraneous information, and every sentence contributes value.

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

Completeness4/5

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

This is a simple tool with one optional parameter and an output schema present, so the description need not detail return values. It covers the tool's purpose, scope, and the parameter adequately. Minor gaps like error handling or prerequisites are not critical for this level of complexity.

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?

The schema only provides a string type with a default for 'directory', while the description explains it is 'Path to the target project directory' and that it defaults to the current directory. This adds meaningful semantic context beyond the bare schema, fully covering the single parameter despite 0% schema description coverage.

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

Purpose5/5

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

The description states a specific verb ('Lint') and resource ('an entire Python project directory recursively') and names the rule set (wemake-python-styleguide). This clearly differentiates it from sibling tools like lint_file and lint_code, which likely target individual files or code snippets.

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

Usage Guidelines4/5

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

The description clearly implies its use case: linting a whole project directory recursively. It does not explicitly list alternatives or exclusions, but the scope is well-defined and distinct from the sibling tools, providing enough context for an agent to choose appropriately.

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

update_rule_dbA

Scrape and update the offline wemake-python-styleguide rules database.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of disclosing behavior. It does reveal that the tool scrapes and updates, implying a write operation and network access, but it does not specify whether the database is overwritten, whether it is destructive, or any side effects like schema changes or rate limits. For a mutation tool, this is minimal disclosure.

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

Conciseness5/5

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

The description is a single, front-loaded sentence that conveys the agent action and target resource without any wasted words or redundant details.

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?

With zero parameters and an output schema present, the description covers the core action sufficiently. However, it omits important contextual details such as network requirements, idempotency, potential impact on the existing database, or when to execute this tool. It is adequate for the tool's simplicity but lacks thorough behavioral context.

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?

The tool has zero parameters and the input schema has no fields, so there is nothing for the description to add about parameter semantics. The description does not mention any parameters, which is consistent. Baseline for 0 params is 4.

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

Purpose5/5

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

The description uses the specific verbs 'Scrape and update' and names the exact resource ('offline wemake-python-styleguide rules database'), making the action and target clear. This also distinguishes it from sibling tools (lint_file, lint_project, lint_code, explain_rule), which are all about linting or explaining rules rather than updating a database.

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?

No explicit when-to-use or alternative guidance is provided, but the purpose is clear enough to imply that this tool is for refreshing the offline rules database. The description does not state prerequisites, frequency, or scenarios where it should be preferred or avoided, so it only meets the 'implied usage' level.

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

TDQS

A4.1/5.0
Disambiguation5/5

Each tool has a clearly distinct input type or purpose: lint_file, lint_project, and lint_code differ by input source (file, directory, string), while explain_rule and update_rule_db serve separate functions. There is no overlap ambiguity.

Naming Consistency5/5

All tool names follow a consistent lowercase snake_case verb_noun pattern (lint_file, lint_project, lint_code, explain_rule, update_rule_db). The naming is uniform and predictable.

Tool Count5/5

With 5 tools, the server is well-scoped for its purpose. It covers multiple linting input modes plus auxiliary rule explanation and database update features without unnecessary bloat.

Completeness4/5

The tool surface covers the core linting workflows (file, project, code string) and supporting rule utilities. A minor gap is the lack of a direct list-rules tool, but the existing tools handle common use cases effectively.

Maintenance

ActivityMaintained
ResponsivenessSyncing

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
    D
    maintenance
    Code linting and style checking tools for AI agents, exposed as an MCP server. Supports style checks, naming conventions, complexity analysis, dead code detection, and import analysis.
    63
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that integrates Ruff linting, formatting, and code analysis tools with advanced logging and configuration options for AI coding assistants.
    4
    1
    MIT

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/guff192/wemake-python-mcp'

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