Skip to main content
Glama

DuckDB-RAG-MCP-Sample

by nananaman

DuckDB RAG MCP Sample

This is a sample that embeds and vectorizes a markdown document so that it can be explained using MCP and RAG.

We use Plamo-Embedding-1B for vectorization.

function

  • Extract and vectorize text from markdown files
  • Vector Searching with DuckDB
  • Persisting vector data with Parquet files
  • Vector search from MCP

How to use

Vector data generation

First, place the markdown files you want to search in a specific directory, then convert them to Parquet files with the following command.

uv run main.py --directory ~/path/to/markdown/files --parquet vectors.parquet

Configuring MCP

Build

The following command will generate a single binary in dist/server .

uv run pyinstaller --clean --strip --noconfirm --onefile server.py
MCP Client Configuration

Please set it according to the client you want to use.

For Claude Desktop it looks like this:

For VECTOR_PARQUET, specify the file you just converted.

uv run mcp install server.py -v VECTOR_PARQUET=/path/to/vectors.parquet

It is set as follows:

{ "mcpServers": { "DuckDB-RAG-MCP-Sample": { "command": "/path/to/dist/server", "env": { "VECTOR_PARQUET": "/path/to/vectors.parquet" } } } }

Start the development server

uv run mcp dev server.py

license

The DuckDB RAG MCP Sample is provided under the Apache License, Version 2.0.

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

An MCP server that enables RAG (Retrieval-Augmented Generation) on markdown documents by converting them to embedding vectors and performing vector search using DuckDB.

  1. function
    1. How to use
      1. Vector data generation
      2. Configuring MCP
      3. Start the development server
    2. license

      Related MCP Servers

      • A
        security
        F
        license
        A
        quality
        An MCP server for converting Markdown documents to PDF files.
        Last updated -
        1
        1
        JavaScript
      • A
        security
        A
        license
        A
        quality
        Converts various file formats to Markdown using the MarkItDown utility and can be integrated with MCP clients for seamless document processing and conversion.
        Last updated -
        26
        Python
        MIT License
      • A
        security
        A
        license
        A
        quality
        Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
        Last updated -
        3
        15
        17
        JavaScript
        MIT License
        • Apple
        • Linux
      • A
        security
        A
        license
        A
        quality
        An open-source platform for Retrieval-Augmented Generation (RAG). Upload documents and query them ⚡
        Last updated -
        1
        169
        JavaScript
        MIT License

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/nananaman/DuckDB-RAG-MCP-Sample'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server