MCP cover image
servidor del idioma MCP logo
Private

servidor del idioma MCP

See in Github
2025-03-21

Servidor de protocolo de contexto del modelo (MCP) que interactúa con un servidor de idiomas

3

Github Watches

14

Github Forks

162

Github Stars

MCP Language Server

A Model Context Protocol (MCP) server that runs a language server and provides tools for communicating with it.

Motivation

Claude desktop with the filesystem server feels like magic when working on small projects. This starts to fall apart after you add a few files and imports. With this project, I want to create that experience when working with large projects.

Language servers excel at tasks that LLMs often struggle with, such as precisely understanding types, understanding relationships, and providing accurate symbol references. This project aims to makes bring those tools to LLMs. LSP also seems like a clear inspiration for MCP so why not jam them together?

Status

⚠️ Pre-beta Quality ⚠️

I have tested this server with the following language servers

  • pyright (Python)
  • tsserver (TypeScript)
  • gopls (Go)
  • rust-analyzer (Rust)

But it should be compatible with many more.

Tools

  • read_definition: Retrieves the complete source code definition of any symbol (function, type, constant, etc.) from your codebase.
  • find_references: Locates all usages and references of a symbol throughout the codebase.
  • get_diagnostics: Provides diagnostic information for a specific file, including warnings and errors.
  • get_codelens: Retrieves code lens hints for additional context and actions on your code.
  • execute_codelens: Runs a code lens action.
  • apply_text_edit: Allows making multiple text edits to a file programmatically.

Behind the scenes, this MCP server can act on workspace/applyEdit requests from the language server, so it can apply things like refactor requests, adding imports, formatting code, etc.

Each tool supports various options for customizing output, such as including line numbers or additional context. See the tool documentation for detailed usage. Line numbers are necessary for apply_text_edit to be able to make accurate edits.

About

This codebase makes use of edited code from gopls to handle LSP communication. See ATTRIBUTION for details.

mcp-golang is used for MCP communication.

Prerequisites

Install Go: Follow instructions at https://golang.org/doc/install

Fetch or update this server:

go install github.com/isaacphi/mcp-language-server@latest

Install a language server for your codebase:

  • Python (pyright): npm install -g pyright
  • TypeScript (tsserver): npm install -g typescript typescript-language-server
  • Go (gopls): go install golang.org/x/tools/gopls@latest
  • Rust (rust-analyzer): rustup component add rust-analyzer
  • Or use any language server

Setup

Add something like the following configuration to your Claude Desktop settings (or similar MCP-enabled client):

{
  "mcpServers": {
    "language-server": {
      "command": "go",
      "args": [
        "run",
        "github.com/isaacphi/mcp-language-server@latest",
        "--workspace",
        "/Users/you/dev/yourcodebase",
        "--lsp",
        "/opt/homebrew/bin/pyright-langserver",
        "--",
        "--stdio"
      ],
      "env": {
        "DEBUG": "1"
      }
    }
  }
}

Replace:

  • /Users/you/dev/yourcodebase with the absolute path to your project
  • /opt/homebrew/bin/pyright-langserver with the path to your language server (found using which command e.g. which pyright-langserver)
  • Any aruments after -- are sent as arguments to your language server.
  • Any env variables are passed on to the language server. Some may be necessary for you language server. For example, gopls required GOPATH and GOCACHE in order for me to get it working properly.
  • DEBUG=1 is optional. See below.

Development

Clone the repository:

git clone https://github.com/isaacphi/mcp-language-server.git
cd mcp-language-server

Install dev dependencies:

go mod download

Build:

go build

Configure your Claude Desktop (or similar) to use the local binary:

{
  "mcpServers": {
    "language-server": {
      "command": "/full/path/to/your/clone/mcp-language-server/mcp-language-server",
      "args": [
        "--workspace",
        "/path/to/workspace",
        "--lsp",
        "/path/to/language/server"
      ],
      "env": {
        "DEBUG": "1"
      }
    }
  }
}

Rebuild after making changes.

Feedback

Include

env: {
  "DEBUG": 1
}

To get detailed LSP and application logs. Please include as much information as possible when opening issues.

The following features are on my radar:

  • Read definition
  • Get references
  • Apply edit
  • Get diagnostics
  • Code lens
  • Hover info
  • Code actions
  • Better handling of context and cancellation
  • Add LSP server configuration options and presets for common languages
  • Make a more consistent and scalable API for tools (pagination, etc.)
  • Create tools at a higher level of abstraction, combining diagnostics, code lens, hover, and code actions when reading definitions or references.

相关推荐

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • n8n-io
  • Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

    Reviews

    1 (1)
    Avatar
    user_9bD415lt
    2025-04-17

    I've been using the mcp-language-server by isaacphi and I'm thoroughly impressed. The tool has significantly improved my workflow, offering brilliant language support and seamless integration. It's a must-have for any developer looking to streamline their coding process. Check it out here: https://github.com/isaacphi/mcp-language-server