{"id":21940728,"url":"https://github.com/garyo/lsp-multiplexer","last_synced_at":"2025-04-22T15:44:00.062Z","repository":{"id":265160528,"uuid":"895188633","full_name":"garyo/lsp-multiplexer","owner":"garyo","description":"Simple LSP server multiplexer in python","archived":false,"fork":false,"pushed_at":"2025-01-12T14:05:06.000Z","size":60,"stargazers_count":11,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T02:13:12.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-27T18:08:33.000Z","updated_at":"2025-02-24T16:35:56.000Z","dependencies_parsed_at":"2024-11-28T02:21:59.961Z","dependency_job_id":"2d796501-735f-47ad-b5a2-73022983434e","html_url":"https://github.com/garyo/lsp-multiplexer","commit_stats":null,"previous_names":["garyo/lsp-multiplexer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyo%2Flsp-multiplexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyo%2Flsp-multiplexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyo%2Flsp-multiplexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyo%2Flsp-multiplexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garyo","download_url":"https://codeload.github.com/garyo/lsp-multiplexer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250270386,"owners_count":21403041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T02:36:03.679Z","updated_at":"2025-04-22T15:44:00.037Z","avatar_url":"https://github.com/garyo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LSP Multiplexer\n\nA simple Python tool that allows multiple Language Server Protocol (LSP) servers to be multiplexed into a single LSP connection. This is useful when you want to combine the capabilities of multiple language servers - for example, using both Pyright (for type checking) and Ruff-LSP (for linting) with a single LSP client connection.\n\n## Installation\n\nRequires Python 3.8 or higher.\n\n```bash\ngit clone https://github.com/garyo/lsp-multiplexer\ncd lsp-multiplexer\n```\n\n## Usage\n\nThe multiplexer can run either over TCP or stdio:\n\n```bash\n# Run over TCP (default port 8888)\npython lsp-multiplexer.py\n\n# Run using stdio (for editors that expect LSP over stdio)\npython lsp-multiplexer.py --stdio\n\n# Run on a specific host and port\npython lsp-multiplexer.py --host localhost --port 9999\n```\n\n### Command Line Arguments\n\n- `--stdio`: Use stdio instead of TCP\n- `--host`: Host to listen on (default: 127.0.0.1)\n- `--port`: Port to listen on (default: 8888)\n- `--log-level`: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)\n\n### Example Configuration\n\nEdit the server configurations in `lsp-multiplexer.py`:\n\n```python\nmultiplexer = LSPMultiplexer([\n    [\"pyright-langserver\", \"--stdio\"],    # Local process\n    \"tcp://localhost:8080\",               # Remote server\n    [\"ruff-lsp\"]                          # Another local process\n])\n```\n\nEach server can be specified either as:\n- A list of strings for a local process (command and arguments)\n- A URL string for a remote server\n\n### Editor Configuration\n\n#### Neovim Example\n\n```lua\nvim.lsp.start({\n    name = 'multiplexed-python',\n    cmd = {'nc', 'localhost', '8888'},  -- For TCP mode\n    -- or\n    cmd = {'python', 'path/to/lsp-multiplexer.py', '--stdio'},  -- For stdio mode\n    root_dir = vim.fs.dirname(vim.fs.find({'pyproject.toml', 'setup.py'}, { upward = true })[1]),\n})\n```\n\n#### Emacs Example\n\n```elisp\n(lsp-register-client\n (make-lsp-client\n  :new-connection (lsp-tcp-connection '(\"python\" \"path/to/lsp-multiplexer.py\"))\n  :major-modes '(python-mode)\n  :server-id 'multiplexed-python))\n```\n\n## Development\n\nFor debugging, use the `--log-level DEBUG` flag to see detailed logs:\n\n```bash\npython lsp-multiplexer.py --stdio --log-level DEBUG\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaryo%2Flsp-multiplexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaryo%2Flsp-multiplexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaryo%2Flsp-multiplexer/lists"}