home / mcp / rag mcp server

Rag MCP Server

Centralized MCP server with a knowledge graph and RAG tools for semantic code indexing and search.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ali-48-rag-mcp-server": {
      "command": "node",
      "args": [
        "/chemin/vers/rag-mcp-server/build/index.js"
      ]
    }
  }
}

You get a centralized MCP server that blends a knowledge graph with Retrieval-Augmented Generation (RAG) to index and semantically search code. This combination lets you build a semantic code base, query it effectively, and run automated analyses across projects with consistent tooling.

How to use

Connect your MCP client to the server to perform knowledge-graph operations and RAG-based code search. You can manage entities, relations, and observations in the knowledge graph, index complete projects for semantic search, and run code lookups to retrieve relevant snippets with context. All tools are exposed through a unified registry, so you have a single interface for running graph and RAG tasks.

How to install

Prerequisites: Node.js and npm must be installed on your system. Ensure you have a compatible environment for building and running the MCP server.

# Clone the project repository
git clone <repository-url>
cd rag-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

Configuration and usage notes

The server uses a centralized configuration that validates numeric limits and supports multiple embedding providers and models. You can customize defaults for chunking, overlap, similarity thresholds, and embedding providers. Tools automatically read these settings to ensure consistent behavior across index, update, and search operations.

Testing and development

A comprehensive test suite covers configuration loading, the configuration manager, tool behavior, limit validation, and functional tests for the tools. You can run the integration tests to confirm end-to-end behavior.

Additional notes

Overview of the tool system: the server uses a central ToolRegistry to auto-register and manage tools. Each tool has a Definition (schema and metadata) and a Handler (execution logic). Tools are discovered automatically from the source tree under the graph and rag directories, enabling a unified interface for executing all tooling.

MCP configuration example

{
  "mcpServers": {
    "rag_mcp_server": {
      "type": "stdio",
      "name": "rag_mcp_server",
      "command": "node",
      "args": ["/chemin/vers/rag-mcp-server/build/index.js"]
    }
  }
}

Available tools

create_entities

Create new entities in the knowledge graph.

create_relations

Create relationships between entities in the graph.

add_observations

Add observations to existing entities in the graph.

delete_entities

Delete entities and their related graph connections.

delete_observations

Delete specific observations from entities.

delete_relations

Delete relationships between nodes.

read_graph

Read and inspect the full knowledge graph.

search_nodes

Perform semantic searches to locate nodes by query.

open_nodes

Open specific nodes by name.

index_project

Index an entire project for semantic search using RAG.

search_code

Semantic search within indexed code.

manage_projects

Manage and list indexed projects.

update_project

Update the index for a given project.