Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Provides RAG tools with local vector retrieval and web fallback using Firecrawl, enabling document ingestion and querying through MCP stdio transport.

README.md

Agentic RAG MCP

A minimal FastAPI + FastMCP project that combines local RAG retrieval with Firecrawl web fallback.

What this project does

  • Loads a FastAPI application for document ingestion and vector queries.
  • Uses ChromaDB for local vector storage and SentenceTransformers for embeddings.
  • Provides an MCP tool server via fastmcp to expose RAG tools over stdio transport.
  • Falls back to Firecrawl web search only when the local vector DB returns no documents.

Repository structure

  • app/ - application source code
  • api/ - FastAPI routes and schemas
  • core/ - RAG logic, embeddings, fallback helper
  • services/ - ChromaDB service integration
  • mcp/ - FastMCP server entrypoint
  • scripts/ - utility scripts (seed data, etc.)
  • data/ - storage and persistence directories
  • .env.example - environment variable template
  • pyproject.toml - project dependencies and packaging config

Setup for a new user

1. Clone the repository

git clone https://github.com/sampathpulukurthi/agentic-rag-mcp.git
cd agentic-rag-mcp

2. Create a Python virtual environment

python3 -m venv .venv
source .venv/bin/activate

3. Install dependencies

python -m pip install -e .

4. Create environment variables

cp .env.example .env

Edit .env and set:

FIRECRAWL_API_KEY=your_firecrawl_api_key_here

5. Run the FastAPI backend

uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

Then verify:

curl http://127.0.0.1:8000/api/health

6. Run the MCP server

With the virtualenv active:

.venv/bin/python -m app.mcp.server

This starts the FastMCP server named mcp-agentic-rag using stdio transport.

How to use

Ingest documents

curl -X POST http://127.0.0.1:8000/api/ingest \
  -H "Content-Type: application/json" \
  -d '{"documents": [{"id":"doc1","text":"Machine learning models can classify text.","metadata":{"topic":"ml"}}]}'

Query local vector store

curl -X POST http://127.0.0.1:8000/api/query \
  -H "Content-Type: application/json" \
  -d '{"query_text":"How do text classification models work?","k":3}'

Query with fallback to Firecrawl

curl -X POST http://127.0.0.1:8000/api/query_with_fallback \
  -H "Content-Type: application/json" \
  -d '{"query_text":"What is machine learning?","k":5}'

If the vector store returns no documents, the endpoint will return fallback: true and web_results from Firecrawl.

Notes

  • There is currently no chat UI included in this repository.
  • The app returns vector DB matches by default and only uses Firecrawl when local results are empty.
  • If you want stronger fallback behavior, the query_with_fallback logic can be updated to use a similarity threshold.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.