Skip to main content
Glama
README.md
# mcp-pyright

> MCP server that exposes Pyright language server functionality

[![PyPI](https://img.shields.io/pypi/v/mcp-pyright.svg)](https://pypi.org/project/mcp-pyright/)
[![Python](https://img.shields.io/pypi/pyversions/mcp-pyright.svg)](https://pypi.org/project/mcp-pyright/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

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

## Install

```bash
pip install mcp-pyright
```

## Usage

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

### Type Checking

```python
from mcp_pyright import mcp

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

### Get Hover Information

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

### Get Completions

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

### Get Definition

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

### Find References

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

### Get Document Symbols

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

### Format Code

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

## Development

```bash
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

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 issues