README.md
An LM Studio plugin that wraps the upstream Code Index MCP as a set of MCP tools.
README.md
An LM Studio plugin that wraps the upstream Code Index MCP as a set of MCP tools.
codeindex-mcp is an LM Studio plugin (TypeScript) that exposes the
upstream Code Index MCP — a Python-based MCP
server for intelligent code indexing, search, and analysis — as a set of MCP tools usable inside
LM Studio.
Rather than reimplementing the indexing / search logic, this plugin ships a lightweight
TypeScript wrapper (src/) that calls each upstream tool over MCP/stdio. The upstream Python
repo is cloned at install time and left untouched, so it stays git pull-able for future updates.
Acknowledgments. This project is a port of johnhuang316/code-index-mcp. We are grateful to the original author, hoonowng (Element Labs Inc), for creating and open-sourcing the excellent Code Index MCP that this plugin builds on.
files://{file_path} resource) — nothing is dropped or reimplemented.CodeIndex/, untouched, so it can be
updated with git pull.codeindex-mcp/ # This LM Studio plugin (TypeScript wrapper) ├── manifest.json # Plugin metadata (kebab-case name: codeindex-mcp) ├── package.json # Dependencies + "postinstall": node scripts/setup.cjs ├── src/ │ ├── index.ts # Plugin entry point (exports toolsProvider + config schemas) │ ├── toolsProvider.ts # Each MCP tool = a thin wrapper around one upstream tool │ ├── config.ts # LM Studio config UI schema (per-chat & global) │ └── core/ │ └── codeIndexClient.ts # Single long-lived MCP/stdio client to the Python backend ├── scripts/ │ └── setup.cjs # postinstall: clone upstream + build venv + install deps ├── CodeIndex/ # Upstream Code Index MCP (Python) — cloned at install time ├── skills/ │ └── codeindex-mcp.md # Skill / guide for LLMs to use this plugin's tools └── dist/ # Compiled JavaScript (auto-generated by `npm run build`)
This plugin installs the upstream Code Index MCP automatically via the
"postinstall": "node scripts/setup.cjs" entry point. When you install it from the
LM Studio Hub or run npm install, scripts/setup.cjs runs:
CodeIndex/ (only if it is missing, so a later
git pull inside CodeIndex/ keeps working).CodeIndex/.venv.requirements.txt via PyPI
(run after the venv is created). No wheels are bundled, so the plugin stays small
enough for LM Studio Hub upload.Then load it as an MCP server in LM Studio:
{ "mcpServers": { "codeindex-mcp": { "command": "node", "args": ["/absolute/path/to/codeindex-mcp/dist/index.js"] } } }
Tip: After install, open LM Studio, start a chat, and call
set_project_pathto point the backend at the repo you want to index (see Usage and the skill).
Requires LM Studio (which bundles Node.js v22) plus TypeScript and zod.
# 1. Install dependencies npm install # 2. Type-check, lint, and build to dist/ npm run typecheck npm run build # 3. Develop with hot-reload in LM Studio npm run dev # == lms dev (requires: lms server start)
Key commands (see package.json):
| Command | Description |
|---|---|
npm run build | Compile TypeScript → dist/ (tsc). |
npm run typecheck | Type-check only (tsc --noEmit). |
npm run dev | Hot-reload in LM Studio (lms dev). |
node scripts/setup.cjs | Manually run the install/clone/env setup. |
To publish to the LM Studio Hub: npm run typecheck && npm run build && lms push.
If you cloned this plugin without running postinstall, clone the backend manually so the
wrapper has something to call:
git clone https://github.com/johnhuang316/code-index-mcp CodeIndex
Each tool returns a readable string. A typical session:
set_project_path(path=...) — point at the repo (call this FIRST).build_deep_index() — once, before deep analysis (get_file_summary, get_symbol_body).find_files(pattern) / search_code_advanced(...) — locate files and code.get_file_content / get_file_summary / get_symbol_body — read the code.refresh_index() (shallow) or build_deep_index() (deep) to keep the index fresh.See **[skills/codeindex-mcp.md](skills/codeindex-mcp.md for a full skill: every tool's definition, usage rules, worked scenarios (indexing, searching, analysis, refactoring), and a decision guide for small LLMs.
All 14 upstream tools are wrapped, plus the files://{file_path} resource (get_file_content).
| Tool | Description |
|---|---|
set_project_path | Set the base project path for indexing. Call this FIRST. |
refresh_index | Rebuild the shallow file index after changes / git operations. |
build_deep_index | Build the full symbol index for deep analysis (max_workers, timeout). |
get_settings_info | View current project config and indexed state. |
| Tool | Description |
|---|---|
find_files | Locate files using glob patterns (e.g. **/*.py). |
search_code_advanced | Smart search: literal / fuzzy / regex, file filtering, pagination. |
get_file_summary | File structure, functions/imports/complexity (needs deep index). |
| Tool | Description |
|---|---|
get_file_content | Raw text content of a file (the files://{file_path} resource). |
get_symbol_body | Source body of one symbol (function/method/class). Needs deep index. |
| Tool | Description |
|---|---|
get_file_watcher_status | Check file watcher status and statistics. |
configure_file_watcher | Enable/disable auto-refresh and configure settings. |
| Tool | Description |
|---|---|
create_temp_directory | Set up storage directory for index data. |
check_temp_directory | Verify index storage location and permissions. |
clear_settings | Reset all cached (indexed) data and settings. |
refresh_search_tools | Re-detect available search tools (ugrep/ripgrep/ag/grep). |
This project is distributed under the MIT License, consistent with the upstream Code Index MCP it wraps.
MIT License Copyright (c) 2025 Element Labs Inc Copyright (c) 2025 codeindex-mcp contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR in connection with the software or the use or other DEALINGS in the SOFTWARE.
codeindex-mcp is an LM Studio plugin (TypeScript) that exposes the
upstream Code Index MCP — a Python-based MCP
server for intelligent code indexing, search, and analysis — as a set of MCP tools usable inside
LM Studio.
Rather than reimplementing the indexing / search logic, this plugin ships a lightweight
TypeScript wrapper (src/) that calls each upstream tool over MCP/stdio. The upstream Python
repo is cloned at install time and left untouched, so it stays git pull-able for future updates.
Acknowledgments. This project is a port of johnhuang316/code-index-mcp. We are grateful to the original author, hoonowng (Element Labs Inc), for creating and open-sourcing the excellent Code Index MCP that this plugin builds on.
files://{file_path} resource) — nothing is dropped or reimplemented.CodeIndex/, untouched, so it can be
updated with git pull.codeindex-mcp/ # This LM Studio plugin (TypeScript wrapper) ├── manifest.json # Plugin metadata (kebab-case name: codeindex-mcp) ├── package.json # Dependencies + "postinstall": node scripts/setup.cjs ├── src/ │ ├── index.ts # Plugin entry point (exports toolsProvider + config schemas) │ ├── toolsProvider.ts # Each MCP tool = a thin wrapper around one upstream tool │ ├── config.ts # LM Studio config UI schema (per-chat & global) │ └── core/ │ └── codeIndexClient.ts # Single long-lived MCP/stdio client to the Python backend ├── scripts/ │ └── setup.cjs # postinstall: clone upstream + build venv + install deps ├── CodeIndex/ # Upstream Code Index MCP (Python) — cloned at install time ├── skills/ │ └── codeindex-mcp.md # Skill / guide for LLMs to use this plugin's tools └── dist/ # Compiled JavaScript (auto-generated by `npm run build`)
This plugin installs the upstream Code Index MCP automatically via the
"postinstall": "node scripts/setup.cjs" entry point. When you install it from the
LM Studio Hub or run npm install, scripts/setup.cjs runs:
CodeIndex/ (only if it is missing, so a later
git pull inside CodeIndex/ keeps working).CodeIndex/.venv.requirements.txt via PyPI
(run after the venv is created). No wheels are bundled, so the plugin stays small
enough for LM Studio Hub upload.Then load it as an MCP server in LM Studio:
{ "mcpServers": { "codeindex-mcp": { "command": "node", "args": ["/absolute/path/to/codeindex-mcp/dist/index.js"] } } }
Tip: After install, open LM Studio, start a chat, and call
set_project_pathto point the backend at the repo you want to index (see Usage and the skill).
Requires LM Studio (which bundles Node.js v22) plus TypeScript and zod.
# 1. Install dependencies npm install # 2. Type-check, lint, and build to dist/ npm run typecheck npm run build # 3. Develop with hot-reload in LM Studio npm run dev # == lms dev (requires: lms server start)
Key commands (see package.json):
| Command | Description |
|---|---|
npm run build | Compile TypeScript → dist/ (tsc). |
npm run typecheck | Type-check only (tsc --noEmit). |
npm run dev | Hot-reload in LM Studio (lms dev). |
node scripts/setup.cjs | Manually run the install/clone/env setup. |
To publish to the LM Studio Hub: npm run typecheck && npm run build && lms push.
If you cloned this plugin without running postinstall, clone the backend manually so the
wrapper has something to call:
git clone https://github.com/johnhuang316/code-index-mcp CodeIndex
Each tool returns a readable string. A typical session:
set_project_path(path=...) — point at the repo (call this FIRST).build_deep_index() — once, before deep analysis (get_file_summary, get_symbol_body).find_files(pattern) / search_code_advanced(...) — locate files and code.get_file_content / get_file_summary / get_symbol_body — read the code.refresh_index() (shallow) or build_deep_index() (deep) to keep the index fresh.See **[skills/codeindex-mcp.md](skills/codeindex-mcp.md for a full skill: every tool's definition, usage rules, worked scenarios (indexing, searching, analysis, refactoring), and a decision guide for small LLMs.
All 14 upstream tools are wrapped, plus the files://{file_path} resource (get_file_content).
| Tool | Description |
|---|---|
set_project_path | Set the base project path for indexing. Call this FIRST. |
refresh_index | Rebuild the shallow file index after changes / git operations. |
build_deep_index | Build the full symbol index for deep analysis (max_workers, timeout). |
get_settings_info | View current project config and indexed state. |
| Tool | Description |
|---|---|
find_files | Locate files using glob patterns (e.g. **/*.py). |
search_code_advanced | Smart search: literal / fuzzy / regex, file filtering, pagination. |
get_file_summary | File structure, functions/imports/complexity (needs deep index). |
| Tool | Description |
|---|---|
get_file_content | Raw text content of a file (the files://{file_path} resource). |
get_symbol_body | Source body of one symbol (function/method/class). Needs deep index. |
| Tool | Description |
|---|---|
get_file_watcher_status | Check file watcher status and statistics. |
configure_file_watcher | Enable/disable auto-refresh and configure settings. |
| Tool | Description |
|---|---|
create_temp_directory | Set up storage directory for index data. |
check_temp_directory | Verify index storage location and permissions. |
clear_settings | Reset all cached (indexed) data and settings. |
refresh_search_tools | Re-detect available search tools (ugrep/ripgrep/ag/grep). |
This project is distributed under the MIT License, consistent with the upstream Code Index MCP it wraps.
MIT License Copyright (c) 2025 Element Labs Inc Copyright (c) 2025 codeindex-mcp contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR in connection with the software or the use or other DEALINGS in the SOFTWARE.