home / mcp / smart coding mcp server

Smart Coding MCP Server

Local, private semantic code search server that indexes your codebase and enables concept-based queries.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "omar-haris-smart-coding-mcp": {
      "command": "smart-coding-mcp",
      "args": [
        "--workspace",
        "/absolute/path/to/your/project"
      ],
      "env": {
        "SMART_CODING_VERBOSE": "true",
        "SMART_CODING_BATCH_SIZE": "200",
        "SMART_CODING_CHUNK_SIZE": "15",
        "SMART_CODING_MAX_RESULTS": "5",
        "SMART_CODING_WATCH_FILES": "false",
        "SMART_CODING_MAX_FILE_SIZE": "2097152",
        "SMART_CODING_SMART_INDEXING": "true",
        "SMART_CODING_EMBEDDING_MODEL": "Xenova/all-MiniLM-L6-v2",
        "SMART_CODING_SEMANTIC_WEIGHT": "0.7",
        "SMART_CODING_EXACT_MATCH_BOOST": "1.5"
      }
    }
  }
}

Smart Coding MCP is a local, extensible server that indexes your codebase with AI embeddings to enable meaning-based code search. It runs entirely on your machine, empowering AI assistants to locate relevant code faster even when terminology differs, while preserving privacy and avoiding external API calls.

How to use

You run the local MCP server and connect it from your preferred MCP client or IDE integration. The server exposes a semantic search capability that lets your AI assistant find code by concept rather than exact keywords. It supports incremental updates, so you don’t need to reindex everything after every change, and it can skip non-source folders to keep indexing fast. To use it, configure a server instance that points to your project workspace, then start a search session from your IDE’s MCP client. The results will include file paths and line references, helping you jump directly to the relevant code.

Two common usage patterns are supported: a single-project setup where one MCP instance handles your current workspace, and multi-project setups where you want separate MCP instances for multiple projects. Each pattern starts the same way: install the MCP, configure the workspace, then start the server and connect your IDE client to the local MCP URL or interface.

How to install

Prerequisites: you need Node.js installed on your machine. You can verify by running node -v and npm -v in your terminal.

Install the MCP server globally with npm.

npm install -g smart-coding-mcp

To keep the MCP up to date, update the global package.

npm update -g smart-coding-mcp

Create a configuration in your MCP client to point to the workspace you want to index. You typically specify a single-project setup like this.

{
  "mcpServers": {
    "smart_coding_mcp": {
      "command": "smart-coding-mcp",
      "args": ["--workspace", "/absolute/path/to/your/project"]
    }
  }
}

Configuration and environment variables

You can customize how the server indexes and searches by setting environment variables. These are provided to fine-tune verbosity, parallel processing, chunking, results, and the embedding model.

Environment variables shown in the setup include:

SMART_CODING_VERBOSE enables detailed logs. SMART_CODING_BATCH_SIZE controls how many files are processed in parallel. SMART_CODING_MAX_FILE_SIZE limits the largest file considered. SMART_CODING_CHUNK_SIZE sets the number of lines per code chunk. SMART_CODING_MAX_RESULTS limits the number of results returned per query. SMART_CODING_SMART_INDEXING toggles smart project detection. SMART_CODING_WATCH_FILES enables automatic reindexing on file changes. SMART_CODING_SEMANTIC_WEIGHT balances semantic similarity. SMART_CODING_EXACT_MATCH_BOOST boosts exact text matches. SMART_CODING_EMBEDDING_MODEL selects the local embedding model.

Example configuration with environment variables included.

{
  "mcpServers": {
    "smart_coding_mcp": {
      "command": "smart-coding-mcp",
      "args": ["--workspace", "/path/to/project"],
      "env": {
        "SMART_CODING_VERBOSE": "true",
        "SMART_CODING_BATCH_SIZE": "200",
        "SMART_CODING_MAX_FILE_SIZE": "2097152"
      }
    }
  }
}

Notes and best practices

The server starts indexing immediately and runs in the background. Your IDE won’t be blocked waiting for indexing to complete. You can trigger a manual reindex if you’ve made major changes or switched branches.

All indexing data is stored locally in the project cache directory (e.g., hidden folders created by the MCP). No data is sent over the network.

Available tools

semantic_search

Find code by meaning using AI embeddings and cosine similarity to return the most relevant code chunks with file paths and line numbers.

index_codebase

Manually trigger reindexing of the current workspace to refresh embeddings after major changes.

clear_cache

Reset the embeddings cache to force a full reindex on next use.