Smart Coding MCP logo

Smart Coding MCP

Community
omar-haris

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.

Publisheromar-haris
Repositorysmart-coding-mcp
LanguageJavaScript
Forks
32
Stars
200
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Smart Coding MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    200 stars and 32 forks from the linked repository.

Smart Coding MCP

npm version npm downloads License: MIT Node.js

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.

Example

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

bash
npm install -g smart-coding-mcp

To update:

bash
npm update -g smart-coding-mcp

IDE Integration

Detailed setup instructions for your preferred environment:

IDE / AppSetup Guide${workspaceFolder} Support
VS CodeView Guide✅ Yes
CursorView Guide✅ Yes
WindsurfView Guide❌ Absolute paths only
Claude DesktopView Guide❌ Absolute paths only
OpenCodeView Guide❌ Absolute paths only
RaycastView Guide❌ Absolute paths only
AntigravityView Guide❌ Absolute paths only

Quick Setup

Add to your MCP config file:

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

Config File Locations

IDEOSPath
Claude DesktopmacOS~/Library/Application Support/Claude/claude_desktop_config.json
Claude DesktopWindows%APPDATA%\Claude\claude_desktop_config.json
OpenCodeGlobal~/.config/opencode/opencode.json
OpenCodeProjectopencode.json in project root
WindsurfmacOS~/.codeium/windsurf/mcp_config.json
WindsurfWindows%USERPROFILE%\.codeium\windsurf\mcp_config.json

Multi-Project Setup

json
{
  "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:

VariableDefaultDescription
SMART_CODING_VERBOSEfalseEnable detailed logging
SMART_CODING_MAX_RESULTS5Max search results returned
SMART_CODING_BATCH_SIZE100Files to process in parallel
SMART_CODING_MAX_FILE_SIZE1048576Max file size in bytes (1MB)
SMART_CODING_CHUNK_SIZE25Lines of code per chunk
SMART_CODING_EMBEDDING_DIMENSION128MRL dimension (64, 128, 256, 512, 768)
SMART_CODING_EMBEDDING_MODELnomic-ai/nomic-embed-text-v1.5AI embedding model
SMART_CODING_DEVICEcpuInference device (cpu, webgpu, auto)
SMART_CODING_SEMANTIC_WEIGHT0.7Weight for semantic vs exact matching
SMART_CODING_EXACT_MATCH_BOOST1.5Boost multiplier for exact text matches
SMART_CODING_MAX_CPU_PERCENT50Max CPU usage during indexing (10-100%)
SMART_CODING_CHUNKING_MODEsmartCode chunking (smart, ast, line)
SMART_CODING_WATCH_FILESfalseAuto-reindex on file changes
SMART_CODING_AUTO_INDEX_DELAY5000Delay before background indexing (ms), false to disable

Example with env vars:

json
{
  "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

Tech Stack

ComponentTechnology
ProtocolModel Context Protocol (JSON-RPC)
AI Modelnomic-embed-text-v1.5 (MRL)
Inferencetransformers.js + ONNX Runtime
ChunkingSmart regex / Tree-sitter AST
SearchCosine similarity + exact match boost
CacheSQLite 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.

Installation

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

Use Smart Coding MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Smart Coding MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Smart Coding MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Smart Coding MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "smart-coding-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "smart-coding-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Smart Coding MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Smart Coding MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Smart Coding MCP to help me with this task?
Smart Coding MCP
Sure. I read it.
Here is what I found using Smart Coding MCP.

Frequently asked questions

What is the Smart Coding MCP MCP server used for?

Smart Coding MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Smart Coding MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Smart Coding MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Smart Coding MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Smart Coding MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Smart Coding MCP MCP to TypingMind?

Smart Coding MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Smart Coding MCP MCP provide in TypingMind?

Smart Coding MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Smart Coding MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Smart Coding MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇