Metadata-Version: 2.4
Name: mcp-pyright
Version: 0.1.0
Summary: MCP server that exposes Pyright language server functionality
Project-URL: Homepage, https://github.com/daedalus/mcp-pyright
Project-URL: Repository, https://github.com/daedalus/mcp-pyright
Project-URL: Issues, https://github.com/daedalus/mcp-pyright/issues
Author-email: Dario Clavijo <clavijodario@gmail.com>
License: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: fastmcp
Requires-Dist: pyright
Provides-Extra: all
Requires-Dist: hatch; extra == 'all'
Requires-Dist: hypothesis; extra == 'all'
Requires-Dist: mypy; extra == 'all'
Requires-Dist: pip-api; extra == 'all'
Requires-Dist: pytest; extra == 'all'
Requires-Dist: pytest-asyncio; extra == 'all'
Requires-Dist: pytest-cov; extra == 'all'
Requires-Dist: pytest-mock; extra == 'all'
Requires-Dist: ruff; extra == 'all'
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pip-api; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: lint
Requires-Dist: mypy; extra == 'lint'
Requires-Dist: ruff; extra == 'lint'
Provides-Extra: test
Requires-Dist: hypothesis; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'
Description-Content-Type: text/markdown

# 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
