--- id: pygls version: "2.1.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pygls — A pythonic generic language server (pronounced like 'pie glass') License: permissive · Maintenance: active · Downloads: 2.1M/mo ## What it is and what it does pygls is a Python framework that implements the Language Server Protocol (LSP), a standardized way for editors and IDEs to communicate with language-aware tools. It lets you build a language server—a program that provides features like code completion, error diagnostics, and symbol navigation—by decorating Python functions with feature handlers and starting the server with a single call. The framework handles all the LSP protocol machinery, including message parsing, workspace management, and client communication. You define what your server does by writing handler functions for specific LSP features (like TEXT_DOCUMENT_COMPLETION or TEXT_DOCUMENT_HOVER), and pygls routes incoming requests to them. It depends on attrs for data classes, cattrs for serialization, and lsprotocol for LSP type definitions, keeping the dependency footprint small. Use it for: - Build a language server for a domain-specific language or custom syntax to integrate with VSCode, Neovim, or other LSP-compatible editors. - Add code completion and diagnostics to an existing language or tool by wrapping it in an LSP server. - Create editor-agnostic language support without writing separate plugins for each editor. - Prototype or experiment with language features and editor integrations quickly using Python. - Extend an existing Python project with IDE-like features (completion, linting, navigation) for users. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pygls is a Python framework for building Language Servers that implement the Language Server Protocol, enabling editors and IDEs to provide code completion, diagnostics, and other language-aware features. Yes. pygls is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. It is the right choice if you need to build a language server in Python and want to support multiple editors without vendor lock-in. Install it if you are building or extending a language server; skip it if you only need to use an existing language server. ## Install pip install pygls uv add pygls poetry add pygls ## Installing pygls Before you install: Low install friction with a pure Python wheel and only three runtime dependencies (attrs, cattrs, lsprotocol). Actively maintained with a release 142 days ago and support for current Python versions (3.9 through 3.14). License in practice: Apache-2.0 is a permissive license; you can use pygls in commercial and private projects with minimal restrictions, provided you include the license notice. Quickstart: pip install pygls from pygls.lsp.server import LanguageServer from lsprotocol import types server = LanguageServer("my-server", "v0.1") @server.feature(types.TEXT_DOCUMENT_COMPLETION) def completions(params: types.CompletionParams): return types.CompletionList(is_incomplete=False, items=[]) server.start_io() Verify before relying: - Whether pygls handles editor-specific protocol variations or edge cases beyond the LSP specification - Performance characteristics when handling large files or many concurrent language server requests - Availability of examples or templates for common language server use cases ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags language server protocol python, lsp implementation framework, build language servers, editor code completion, language server development, lsp python framework, generic language server, language-server-protocol, editor-integration, lsp [View on SkillFed](https://skillfed.io/packages/pygls) · [View on PyPI](https://pypi.org/project/pygls/)