dariocostanzo
MCP Serverdariocostanzopublic

mcp rag server

使用本地 LLM 和 Ollama 查询 PDF 文档的简单工具,支持语义搜索和金融数据回退。

Repository Info

0
Stars
0
Forks
0
Watchers
1
Issues
Python
Language
-
License

About This Server

使用本地 LLM 和 Ollama 查询 PDF 文档的简单工具,支持语义搜索和金融数据回退。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

PDF RAG Application with FastMCP, Ollama, and LangChain

A simple application for querying PDF documents using Retrieval-Augmented Generation (RAG) with local LLMs via Ollama, with a fallback to the Financial Times API for financial data.

How it Works

  1. Load PDFs: The app reads PDF files from a data/ folder.
  2. Chunking: Text from PDFs is split into smaller, manageable chunks.
  3. Embedding: Ollama converts these text chunks into numerical representations (embeddings).
  4. Vector Store: Embeddings are stored in a FAISS vector store for semantic search.
  5. Querying: When a question is asked (e.g., the default question), the app:
    • Converts the question to an embedding.
    • Finds the most relevant text chunks from the PDF.
    • Sends these chunks and the question to the Ollama LLM.
    • Returns an answer based on the PDF context.
    • If no answer is found in the PDF, it queries the Financial Times API for relevant data.
  6. Output: The answer and its sources (PDF pages or FT API) are printed to the console.

Prerequisites

  • Python 3.11: Download Python 3.11
  • Poetry: For Python package management. Installation instructions
  • Ollama: For running local LLMs.
    • Download from ollama.com/download
    • Pull the model: ollama pull llama3
  • PDF File: A PDF file (e.g., Barclays-PLC-Annual-Report-2020.pdf) in the data/ folder.

Setup Instructions

  1. Clone/Download the Project:

    • Ensure all files (main.py, pyproject.toml, .env.example) are in the project root.
  2. Install Dependencies:

    • Open a terminal in the project root and run:
      poetry env use python3.11
      poetry install
      
      
      

Quick Start

1

Clone the repository

git clone https://github.com/dariocostanzo/mcp-rag-server
2

Install dependencies

cd mcp-rag-server
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerdariocostanzo
Repomcp-rag-server
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation