Microsoft’s experimental Type Server Protocol (TSP) gives editors and tools a standard JSON-RPC way to query Python type-analysis data from a type server.

The Type Server Protocol (TSP) is a JSON-RPC protocol that lets clients ask a type server for Python analysis results. The server keeps the type-analysis state for a workspace and responds to requests about the protocol version, snapshots, Python search paths, import resolution, and type queries covering computed, declared, and expected types. The protocol borrows data shapes and conventions from the Language Server Protocol (LSP), including Position and Range, and methods carry a typeServer/ prefix.
The TypeScript interface file, the machine-readable protocol model, and its JSON schema serve as the authoritative definitions. Versions are expressed as semantic version strings, and while the protocol remains in the 0.x line, minor releases may contain breaking changes. Clients start the server and communicate over the main connection, using stdio or Node IPC. Snapshots identify point-in-time views of the analysis state, and the server advances them when earlier results may no longer be valid. Requests carrying a stale snapshot fail with a retryable error.
TSP also offers an optional multi-connection mode. Clients that benefit from concurrent read-only work can open extra local IPC channels, while the main connection keeps ownership of workspace state, document synchronization and other changes. Support is negotiated during initialization, and a server must still work correctly in single-connection mode. The protocol is described as intentionally small, with its exact message shapes defined in the published artifacts.
Source: GitHub







