mcp版权
公开Pyright语言服务器功能的MCP服务器
  
mcp名称:io.github.daedalus/mcp-yright
安装
pip install mcp-pyright用法
MCP服务器可以与任何兼容MCP的客户端一起使用。它公开了以下工具:
类型检查
from mcp_pyright import mcp
# Run type checking
result = check_types(code="x: int = 'hello'")获取悬停信息
# Get type information at position
result = get_hover(code="x: int = 1", position=0)获得完成
# Get code completions
result = get_completions(code="prin", position=4)获取定义
# Find definition location
result = get_definition(code="def foo(): pass\nfoo()", position=15)查找引用
# Find all references
result = find_references(code="x = 1\nx", position=5)获取文档符号
# Get all symbols in document
result = get_document_symbols(code="class Foo: pass\ndef bar(): pass")格式化代码
# Format Python code
result = format_code(code="x=1\ny=2")发展
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/许可证
麻省理工学院
