mcpField
M
mcp-pyright

mcp-pyright

Local
github.com/daedalusDeveloper Tools0Updated 28w ago

About mcp-pyright

mcp-pyright exposes Pyright language-server functions to Python developers and MCP-compatible clients. It covers common code-navigation, completion, formatting, and type-checking tasks.

Key features

  1. 01Python type checking
  2. 02Hover type information
  3. 03Code completion
  4. 04Definition and reference lookup
  5. 05Document symbols and formatting

Use cases

  1. 01Check Python code for type errors
  2. 02Inspect a symbol's type while editing
  3. 03Find definitions and references in code
  4. 04Format Python code through an MCP client

MCP support

The MCP server exposes Pyright language-server functionality as tools for MCP-compatible clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"daedalus-mcp-pyright": {
"command": "uvx",
"args": [
"mcp-pyright"
]
}
}
}
Run commanduvx mcp-pyright

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypimcp-pyright0.1.0

Tools

7

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
codeanyNoPython code as string (mutually exclusive with file_path).
file_pathanyNoPath to Python file (mutually exclusive with code).
python_pathanyNoOptional path to Python interpreter.
type_checker_modestringNoType checking mode - "basic", "strict", or "overload" (default: "basic").

Details

From the project README

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

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.