Smart Coding

Developer toolsData and AI

An extensible Model Context Protocol (MCP-Local-MRL-RAG-AST) server that provides intelligent semantic code search for AI assistants. Built with local AI models, inspired by Cursor's semantic search.

Your AI app calls the Smart Coding MCP server, which does the developer tools and data and AI work and sends the result back to the chat.

About Smart Coding

Smart Coding is a community MCP server from omar-haris, filed in our directory under developer tools and data and ai. An extensible Model Context Protocol (MCP-Local-MRL-RAG-AST) server that provides intelligent semantic code search for AI assistants. Built with local AI models, inspired by Cursor's semantic search.

At a glance

Publisher
omar-haris (community)
Runs
See the README for setup
Written in
JavaScript
License
MIT
GitHub stars
200

How to set up Smart Coding

  1. Follow the install steps in the Smart Coding README; it is written in JavaScript, so have that toolchain ready.
  2. Check the Smart Coding README for keys or settings; the registry lists none that Smart Coding requires.
  3. Add Smart Coding to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Smart Coding tools to confirm the connection.
  5. Run one read-only task with Smart Coding first, and keep your app asking before each tool call until the results look right.

Smart Coding compared with similar servers

  • Catia V5 by daiemon12 has fewer GitHub stars than Smart Coding (199 against 200); both are community servers, and both run locally.
  • QuDAG by ruvnet has fewer GitHub stars than Smart Coding (200 against 200); both are community servers, and both run locally.
  • Clojure MCP Light by bhauman has fewer GitHub stars than Smart Coding (199 against 200); both are community servers, and both run locally.

Before you connect Smart Coding

  • Give Smart Coding its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Smart Coding tool call until you trust what it does with them.
  • Treat text that Smart Coding fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Smart Coding on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Smart Coding

How marketing and sales teams put Smart Coding to work, by company size. Pick the size closest to yours and start Smart Coding on one use case.

Small business

  • A small business with a developer can use Smart Coding to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Smart Coding to explain and fix a marketing site issue without context switching between tools.
  • A small team can use Smart Coding to clean and enrich a lead list or a spreadsheet in one pass, instead of hours of copy and paste.
  • Smart Coding runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Smart Coding to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Smart Coding to keep scripts and automations documented and versioned as they change.
  • Marketing ops can connect Smart Coding to enrich and score inbound leads, so sales sees fit and intent before the first call.
  • Start Smart Coding on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Smart Coding with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Smart Coding so web and marketing engineering share one reviewed way of working with AI.
  • Enterprises can run Smart Coding inside their own cloud and data boundary, so models and data stay where governance requires.
  • Smart Coding is a community server, so have security review the code and pin a version before Smart Coding touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Smart Coding README

From omar-haris/smart-coding-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Smart Coding MCP

An extensible Model Context Protocol (MCP) server that provides intelligent semantic code search for AI assistants. Built with local AI models using Matryoshka Representation Learning (MRL) for flexible embedding dimensions (64-768d).

What This Does

AI coding assistants work better when they can find relevant code quickly. Traditional keyword search falls short - if you ask "where do we handle authentication?" but your code uses "login" and "session", keyword search misses it.

This MCP server solves that by indexing your codebase with AI embeddings. Your AI assistant can search by meaning instead of exact keywords, finding relevant code even when the terminology differs.

Available Tools

🔍 a_semantic_search - Find Code by Meaning

The primary tool for codebase exploration. Uses AI embeddings to understand what you're looking for, not just match keywords.

How it works: Converts your natural language query into a vector, then finds code chunks with similar meaning using cosine similarity + exact match boosting.

Best for:

  • Exploring unfamiliar codebases: "How does authentication work?"
  • Finding related code: "Where do we validate user input?"
  • Conceptual searches: "error handling patterns"
  • Works even with typos: "embeding modle initializashun" still finds embedding code

Example queries:

"Where do we handle cache persistence?"
"How is the database connection managed?"
"Find all API endpoint definitions"
📦 d_check_last_version - Package Version Lookup

Fetches the latest version of any package from its official registry. Supports 20+ ecosystems.

How it works: Queries official package registries (npm, PyPI, Crates.io, etc.) in real-time. No guessing, no stale training data.

Supported ecosystems: npm, PyPI, Crates.io, Maven, Go, RubyGems, NuGet, Packagist, Hex, pub.dev, Homebrew, Conda, and more.

Best for:

  • Before adding dependencies: "express" → 4.18.2
  • Checking for updates: "pip:requests" → 2.31.0
  • Multi-ecosystem projects: "npm:react", "go:github.com/gin-gonic/gin"

Example usage:

"What's the latest version of lodash?"
"Check if there's a newer version of axios"
🔄 b_index_codebase - Manual Reindexing

Triggers a full reindex of your codebase. Normally not needed since indexing is automatic and incremental.

How it works: Scans all files, generates new embeddings, and updates the SQLite cache. Uses progressive indexing so you can search while it runs.

When to use:

  • After major refactoring or branch switches
  • After pulling large changes from remote
  • If search results seem stale or incomplete
  • After changing embedding configuration (dimension, model)
🗑️ c_clear_cache - Reset Everything

Deletes the embeddings cache entirely, forcing a complete reindex on next search.

How it works: Removes the .smart-coding-cache/ directory. Next search or index operation starts fresh.

When to use:

  • Cache corruption (rare, but possible)
  • Switching embedding models or dimensions
  • Starting fresh after major codebase restructure
  • Troubleshooting search issues
📂 e_set_workspace - Switch Projects

Changes the workspace path at runtime without restarting the server.

How it works: Updates the internal workspace reference, creates cache folder for new path, and optionally triggers reindexing.

When to use:

  • Working on multiple projects in one session
  • Monorepo navigation between packages
  • Switching between related repositories
ℹ️ f_get_status - Server Health Check

Returns comprehensive status information about the MCP server.

What it shows:

  • Server version and uptime
  • Workspace path and cache location
  • Indexing status (ready, indexing, percentage complete)
  • Files indexed and chunk count
  • Model configuration (name, dimension, device)
  • Cache size and type

When to use:

  • Start of session to verify everything is working
  • Debugging connection or indexing issues
  • Checking indexing progress on large codebases

Installation

npm install -g smart-coding-mcp

To update:

npm update -g smart-coding-mcp

IDE Integration

Detailed setup instructions for your preferred environment:

IDE / App Setup Guide ${workspaceFolder} Support
VS Code View Guide ✅ Yes
Cursor View Guide ✅ Yes
Windsurf View Guide ❌ Absolute paths only
Claude Desktop View Guide ❌ Absolute paths only
OpenCode View Guide ❌ Absolute paths only
Raycast View Guide ❌ Absolute paths only
Antigravity View Guide ❌ Absolute paths only
Quick Setup

Add to your MCP config file:

{
  "mcpServers": {
    "smart-coding-mcp": {
      "command": "smart-coding-mcp",
      "args": ["--workspace", "/absolute/path/to/your/project"]
    }
  }
}
Config File Locations
IDE OS Path
Claude Desktop macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop Windows %APPDATA%\Claude\claude_desktop_config.json
OpenCode Global ~/.config/opencode/opencode.json
OpenCode Project opencode.json in project root
Windsurf macOS ~/.codeium/windsurf/mcp_config.json
Windsurf Windows %USERPROFILE%\.codeium\windsurf\mcp_config.json
Multi-Project Setup
{
  "mcpServers": {
    "smart-coding-frontend": {
      "command": "smart-coding-mcp",
      "args": ["--workspace", "/path/to/frontend"]
    },
    "smart-coding-backend": {
      "command": "smart-coding-mcp",
      "args": ["--workspace", "/path/to/backend"]
    }
  }
}

Environment Variables

Customize behavior via environment variables:

Variable Default Description
SMART_CODING_VERBOSE false Enable detailed logging
SMART_CODING_MAX_RESULTS 5 Max search results returned
SMART_CODING_BATCH_SIZE 100 Files to process in parallel
SMART_CODING_MAX_FILE_SIZE 1048576 Max file size in bytes (1MB)
SMART_CODING_CHUNK_SIZE 25 Lines of code per chunk
SMART_CODING_EMBEDDING_DIMENSION 128 MRL dimension (64, 128, 256, 512, 768)
SMART_CODING_EMBEDDING_MODEL nomic-ai/nomic-embed-text-v1.5 AI embedding model
SMART_CODING_DEVICE cpu Inference device (cpu, webgpu, auto)
SMART_CODING_SEMANTIC_WEIGHT 0.7 Weight for semantic vs exact matching
SMART_CODING_EXACT_MATCH_BOOST 1.5 Boost multiplier for exact text matches
SMART_CODING_MAX_CPU_PERCENT 50 Max CPU usage during indexing (10-100%)
SMART_CODING_CHUNKING_MODE smart Code chunking (smart, ast, line)
SMART_CODING_WATCH_FILES false Auto-reindex on file changes
SMART_CODING_AUTO_INDEX_DELAY 5000 Delay before background indexing (ms), false to disable

Example with env vars:

{
  "mcpServers": {
    "smart-coding-mcp": {
      "command": "smart-coding-mcp",
      "args": ["--workspace", "/path/to/project"],
      "env": {
        "SMART_CODING_VERBOSE": "true",
        "SMART_CODING_MAX_RESULTS": "10",
        "SMART_CODING_EMBEDDING_DIMENSION": "256"
      }
    }
  }
}

Performance

Progressive Indexing - Search works immediately while indexing continues in the background. No waiting for large codebases.

Resource Throttling - CPU limited to 50% by default. Your machine stays responsive during indexing.

SQLite Cache - 5-10x faster than JSON. Automatic migration from older JSON caches.

Incremental Updates - Only changed files are re-indexed. Saves every 5 batches, so no data loss if interrupted.

Optimized Defaults - 128d embeddings (2x faster than 256d with minimal quality loss), smart batch sizing, parallel processing.

How It Works

flowchart TB
    subgraph IDE["IDE / AI Assistant"]
        Agent["AI Agent<br/>(Claude, GPT, Gemini)"]
    end

    subgraph MCP["Smart Coding MCP Server"]
        direction TB
        Protocol["Model Context Protocol<br/>JSON-RPC over stdio"]
        Tools["MCP Tools<br/>semantic_search | index_codebase | set_workspace | get_status"]

        subgraph Indexing["Indexing Pipeline"]
            Discovery["File Discovery<br/>glob patterns + smart ignore"]
            Chunking["Code Chunking<br/>Smart (regex) / AST (Tree-sitter)"]
            Embedding["AI Embedding<br/>transformers.js + ONNX Runtime"]
        end

        subgraph AI["AI Model"]
            Model["nomic-embed-text-v1.5<br/>Matryoshka Representation Learning"]
            Dimensions["Flexible Dimensions<br/>64 | 128 | 256 | 512 | 768"]
            Normalize["Layer Norm → Slice → L2 Normalize"]
        end

        subgraph Search["Search"]
            QueryEmbed["Query → Vector"]
            Cosine["Cosine Similarity"]
            Hybrid["Hybrid Search<br/>Semantic + Exact Match Boost"]
        end
    end

    subgraph Storage["Cache"]
        Vectors["SQLite Database<br/>embeddings.db (WAL mode)"]
        Hashes["File Hashes<br/>Incremental updates"]
        Progressive["Progressive Indexing<br/>Search works during indexing"]
    end

    Agent <-->|"MCP Protocol"| Protocol
    Protocol --> Tools

    Tools --> Discovery
    Discovery --> Chunking
    Chunking --> Embedding
    Embedding --> Model
    Model --> Dimensions
    Dimensions --> Normalize
    Normalize --> Vectors

    Tools --> QueryEmbed
    QueryEmbed --> Model
    Cosine --> Hybrid
    Vectors --> Cosine
    Hybrid --> Agent
Tech Stack
Component Technology
Protocol Model Context Protocol (JSON-RPC)
AI Model nomic-embed-text-v1.5 (MRL)
Inference transformers.js + ONNX Runtime
Chunking Smart regex / Tree-sitter AST
Search Cosine similarity + exact match boost
Cache SQLite with WAL mode

Privacy

Everything runs 100% locally:

  • AI model runs on your machine (no API calls)
  • Code never leaves your system
  • No telemetry or analytics
  • Cache stored in .smart-coding-cache/

Research Background

This project builds on research from Cursor showing that semantic search improves AI coding agent performance by 12.5% on average. The key insight: AI assistants benefit more from relevant context than from large amounts of context.

License

MIT License - Copyright (c) 2025 Omar Haris

See LICENSE for full text.

Questions about Smart Coding

What is the Smart Coding MCP server?

An extensible Model Context Protocol (MCP-Local-MRL-RAG-AST) server that provides intelligent semantic code search for AI assistants. Built with local AI models, inspired by Cursor's semantic search. Smart Coding is maintained by omar-haris on GitHub at omar-haris/smart-coding-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Smart Coding MCP server?

Smart Coding doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (omar-haris/smart-coding-mcp). Like most servers, Smart Coding ends with a command or URL you paste into your AI app's MCP config.

Does Smart Coding need an API key?

The registry lists no required keys for Smart Coding. Check the Smart Coding README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Smart Coding an official MCP server?

No. Smart Coding is a community server maintained by omar-haris. Community servers can be excellent; read the code and the open issues before you give Smart Coding access to company data.

What license is Smart Coding under?

Smart Coding is released under the MIT license, according to its GitHub repository. The license covers the code of Smart Coding; the service it connects to has its own terms.