← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Type Server Protocol (TSP) Released for Python Type Analysis Data

🔄 Updated 11d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • TSP is a JSON-RPC protocol for Python type analysis.
  • It uses LSP data shapes and URI conventions.
  • Supports queries for type analysis state, snapshots, and import resolution.
  • Clients communicate via stdio or Node IPC.
  • Semantic versioning is used for compatibility checks.

Introduction to Type Server Protocol

The Type Server Protocol (TSP) has been released as a JSON-RPC protocol specifically for type servers to deliver Python analysis data. A type server manages the type-analysis state for a workspace and responds to requests for protocol version, snapshots, Python search paths, import resolution, and various type queries, including computed, declared, and expected types.

Protocol Design and Conventions

TSP incorporates data shapes and conventions from the Language Server Protocol (LSP) where beneficial, such as `Position` and `Range` objects, and represents URIs as strings. All TSP methods are prefixed with `typeServer/`. The authoritative definitions for the protocol are found in `typeServerProtocol.ts` (TypeScript interfaces), `tsp.json` (machine-readable model), and `tsp.schema.json` (JSON schema).

Client-Server Communication

Clients initiate communication with a type server over a main JSON-RPC connection, utilizing transports like stdio or Node IPC. For stdio, stdout is reserved for JSON-RPC messages. Type servers are expected to receive sufficient workspace and document state to fulfill TSP requests, often using standard LSP initialization and document synchronization. TSP also supports optional read-only connections, negotiated during initialization, with the original connection retaining control over state changes and synchronization.

Compatibility and Session Flow

TSP employs semantic versioning for client/server compatibility. During its 0.x development phase, minor version changes may introduce breaking changes, while patch versions maintain backward compatibility within the same minor line. A typical session involves the client starting the server, initializing shared workspace state (often via LSP messages), verifying protocol compatibility, obtaining a snapshot identifier, and then sending type-query, import-resolution, or search-path requests that include the current snapshot.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

The Type Server Protocol (TSP) is a new JSON-RPC protocol designed for type servers to provide Python analysis data. It allows clients to query type servers for information like protocol version, snapshots, Python search paths, import resolution, and various type queries. TSP aims to standardize communication for Python type analysis, building on conventions from the Language Server Protocol (LSP).