Microsoft Unveils Type Server Protocol for Python

Original: Type Server Protocol

Why This Matters

A standard type-server protocol could enable third-party Python tooling to share analysis state with Pylance.

Microsoft published the Type Server Protocol (TSP), a JSON-RPC spec enabling Python type analysis servers to handle workspace queries for imports, types, and search paths, currently at version 0.4.1.

Microsoft has released the Type Server Protocol (TSP), a JSON-RPC-based specification housed in the Pylance repository that defines how a type server communicates Python analysis data to clients. A conforming type server maintains type-analysis state for a workspace and responds to requests covering protocol version negotiation, snapshots, Python search paths, import resolution, and type queries — including computed, declared, and expected types.

TSP borrows LSP (Language Server Protocol) data shapes where practical, reusing constructs like Position and Range, and represents URIs as strings in the same style LSP does. All TSP methods carry a typeServer/ prefix. The authoritative protocol artifacts are three files: typeServerProtocol.ts (TypeScript interfaces), tsp.json (machine-readable model), and tsp.schema.json (JSON schema).

The protocol uses semantic versioning. While in the 0.x line, minor-version bumps may be breaking changes; patch releases are backward-compatible. The changelog shows rapid iteration from 0.1.0 (initial release) through 0.4.1, which added multi-connection negotiation and a typeServer/connection control request. Earlier versions introduced complex type shapes and stub-based type payloads.

Source

github.com — Read original →