Skip to main content
Glama
Local Code MCP Server

Local Code MCP Server

by udittripathi

Local Code MCP Server (TypeScript)

A Model Context Protocol (MCP) server that provides LLMs with safe, read-only access to a local codebase.
It allows AI assistants to answer questions like:

  • Where is this functionality implemented?

  • Which file contains this function?

  • Search for usages of a specific API or keyword

All source code remains local β€” nothing is uploaded or shared externally.


✨ Features

  • πŸ”’ Local-only, read-only access to files

  • πŸ“‚ List files in a project

  • πŸ“„ Read file contents safely

  • πŸ” Search code across the repository

  • 🧭 Find function definitions

  • 🧠 Zod-based schemas for reliable tool calls

  • πŸ”Œ Compatible with any MCP-enabled LLM client


Related MCP server: Code Search, Read & PR Analysis

πŸ— Architecture

LLM Client (Claude / Cursor / Custom UI)
            β”‚
            β”‚  MCP (stdio)
            β–Ό
     MCP Server (Node + TypeScript)
            β”‚
            β–Ό
     Local Project Files (read-only)


🧰 Available Tools

Tool Name

Description

list_files

List all files in the project

read_file

Read a file by relative path

search_code

Search text across source files

find_function

Locate function definitions


βš™οΈ Prerequisites

  • Node.js 18+

  • npm 9+


πŸš€ Setup

1️⃣ Install Dependencies

npm install

2️⃣ Configure Project Root

Edit src/config.ts and set the absolute path of the project you want to query:

export const PROJECT_ROOT = "ABSOLUTE_PATH_TO_YOUR_PROJECT";

3️⃣ Build & Run

npm run build
npm start

πŸ”Œ Connecting an MCP Client

Example (Claude Desktop):

{
  "mcpServers": {
    "local-code": {
      "command": "node",
      "args": ["<absolute-path>/dist/index.js"]
    }
  }
}

πŸ” Security Model

  • Read-only access

  • Explicit project root allowlist

  • Path traversal protection

  • No network access

  • No code upload

Available Tools

4 tools
find_functionC

Find function definition in project

Inputs: name (required).

list_filesB

List all files in the cal.com project

Inputs: no named parameters.

read_fileC

Read a file from the project

Inputs: path (required).

search_codeC

Search text in project source code

Inputs: query (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 4 tools

    Disambiguation4/5

    The tools have mostly distinct purposes: find_function locates specific function definitions, list_files enumerates files, read_file accesses file content, and search_code performs text searches. There is some potential overlap between find_function and search_code, as both involve searching code, but find_function is specialized for function definitions while search_code is general text search, making them distinguishable with careful reading of descriptions.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case: find_function, list_files, read_file, and search_code. This uniformity makes the tool set predictable and easy to understand, with no deviations in naming conventions.

    Tool Count4/5

    With 4 tools, the count is reasonable for a local code exploration server, covering basic file and code operations. It might be slightly thin for broader code management tasks, but it aligns well with the focused scope of navigating and reading a project like cal.com, without feeling overloaded or insufficient.

    Completeness3/5

    The tool set covers core read-only operations for code exploration: listing files, reading content, and searching. However, it lacks update, create, or delete capabilities, which might be expected for a full code management server. There are no obvious dead ends, but the surface is incomplete for more advanced workflows like modifying code or handling dependencies.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Large Language Models to safely browse and interact with local file systems through secure directory listing, file reading, and content search capabilities. Built with comprehensive security controls and high-performance handling of large directories and files.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents with secure, read-only file system access to analyze and understand project codebases, enabling multi-repository context aggregation and cross-project code tracing.
      17 PyPI
      5
      MIT