Skip to main content
Glama
thousandmiles

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
sourceFileYesThe absolute path to the file containing the definition of the caller function
targetFileYesThe absolute path to the file containing the definition of the callee function
sourceFunctionYesThe name of the caller function (e.g. 'main')
targetFunctionYesThe name of the callee function (e.g. 'add')

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description has to carry the behavioral burden. It does disclose that the tool analyzes sourceFunction for references to targetFunction and frames it as a direct-call check, but it does not specify the return format, whether matches are purely syntactic, or how missing functions/files are handled.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no obvious filler; the first gives the purpose and the second maps it to the parameter names. It could be slightly tighter since 'defined in' repeats, but the structure is clear and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and all four parameters are documented, so the core invocation is understandable. However, with no output schema and no annotations, the lack of any statement about the return result (e.g., boolean true/false) and edge-case behavior leaves a real completeness gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes all four parameters, so the baseline is 3. The description adds meaningful cross-parameter semantics by defining sourceFile/sourceFunction as the caller side and targetFile/targetFunction as the callee side, which is genuinely useful beyond the individual property descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific operation: verifying whether a caller function references a callee function, scoped to two files. It is easy to tell apart from siblings like get_references or search_in_file because it is a predicate check rather than a lookup, though it does not explicitly name or contrast the sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance about when to use this tool versus get_references, get_definition, or search_in_file. The phrase 'direct call' implies a scope restriction, but the description never tells the agent when not to use it or which alternative covers broader reference searches.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
lineYesThe 0-based line number where the symbol is located
filePathYesThe absolute path to the file containing the symbol usage (e.g. /path/to/project/src/index.ts)
characterYesThe 0-based character offset on the line where the symbol is located

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden. It discloses that the tool returns a definition location and implies a read-only operation, but it does not mention behavior when a definition is not found or when multiple definitions exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: it states the core purpose first, then the return value, then a practical tip. Every sentence earns its place without unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple symbol lookup tool, the description covers the main action, inputs (via schema), and return information adequately. It would be more complete with explicit notes on error behavior or handling of ambiguous definitions, but as-is an agent has enough to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters are already well documented. The description's tip adds workflow context for obtaining line and character values but does not substantially extend the semantic meaning of the parameters beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get'), the resource ('definition location of a symbol'), and the return payload (file path, line, character). It is distinguishable from sibling tools like get_references by the focus on 'definition,' though it doesn't explicitly contrast with them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The tip to use search_in_file to find the exact line and character provides useful preparatory guidance, implying when an agent should first gather the input location. However, it does not explicitly explain when to choose get_definition over alternatives such as get_references or check_function_call.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
lineYesThe 0-based line number of the symbol
filePathYesThe absolute path to the file containing the symbol definition or usage
characterYesThe 0-based character offset of the symbol

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations present, the description carries the behavioral disclosure burden. It clearly states that the tool returns a list of locations where the symbol is used, which is the essential behavioral and output information for a read-only reference lookup. It does not detail error or empty-result behavior, but for a simple read operation this is reasonable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences plus a focused tip. Every sentence earns its place: the purpose, the return behavior, and the practical prerequisite for obtaining parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, no output schema, and 100% parameter schema coverage, the description conveys purpose, return shape, and parameter-obtaining guidance. It is adequate for an agent to select and invoke the tool correctly, though it could briefly mention behavior when no references exist.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds meaning by advising search_in_file to find the exact line and character, which directly helps the agent populate the required parameters correctly and reinforces the intended workflow.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: finding references to a symbol and returning usage locations. It is distinguishable from siblings by the focus on references rather than definitions, though it does not explicitly name a sibling for comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides practical usage context, telling the agent to use search_in_file to obtain the exact line and character inputs. It does not explicitly contrast with get_definition or check_function_call, but the reference-finding purpose is clear enough to imply the appropriate scenario.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe string to search for
filePathYesThe absolute path to the file to search in

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It accurately describes a text search that returns line and character position, but it does not disclose whether it returns the first match, all matches, how missing strings are handled, or whether positions are zero-based. This leaves some ambiguity but is not misleading.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with no wasted words. The core action and result are front-loaded, and the useful connection to get_definition is appended efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool, the description conveys the purpose, the result type, and a primary use case. It lacks a few details such as match cardinality and output format, but it is sufficient for an agent to invoke it correctly in the intended workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both filePath and query are already documented in the schema. The description adds no extra parameter-level detail, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Search for a string in a file') and a concrete outcome ('to find its line and character position'). This clearly identifies the tool's function and differentiates it from semantic siblings like get_definition and get_references by framing it as a raw text-position search used to prepare arguments for get_definition.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives an explicit use case: 'Useful for finding the arguments for get_definition.' This tells the agent when to reach for this tool, but it does not explicitly mention when not to use it or compare it to get_references or check_function_call.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedcheck_function_call
    • First observedget_definition
    • First observedget_references
    • First observedsearch_in_file

TDQS

A3.8/5.0
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 issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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).
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Exposes Language Server Protocol (LSP) tools such as diagnostics, goto definition, find references, symbols, and rename as a stdio MCP server.
    7
    MIT
  • F
    license
    Not graded
    quality
    B
    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.
    100
    -
  • 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.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thousandmiles/lsp-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server