A privacy-first MCP server that provides local LLM-enhanced tools
MCP Local LLM Server
A privacy-first MCP (Model Context Protocol) server that provides unique LLM-enhanced tools for VS Code Copilot. All analysis uses your local LLM - code never leaves your machine.
Key Features
- Privacy-First: All LLM analysis runs locally - your code never leaves your machine
- VS Code Copilot Optimized: Designed to complement (not duplicate) VS Code's built-in tools
- LLM-Enhanced Tools: Every tool adds intelligent analysis, not just raw data
- Symbol-Aware: Understands code structure, not just text patterns
- Security Scanning: Automatic detection of secrets, API keys, and vulnerabilities
- Multiple Backends: Ollama, LM Studio, OpenRouter support
Documentation Map
docs/API_REFERENCE.md- full tool schemas and usagedocs/TOOL_VISIBILITY_TIERS.md- tool surfacing strategy (core/discoverable/hidden)docs/examples/client-configuration-guide.md- IDE/client setup patternsdocs/operations/scripts-guide.md- operational scripts and maintenancedocs/operations/test-utils.md- test harness utilitiesdocs/prompts/- curated prompt suites for QA/regression workflows
Prerequisites
- Node.js 20+ and npm
- One local LLM backend running (LM Studio or Ollama)
- Python 3.10+ (only required for
run_all_tests_ALL.py)
Quick Start
Windows Users - Automated Setup
# Start the server (auto-installs dependencies if needed)
start.bat
# Stop the server
stop.bat
Manual Installation
# Install dependencies from the project root
npm install
npm run build
# Configure (optional)
cp env.settings.example env.settings
# Start
npm start
VS Code Integration
There are several ways to configure MCP Local LLM with VS Code. Choose the method that best fits your workflow.
Option 1: Environment Variable (Recommended for Distribution)
Step 1: Set an environment variable pointing to your mcpLocalLLM installation:
Windows (PowerShell - add to profile for persistence):
$env:MCP_LOCAL_LLM_PATH = "C:\path\to\mcpLocalLLM"
[Environment]::SetEnvironmentVariable("MCP_LOCAL_LLM_PATH", "C:\path\to\mcpLocalLLM", "User")
macOS/Linux:
# Add to ~/.bashrc or ~/.zshrc
export MCP_LOCAL_LLM_PATH="/path/to/mcpLocalLLM"
Step 2: Create .vscode/mcp.json in any project:
{
"mcp": {
"servers": {
"mcp-local-llm": {
"command": "node",
"args": [
"${env:MCP_LOCAL_LLM_PATH}/dist/index.js",
"--settings",
"${env:MCP_LOCAL_LLM_PATH}/env.settings"
]
}
}
}
}
This same configuration works across all projects without modification.
Option 2: Absolute Path (Simple, Project-Specific)
Create .vscode/mcp.json with the full path:
{
"mcp": {
"servers": {
"mcp-local-llm": {
"command": "node",
"args": [
"C:/Users/yourname/mcpLocalLLM/dist/index.js",
"--settings",
"C:/Users/yourname/mcpLocalLLM/env.settings"
]
}
}
}
}
Note: Pass
--settingsto ensure the server uses the intended settings file (especially when you have multiple installs).
Option 3: Per-Project Configuration with Custom Workspace
For projects that need custom workspace settings, create a project-local env.settings:
Step 1: Copy env.settings.example to your project as env.settings
Step 2: Configure workspace roots + allowlist via the Web UI (http://127.0.0.1:3000/) or by editing [config] CONFIG_JSON in env.settings.
Step 3: Point your .vscode/mcp.json to this settings file:
{
"mcp": {
"servers": {
"mcp-local-llm": {
"command": "node",
"args": [
"${env:MCP_LOCAL_LLM_PATH}/dist/index.js",
"--settings",
"${workspaceFolder}/env.settings"
]
}
}
}
}
Optional: OpenRouter for Testing
If you want to test with an external SOTA backend (not needed for normal use):
{
"mcp": {
"servers": {
"mcp-local-llm": {
"command": "node",
"args": [
"${env:MCP_LOCAL_LLM_PATH}/dist/index.js",
"--settings",
"${env:MCP_LOCAL_LLM_PATH}/env.settings"
],
"env": {
"TESTING_MODE_ENABLED": "true",
"OPENROUTER_API_KEY": "sk-or-v1-your-key-here"
}
}
}
}
}
Other IDEs
Cursor
Create .cursor/mcp.json:
{
"mcpServers": {
"mcp-local-llm": {
"command": "node",
"args": ["${env:MCP_LOCAL_LLM_PATH}/dist/index.js"],
"env": {
"WORKSPACE_ROOT": "${workspaceFolder}"
}
}
}
}
Windsurf
Create .windsurf/mcp.json:
{
"mcpServers": {
"mcp-local-llm": {
"command": "node",
"args": ["${env:MCP_LOCAL_LLM_PATH}/dist/index.js"],
"env": {
"WORKSPACE_ROOT": "${workspaceFolder}"
}
}
}
}
Claude Desktop
Add to
Environment Variables
MCP_LOCAL_LLM_PATHPath to the mcpLocalLLM installation directoryOPENROUTER_API_KEYAPI key for OpenRouter when testing in external modeTESTING_MODE_ENABLEDEnables testing mode for external backendsConfiguration
{"mcpServers": {"mcp-local-llm": {"command": "node", "args": ["/path/to/mcpLocalLLM/dist/index.js", "--settings", "/path/to/mcpLocalLLM/env.settings"]}}}