MC

MCP Server Language Server: Definitions, References, Rename

Navigate MCP server codebases with semantic tools, definitions, references, rename, and diagnostics to speed MCP-enabled client development.

Quick Install
npx -y @isaacphi/mcp-language-server

Overview

The MCP Server Language Server implements semantic navigation and refactoring support for projects that use the Model Context Protocol (MCP). By exposing language-server-style capabilities—go-to-definition, find-references, rename, and diagnostics—it lets editors and tooling understand MCP models and messages so developers can navigate and change code safely across MCP-enabled client and server codebases.

This is useful for teams developing integrations around MCP in domains such as finance, where model names and message contracts appear across services, client code, and generated artifacts. The language server reduces manual searching, prevents refactor-induced breakage, and speeds development of editor integrations (for VS Code, Neovim, CoC, etc.) and custom MCP-aware tools.

Features

  • Go to definition (textDocument/definition) for MCP model symbols and message references
  • Find references (textDocument/references) across workspace files that use MCP
  • Rename symbol support (textDocument/rename) that updates occurrences consistently
  • Real-time diagnostics (textDocument/publishDiagnostics) for common MCP problems (missing model, invalid reference, schema mismatch)
  • LSP-compatible protocol surface, usable with standard LSP clients and editor integrations
  • Workspace-wide indexing to provide fast lookups and cross-file navigation

Installation / Configuration

Clone and build from the upstream repository, then run the server as a standard Language Server Protocol (LSP) process (stdio or stdio-like transport).

Clone and build (typical Node/TypeScript workflow):

git clone https://github.com/isaacphi/mcp-language-server.git
cd mcp-language-server
npm install
npm run build

Start the server manually (stdio mode):

# Example: run the bundled Node entry point; path may vary by build
node ./out/server.js --stdio

Integrate with a client (examples)

  • VS Code extension host (launch.json / extension):
"server": {
  "command": "node",
  "args": ["<path-to>/mcp-language-server/out/server.js", "--stdio"]
}
  • Neovim with nvim-lspconfig (init.lua):
require'lspconfig'.mcp_language_server.setup{
  cmd = {"node", "/path/to/mcp-language-server/out/server.js", "--stdio"},
  filetypes = {"mcp", "ts", "js"}, -- adjust to your project
  root_dir = require('lspconfig.util').root_pattern('.git', 'package.json'),
}
  • coc.nvim (coc-settings.json):
{
  "languageserver": {
    "mcp": {
      "command": "node",
      "args": ["/path/to/mcp-language-server/out/server.js", "--stdio"],
      "filetypes": ["mcp"]
    }
  }
}

Configuration options (editor/extension-side) typically include workspace roots and MCP schema paths. See repository README/config for available server-side options.

Available Resources

  • Source & issues: https://github.com/isaacphi/mcp-language-server
  • Protocol mapping: implemented LSP methods include
    • textDocument/definition → go-to-definition
    • textDocument/references → find-references
    • textDocument/rename → rename symbol
    • textDocument/publishDiagnostics → diagnostics
  • Examples: repository contains example projects and test fixtures to exercise symbol lookup and renames (see repo /examples)

Use Cases

  1. Navigate MCP models across a microservice stack

    • Jump from a client-side model reference to the service-side model definition to verify fields and types.
  2. Safe refactor of message or model names

    • Rename a model or message symbol and push consistent changes across generated clients, tests, and service implementations.
  3. Find all usages before changing a protocol

    • Use “Find references” to enumerate every file and location that depends on an MCP message before updating the schema.
  4. Integrate MCP awareness into an editor extension

    • Build a VS Code extension or Neovim plugin that uses the server to provide contextual hover, go-to-definition, and diagnostics for developers working with MCP-enabled codebases.
  5. Continuous validation during development

    • Run an MCP-aware linter in the editor to catch missing model references or schema mismatches before CI.

Quick Reference: Capabilities Mapping

User actionLSP request / notification
Go to definitiontextDocument/definition
Find referencestextDocument/references
Rename symboltextDocument/rename
DiagnosticstextDocument/publishDiagnostics

Tips

  • Run the server in the workspace root so it can index all MCP artifacts and related source files.
  • If you maintain generated code, include generated paths in the language server workspace (or configure exclude patterns as needed).
  • Use editor logging (LSP trace) to diagnose communication issues between your editor and the server.

For implementation details, feature requests, and bug reports, open an issue or pull request on the project repository: https://github.com/isaacphi/mcp-language-server.

Tags:finance