Using Claude Code LSP without the official marketplace

Using Claude Code LSP without the official marketplace

Claude Code can introduce LSP plugins from the official marketplace, but there are also environments where they cannot be used. This article explains how to create a marketplace.json locally and write LSP server settings directly with strict: false to achieve offline LSP integration equivalent to the official one.
2026.03.21

This page has been translated by machine translation. View original

Introduction

Claude Code has LSP (Language Server Protocol) integration through its plugin system. When enabled, Claude can receive real-time diagnostic information after code edits, immediately detecting type errors, undefined variables, and other issues.

The official documentation's "What Claude gains from code intelligence plugins" section states that LSP plugins provide Claude with the following capabilities:

  • Automatic diagnostics: Every time Claude edits a file, the language server analyzes the changes and automatically reports errors and warnings. You can detect type errors, unused imports, and syntax errors without running compilers or linters. If Claude introduces an error, it will notice and fix it within the same turn.
  • Code navigation: You can jump to definitions, search for references, get type information on hover, list symbols, search for implementations, and track call hierarchies. This provides more accurate navigation than grep-based searches.

The official marketplace anthropics/claude-plugins-official provides LSP plugins for many languages.

However, there may be cases where you can't use the official marketplace due to development environment constraints.

This article explains how to add LSP plugins to a local marketplace to achieve LSP integration equivalent to official plugins.

Creating a Local Marketplace

The overall structure of the marketplace and plugins is as follows:

.your-claude-marketplace/
├── .claude-plugin/
│   └── marketplace.json
└── plugins/
    └── typescript-lsp/
        └── README.md

The directory structure essentially copies the format from anthropics/claude-plugins-official.

.your-claude-marketplace can be any name that identifies it as an added marketplace.

Since we're creating a local marketplace, you'll likely want to share it with team members, so we're assuming you'll commit it to a git repository.

marketplace.json

{
  "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  "name": "project-plugins",
  "description": "Offline plugins",
  "owner": {
    "name": "YOUR_NAME_HERE"
  },
  "plugins": [
    {
      "name": "typescript-lsp",
      "description": "TypeScript/JavaScript language server for enhanced code intelligence",
      "version": "1.0.0",
      "author": {
        "name": "YOUR_TEAM_HERE",
        "email": "support@example.com"
      },
      "source": "./plugins/typescript-lsp",
      "category": "development",
      "strict": false,
      "lspServers": {
        "typescript": {
          "command": "typescript-language-server",
          "args": ["--stdio"],
          "extensionToLanguage": {
            ".ts": "typescript",
            ".tsx": "typescriptreact",
            ".js": "javascript",
            ".jsx": "javascriptreact",
            ".mts": "typescript",
            ".cts": "typescript",
            ".mjs": "javascript",
            ".cjs": "javascript"
          }
        }
      }
    }
  ]
}

Key points:

  • strict: false: The marketplace entry becomes the complete plugin definition. No plugin.json is needed in the plugin itself.
  • source: "./plugins/typescript-lsp": Specifies the marketplace root as the plugin source. Even with strict: false, this must be a valid path or you'll get an error, so we've placed a README.md there.
  • lspServers: Directly describes the LSP server configuration.

The essential fields in each lspServers entry are:

Field Description
command The LSP server binary to execute (must exist in PATH)
extensionToLanguage Mapping between file extensions and language IDs

Installing the Language Server

LSP plugins only configure the connection to language servers, so you need to install the language server separately.

For TypeScript, you can install it with the following command:

npm install -g typescript-language-server typescript

typescript-language-server is the LSP server itself, and typescript is required as a dependency. After installation, verify that it's in your PATH:

which typescript-language-server

For other languages, ensure that the binary specified in the command field of marketplace.json exists in your PATH. The required binaries for each language are listed in the official documentation's Code intelligence section.

Adding the Marketplace and Installing the Plugin

Run the following command in Claude Code to register the local marketplace:

/plugin marketplace add ./.your-claude-marketplace

After registering the marketplace, install the plugin:

/plugin install typescript-lsp@project-plugins

Then reload the plugins to apply the changes:

/reload-plugins

lsp-server

If you see "1 plugin LSP server," the setup was successful.

Verification

Try working with a TypeScript project in Claude Code. If LSP is functioning correctly, Claude will automatically detect diagnostic information such as type errors and unused variables after editing files.

Success example

If it's not working, add the following setting to .claude/settings.json:

{
  "env": {
    "ENABLE_LSP_TOOL": "1"
  }
}

Summary

Claude Code's LSP integration can be achieved even without the official marketplace by creating a local marketplace.

To add support for other languages, simply add entries to the plugins array in marketplace.json and install the corresponding language servers.

References

Share this article

FacebookHatena blogX