RAG-LC-MCP

nuke66/RAG-LC-MCP

3.1

If you are the rightful owner of RAG-LC-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The RAG LC MCP server is a document retrieval tool built in Python, running on Docker, and utilizing fastMCP. It implements Langchain for ingestion and vectorizing into a Postgres database.

RAG LC MCP

MCP server providing RAG document retrival tools. Built in Python, runs on Docker, uses fastMCP, implements Langchain for ingestion/vectorizing into Postgres DB

activate the venv (for running .ipynb scripts)

.\.venv\Scripts\Activate.ps1

Ran into windows issues trying to run locally, easier to run on container

docker compose exec server python ingest_langchain.py --input shared_data/docs

Windows install instructions:

1. Install linux, wsl2, and docker desktop

Follow these instructions up to installing Docker Desktop https://liquid-interactive.atlassian.net/wiki/spaces/MAC/pages/4075618546/Local+environment+setup+guide

Also install Python 12 (12.0 or greater) if not already on your system https://www.python.org/downloads/release/python-3120/

2. Build the uv project

Install uv if not already installed

pip install uv

Now build the project. On the command line in the base directory of the solution

uv sync

3. Build image and load into docker

In the directory of the solution on you machine run the following commands:

docker compose build --no-cache server 
docker compose up -d

4. Update Claude desktop

4.1 Setup MCP config

In Claude Desktop click File -> Settings, then select Developer Click on Edit Config button Put in the following config

{
  "mcpServers": {
    "RAG LC MCP": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "http://localhost:8007/mcp",
        "--transport",
        "http-first",
        "--allow-http",
        "--request-timeout",
        "60000"
      ]
    }
  }
}

4.2 Using a token (optional but recommended)

If you set AUTH_TOKEN in .env, append it to the MCP URL as a query param:

{
  "mcpServers": {
    "RAG LC MCP": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "http://localhost:8007/mcp?token=YOUR_TOKEN",
        "--transport",
        "http-first",
        "--allow-http",
        "--request-timeout",
        "60000"
      ]
    }
  }
}

4.3 Close Claude and the background process.

3.3 Restart Claude, the MCP server should show in the list

TBC - update image

The model should now be able to connect to the MCP server.

5. In Cursor

Go to Cursor Settings -> MCP & Integrations, under MCP Tools add a new MCP Server.

As for the Claude desktop config, if token authenication on the server has been set a token needs to be passed in the config, otherwise it can be omitted.

{
  "mcpServers": {
    "RAG LC MCP": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:8007/mcp?token=YOUR_TOKEN",
        "--allow-http"
      ]
    }
  }
}

TBC - update image

Run locally

Install deps (recommended with uv):

uv pip install -r requirements.txt

Start the HTTP server:

uvicorn app:app --host 0.0.0.0 --port 8005 --log-level debug

The MCP HTTP endpoint will be served at http://localhost:8007/.

Environment (.env)

Create a .env file (the app loads it automatically at startup):

cp .env.example .env
# then edit .env
  • LOG_DIR: directory for application logs. Defaults to shared_data/logs. Override in .env if you want logs elsewhere.
  • AUTH_TOKEN: if set, enables simple token auth. Requests must include either Authorization: Bearer <token> or ?token=<token>.
  • When using Docker Compose, .env is loaded via env_file and variables are available in the container.

Authentication

If AUTH_TOKEN is set in .env, the HTTP server enforces a minimal token check:

  • Send the header Authorization: Bearer <token>
  • Or append a query parameter ?token=<token>

If AUTH_TOKEN is not set or empty, authentication is disabled. Auth decisions are logged to shared_data/logs/auth.log by default.

Quick curl test (replace YOUR_TOKEN):

curl -i "http://localhost:8005/mcp?token=YOUR_TOKEN"

References

  • Official Python SDK for MCP server: https://github.com/modelcontextprotocol/python-sdk