MCP Hub
Back to servers

MCPServer

A TypeScript-based MCP server providing LLMs with safe, read-only access to local codebases for file listing, reading, and code searching.

Tools
4
Updated
Jan 19, 2026

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 NameDescription
list_filesList all files in the project
read_fileRead a file by relative path
search_codeSearch text across source files
find_functionLocate 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

Reviews

No reviews yet

Sign in to write a review