Skip to main content
Glama

mcp-pyright

MCP server that exposes Pyright language server functionality

PyPI Python Ruff

mcp-name: io.github.daedalus/mcp-pyright

Install

pip install mcp-pyright

Related MCP server: MCP-TY

Usage

The MCP server can be used with any MCP-compatible client. It exposes the following tools:

Type Checking

from mcp_pyright import mcp

# Run type checking
result = check_types(code="x: int = 'hello'")

Get Hover Information

# Get type information at position
result = get_hover(code="x: int = 1", position=0)

Get Completions

# Get code completions
result = get_completions(code="prin", position=4)

Get Definition

# Find definition location
result = get_definition(code="def foo(): pass\nfoo()", position=15)

Find References

# Find all references
result = find_references(code="x = 1\nx", position=5)

Get Document Symbols

# Get all symbols in document
result = get_document_symbols(code="class Foo: pass\ndef bar(): pass")

Format Code

# Format Python code
result = format_code(code="x=1\ny=2")

Development

git clone https://github.com/daedalus/mcp-pyright.git
cd mcp-pyright
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mypy src/

License

MIT

Available Tools

7 tools
check_typesC

Check types in a Python file or string of code.

Performs type checking using Pyright and returns diagnostics.

Inputs: code, file_path, python_path, type_checker_mode. Returns: object

find_referencesB

Find all references to a symbol at a specific position.

Returns all reference locations for the symbol at the given position.

Inputs: code (required), position (required), python_path. Returns: object

format_codeB

Format Python code.

Formats the given Python code using pyright's formatter.

Inputs: code (required), python_path. Returns: object

get_completionsC

Get code completions at a specific position.

Returns available completions at the given cursor position.

Inputs: code (required), position (required), python_path. Returns: object

get_definitionB

Get definition location at a specific position.

Returns the location of the definition for the symbol at the given position.

Inputs: code (required), position (required), python_path. Returns: object

get_document_symbolsC

Get all symbols in a Python document.

Returns document symbols including functions, classes, variables, etc.

Inputs: code (required), python_path. Returns: object

get_hoverB

Get hover information at a specific position.

Returns type information and documentation for the symbol at the given position.

Inputs: code (required), position (required), python_path. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific language server protocol operations: type checking, reference finding, code formatting, completions, definition lookup, symbol listing, and hover information. There is no overlap or ambiguity between these functions.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with clear, descriptive names (check_types, find_references, format_code, get_completions, get_definition, get_document_symbols, get_hover). The naming convention is uniform throughout the set.

    Tool Count5/5

    With 7 tools, this server provides a well-scoped set covering essential Python language server operations. Each tool earns its place by addressing a distinct aspect of code analysis and editing assistance.

    Completeness4/5

    The toolset covers most core language server operations for Python code analysis, including diagnostics, navigation, formatting, and documentation. A minor gap exists in code modification operations like refactoring or rename, but the surface supports typical agent workflows effectively.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server leveraging the Rust-based ty type checker to provide AI models with high-performance, semantic Python code analysis and structural navigation. It enables precise symbol searching, cross-file renaming, and diagnostic reporting to improve code understanding and editing accuracy.
      16
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An extensible MCP server that provides intelligent Python code analysis, navigation, and understanding capabilities for AI assistants like Claude.
      22
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server that gives AI coding agents codebase navigation intelligence, enabling symbol lookup, reference finding, type inspection, and diagnostics through tools like locate, refs, hover, diagnostics, status, and rename.
      548 npm
      MIT