Skip to main content
Glama
Semantic Code MCP Server

Semantic Code MCP Server

Semantic Code MCP Server

This is a Model Context Protocol (MCP) server that provides semantic code analysis capabilities using the Language Server Protocol (LSP).

Features

  • Semantic Navigation: Go to definition, find references, hover info.

  • Relationship Analysis: Check if function A calls function B (using LSP references).

Related MCP server: lsp-tools-mcp

Architecture

This server acts as a bridge between MCP and LSP. It spawns a typescript-language-server instance and translates MCP tool calls into LSP JSON-RPC requests.

Tools

  • get_definition: Find where a symbol is defined.

  • get_references: Find all usages of a symbol.

  • search_in_file: Search for a string in a file to find its line and character position.

  • check_function_call: Analyze if one function calls another.

Usage

Installation

  1. Clone the repository:

    git clone git@github.com:thousandmiles/lsp-mcp-server.git
    cd lsp-mcp-server
  2. Run the setup script to build the project and generate the configuration:

    ./setup.sh
  3. Copy the output JSON and paste it into your MCP client configuration file.

Manual Setup

  1. Install dependencies and build:

    npm install
    npm run build
  2. Configure your MCP client (e.g. Claude Desktop) to run this server:

    {
      "mcpServers": {
        "semantic-code": {
          "command": "node",
          "args": ["/path/to/code_node/build/index.js"]
        }
      }
    }

Available Tools

4 tools
check_function_callB

Check if one function calls another (direct call). Analyzes if 'sourceFunction' (defined in sourceFile) contains any references to 'targetFunction' (defined in targetFile).

Inputs: sourceFile (required), targetFile (required), sourceFunction (required), targetFunction (required).

get_definitionA

Get the definition location of a symbol. Returns the file path, line, and character where the symbol is defined. Tip: Use 'search_in_file' to find the exact line and character of the symbol you are interested in.

Inputs: line (required), filePath (required), character (required).

get_referencesA

Find all references to a symbol. Returns a list of locations where the symbol is used. Tip: Use 'search_in_file' to find the exact line and character of the symbol definition or usage.

Inputs: line (required), filePath (required), character (required).

search_in_fileA

Search for a string in a file to find its line and character position. Useful for finding the arguments for get_definition.

Inputs: query (required), filePath (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 4 tools

    Disambiguation4/5

    Tools are mostly distinct: get_definition, get_references, and search_in_file each serve clearly different lookup purposes, while check_function_call is a specialized relationship query. However, check_function_call could overlap conceptually with get_references since call relationships are a type of reference, though the descriptions provide enough clarity to avoid serious confusion.

    Naming Consistency4/5

    All tool names use snake_case and follow a verb-first style, with get_definition and get_references matching the verb_noun pattern exactly. search_in_file and check_function_call deviate slightly by including prepositions or compound objects, but the overall pattern remains predictable and readable.

    Tool Count5/5

    Four tools is well-scoped for a semantic code navigation server. Each tool provides a distinct, non-redundant capability without feeling sparse or overwhelming.

    Completeness4/5

    The set covers core symbol workflows: finding definitions, references, string locations, and direct call relationships. Missing features like finding implementations or broader call-graph traversal are reasonable omissions for a focused utility set, and agents can complete common navigation tasks without major dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes Language Server Protocol (LSP) features as MCP tools, enabling IDE-grade semantic navigation including go-to-definition, find references, hover info, and symbols across multiple programming languages (Python, Rust, C/C++, TypeScript/JavaScript, React, HTML, CSS).
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes Language Server Protocol (LSP) tools such as diagnostics, goto definition, find references, symbols, and rename as a stdio MCP server.
      8
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Connects VSCode with MCP to provide AI assistants real-time access to LSP diagnostics, symbol info, and code navigation, enabling efficient code analysis without slow build commands.
      105
      ISC
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides code intelligence by indexing source code into SQLite and offering MCP tools for symbol search, flow tracing, and context retrieval to assist with code navigation and understanding.
      -