Skip to main content
Glama
udittripathi

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


πŸ— 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

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

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/udittripathi/MCPServer'

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