Introduction

In agent development, giving a model IDE-level code understanding usually requires invoking the Language Server Protocol (LSP). DeepSeek Harness (DSH) does not natively provide direct LSP control. The dsh-tool-lsp plugin fills this gap by exposing real language server diagnostics, formatting, renaming, code actions, and symbol navigation as five callable tools.

Plugin Overview

dsh-tool-lsp is an LSP operations plugin for the DeepSeek Harness client. It allows the model to directly invoke capabilities provided by language servers. The plugin is maintained by Jaylor-Wang and is released under the MIT License.

Installation and Enablement

The plugin is managed as an npm package. Install it with the following command:

dsh plugin --profile web add dsh-tool-lsp

After installation, the plugin is disabled by default. You need to enter dshmarket and manually toggle the switch to enable it. Note that the enabled state is not persisted, so you must re-enable it after restarting the DSH process.

Configuration

Language server configuration is not included in the plugin package. Instead, it lives in the user configuration patch layer at $DSH_HOME/profiles/<name>/cordis.patch.yml.

The configuration file structure contains a servers table and a control switch line. The following is an example configuration for a TypeScript server and a Rust server:

- id: lsp
  config:
    servers:
      vtsls:
        command: vtsls
        args: ["--stdio"]
        extensionToLanguage:
          ".ts": typescript
          ".tsx": typescriptreact
          ".js": javascript
          ".jsx": javascriptreact
        projectMarkers: ["package.json", "tsconfig.json"]
        configuration:
          typescript:
            preferences:
              includePackageJsonAutoImports: "on"

      rust:
        command: rust-analyzer
        extensionToLanguage:
          ".rs": rust
        projectMarkers: ["Cargo.toml"]

      biome:
        command: biome
        args: ["lsp-proxy"]
        extensionToLanguage:
          ".json": json
          ".css": css
        projectMarkers: ["biome.json"]

# 开关需要单独一行,合并会导致市场无法切换
- id: lsp
  disabled: true

Key configuration fields include command (the language server executable name), extensionToLanguage (the mapping from file extensions to language IDs), and projectMarkers (marker files used to distinguish projects). Routing logic matches in the following order: fileGlobs > projectMarkers > extensionToLanguage.

Features and Tools

The plugin provides five tools that the model can call to perform actions.

  1. lsp_diagnostics
    Retrieves file diagnostics, merging pull and push channels.
    * Write to disk: No

  2. lsp_format
    Formats an entire file or a specific range.
    * Write to disk: Yes

  3. lsp_rename
    Performs semantic renaming. The server decides based on its capabilities whether to rename across files.
    * Write to disk: Yes

  4. lsp_code_action
    Applies code fixes that the language server is willing to provide.
    * Write to disk: Yes (only when applying an action)

  5. lsp_symbols
    Retrieves document outlines or performs workspace symbol searches.
    * Write to disk: No

Parameter Notes

Tool parameters use 1-based UTF-16 line and character values, which is consistent with the coordinate systems used by most editors. Internally, the plugin automatically handles conversion between 0-based LSP line coordinates and UTF-8/UTF-32 encodings.

Write Conflict Handling

The plugin follows DSH’s filesystem observation strategy. If a file is modified by someone else after the model reads it, the write operation throws an LSP_WRITE_CONFLICT error instead of silently overwriting the file.

Notes and Limitations

  1. Environment dependencies: The plugin itself does not install language servers. You need to install tools such as vtsls, rust-analyzer, and biome yourself and add them to the system PATH.
  2. Symbol support: biome and ruff do not implement the textDocument/documentSymbol interface, so for these, lsp_symbols returns LSP_UNSUPPORTED.
  3. Cold servers: Cold servers (such as rust-analyzer) may return empty diagnostics while indexing. The plugin retries, and if no result is available after retries are exhausted, it returns the data it already has.
  4. Development and hot loading: After modifying the plugin source code, you must restart the DSH process for changes to take effect. The marketplace switch cannot hot-reload new code.

Summary

dsh-tool-lsp brings real LSP capabilities to DeepSeek Harness, enabling agents to directly leverage the existing language server ecosystem. Once servers are configured and the plugin is enabled, the model can obtain standard code diagnostics, formatting, and navigation capabilities.