my-local-mcp
Provides tools for git inspection (log, show, diff, blame, status, grep, branches, tags) and repository management (clone, pull, sync), enabling AI agents to explore and analyze local git repositories.
Allows cloning public GitHub repositories with support for branches, commits, and tags, and injects a GitHub token for authenticated access, enabling AI agents to work with remote repositories locally.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@my-local-mcpfind the definition of 'handleLogin' in my repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Local MCP Server (Git & File Reader)
A local Model Context Protocol (MCP) server that turns your AI client (Claude Desktop, Claude Code, Cursor, VS Code Continue/Cline, etc.) into a power user of your local git repositories. Clone repos, browse code, hunt symbols, trace references, and inspect commit history — all without burning API tokens on remote fetches.
v4.0 ships 24 tools + MCP Resources + curated Prompts across repo management, git inspection, file/code exploration, and code navigation.
✨ Features at a Glance
Repo management
Tool | Purpose |
| Clone a public repo locally (supports |
| Register a folder already on disk (git or non-git) as a tracked entry |
|
|
| List tracked repos, with |
| Untrack & delete (or keep files with |
Git inspection
Tool | Purpose |
| Commit history; filter by |
| Full details/diff of one commit by SHA |
| Diff between refs (branches, tags, commits); |
| Per-line author/commit annotation (optional line range) |
| Working-tree status (useful for local-folder entries you edit) |
| Fast text search honoring |
| Local branches (or all incl. |
| Tags/releases sorted newest-first |
File & code exploration
Tool | Purpose |
| Recursive listing with ext + size + depth filters + pagination ( |
| Full / line-range / |
| Text/regex grep; binary-skip; |
| Visual ASCII directory tree |
| Smart README / docs discovery, ranked + previewed |
| Read many files in one call (capped per-file) |
| Find by glob name (e.g. |
| Locate DEFINITIONS across TS/JS, Python, Go, Rust, Java, Kotlin, C#, PHP, Ruby, Swift — kinds incl. function/method/class/interface/trait/type/enum/struct/impl/const; reports enclosing scope |
| Locate callers/usages of an identifier; optional comment/string stripping and |
| Run a query across every tracked repo at once |
MCP Resources & Prompts
Resources — every tracked repo is exposed as
localrepo://<repo>(metadata blob) pluslocalrepo://<repo>/<path>(file template). Clients can@-mention files without a tool call.Prompts (slash-commands) —
explore-repo,find-impl,find-callers,changes-since,debug-symbol. Each one packages a multi-step workflow into one shot.
Why this beats raw "ask AI to read a remote repo"
No API token cost for fetching files.
Faster: glob + grep on local disk vs. round-tripping GitHub.
Branch / commit / tag aware: pin a specific version (
tree/5.x,commit/<sha>,releases/tag/v1.4).Symbol-aware:
find_symboljumps to definitions,find_referencesenumerates callers.AI-friendly errors: every error returns
[CODE] message+ optional hint — easy to branch on.
Related MCP server: instagit
📋 Prerequisites
Bun v1.0+
Git on
PATH
🚀 Install
git clone https://github.com/az-ka/my-local-mcp.git
cd my-local-mcp
bun install
bun run build # produces server.exe (Windows) or server (macOS/Linux)For development without rebuilding:
bun run start # runs src/index.ts directly
bun run typecheck # tsc --noEmit
bun run test.ts # 74 integration tests (auto-clones the test repo on first run)🔧 Environment variables
Var | Default | Purpose |
| unset | When |
| unset | Token injected into HTTPS GitHub URLs at clone time (never stored in |
|
| Default shallow-clone depth applied when |
|
| Warn threshold after |
🔌 Connecting Your AI Client
Replace the example path with the absolute path to your server.exe (Windows) or server binary.
Claude Desktop
Edit:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"local-docs": {
"command": "D:/Ngoding/Bun/my-local-mcp/server.exe",
"args": [],
"env": {
"MCP_GITHUB_TOKEN": "ghp_xxx"
}
}
}
}On Windows JSON, escape backslashes (
\\) or use forward slashes. Restart the app after saving.
Claude Code (CLI)
claude mcp add local-docs "D:/Ngoding/Bun/my-local-mcp/server.exe"
claude mcp list # verifyCursor
Settings → Features → MCP → + Add New MCP Server
Name:
local-docsType:
commandCommand:
D:/Ngoding/Bun/my-local-mcp/server.exe
VS Code — Cline / Roo Code
Open the MCP Servers panel in the sidebar → Edit MCP Settings → add the same JSON shape as Claude Desktop.
Verify it loaded
On startup the server logs to stderr:
Local MCP Server v4.0.0 running on StdIO — 24 tools + resources + prompts loadedClaude Desktop logs are at %APPDATA%\Claude\logs\mcp-server-local-docs.log (Windows). If tools don't appear: check the path is absolute, run server.exe manually to confirm it boots, and restart your client.
Updating the binary: clients hold the executable open. To install a new build, close the client first, then
bun run build, then reopen.
💬 Example Prompts
"Add https://github.com/sveltejs/svelte."
"Add https://github.com/filamentphp/filament/tree/5.x as filament-v5."
"Add https://github.com/joho/godotenv/releases/tag/v1.4.0 — only that tag."
"Register C:/projects/my-app as a local folder named my-app."
"Sync all my local repositories."
"Where is `useAuth` defined in better-auth-docs?" → find_symbol
"Who calls `useAuth`?" → find_references with exclude_definitions
"Read the function around line 142 of src/auth.ts." → read_file with function_at_line=142
"Show me 10 lines around line 80 of config.go." → read_file with around_line=80, context_lines=5
"Who last touched lines 40-60 of godotenv.go?" → git_blame
"What's the status of my-app working tree?" → git_status
"git_grep 'rate_limit' in convex-backend." → git_grep
"Diff v1.5.0 vs v2.0.0 in drizzle-orm — stat only." → git_diff with stat_only=true
"Show me last 10 commits to src/index.ts in atlas." → git_log with file filter
"Find all files matching **/test_*.py under src/." → find_files
"Search for 'rate limit' across all my repos." → search_all_repos
"Read the last 100 lines of CHANGELOG.md in effect." → read_file with start_line=-100Slash-commands surfaced by the server (run in clients that support prompts):
/explore-repo <name>— bootstrap a tour/find-impl <symbol>— locate + read the implementation/find-callers <symbol>— enumerate usages/changes-since <ref>— summarise recent changes/debug-symbol <symbol>— definition + callers + recent history walkthrough
🌿 Branch / Commit / Tag URLs
add_repo accepts any of:
{ "url": "https://github.com/filamentphp/filament", "name": "filament-v5", "branch": "5.x" }
{ "url": "https://github.com/filamentphp/filament/tree/5.x", "name": "filament-v5" }
{ "url": "https://github.com/joho/godotenv/commit/aabbccdd1122", "name": "godotenv-pinned" }
{ "url": "https://github.com/joho/godotenv/releases/tag/v1.4.0", "name": "godotenv-1.4" }Branch URLs clone with --single-branch to save space and speed. Commit/tag URLs check out the requested ref (commit = detached HEAD).
🗒️ Per-repo .mcpignore
Drop a .mcpignore file at the root of any cloned repo to add extra ignore patterns (merged with built-in defaults like node_modules/, target/, lockfiles):
# example .mcpignore
bazel-bin/
generated/
fixturesPlain folder names are auto-wrapped to **/<name>/**. Glob patterns are used as-is. Cached for 60 s; deleting the file is picked up after the cache expiry or after sync_repo.
🛡️ Security & Safety Notes
Path-traversal blocked: every file op resolves under the repo root via
path.relativeand rejects with[PATH_TRAVERSAL]errors.Binary files skipped in
search_code/find_references(extension blocklist + null-byte sniff in first 4 KB).Identifier validation:
find_symbolandfind_referencesreject anything that isn't[A-Za-z_$][A-Za-z0-9_$]*.SHA validation:
git_showandcommit/<sha>URLs only accept 4-40 hex chars — no shell injection surface.Diff truncation: oversized diffs/files are truncated with a clear
[WARNING: ...]marker.Token never stored:
MCP_GITHUB_TOKENis injected only at clone URL build time;settings.jsonkeeps the public URL.No write access to your code: the server clones, pulls, and reads. It does not modify cloned repos or your local-folder entries.
🗂️ Project Structure
my-local-mcp/
├── src/
│ ├── index.ts # MCP server entry — registers tools, resources, prompts
│ ├── config.ts # settings.json + env var resolution
│ ├── shared.ts # ToolError, debug log, TTL cache, ignore loader, path guards
│ ├── resources.ts # Resource templates (localrepo://...)
│ ├── prompts.ts # Curated slash-commands
│ └── tools/
│ ├── git.ts # repo + history + blame/status/grep
│ └── files.ts # file + symbol + references + cache invalidation
├── storage/ # cloned repos live here (gitignored)
├── settings.json # auto-generated tracked-repo registry (gitignored)
├── test.ts # 74 integration tests (self-bootstraps test repo)
├── server.exe # compiled binary (after bun run build)
└── package.json🧪 Tests
bun run test.tsThe suite self-bootstraps: if godotenv isn't already in storage/, it clones it on first run. Covers all 24 tools end-to-end:
URL normalization for tree, commit, releases/tag, and tag URLs
File listing / reading / searching with every flag (pagination, format=json, group)
read_filemodes: full, range, negative tail,around_linewindow,function_at_lineblock extractionPath-traversal rejection, invalid-regex rejection, binary-file skip
find_symbolhappy + invalid-identifier + scope-aware JSON output pathsfind_referenceswithexclude_definitionsandexclude_comments_and_stringsgit_log/git_show/git_diff/git_blame/git_status/git_grep/list_branches/list_tagsadd_local_folderhappy + missing-path rejection.mcpignoreextra patterns applied at scan timeStructured
ToolErrorpayloads (describeError,formatErrorText)
🛠️ Tech
Bun — runtime + bundler + standalone-binary compiler
simple-git — wraps system
gitfast-glob — quick file globbing
zod — input schema validation
🙏 Credits
Inspired by better-context for local context management.
Built on the official Model Context Protocol SDK.
📜 License
MIT
This server cannot be installed
Maintenance
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
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/az-ka/my-local-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server