MCP RAG + Agent Server for AI Tutor
Provides a RAG knowledge base backed by PostgreSQL with pgvector, enabling document ingestion and semantic search using cosine similarity.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP RAG + Agent Server for AI Tutor
A complete Model Context Protocol (MCP) server that combines:
RAG (Retrieval-Augmented Generation) with PostgreSQL + pgvector
Free LLM integration via OpenRouter
Dynamic agent creation as an MCP tool
FastMCP framework for building the server
Features
Tools
ingest_documents— Import documents into the vector knowledge basesearch_knowledge— Semantic search using cosine similarityask_with_rag— Full RAG pipeline (retrieve + LLM generation)create_agent— Dynamically create and run specialized AI agents
Resources
knowledge://stats— Knowledge base statisticsknowledge://config— Current server configuration
Prompts
explain_concept— Generate explanation prompts for any concept
Related MCP server: RagLit MCP Server
Architecture
User → MCP Client (VS Code Copilot) → MCP Server → PostgreSQL+pgvector → OpenRouter LLM
Setup
1. Start PostgreSQL + pgvector
docker run -d --name pgvector-demo \
-e POSTGRES_USER=tutor \
-e POSTGRES_PASSWORD=tutor123 \
-e POSTGRES_DB=ai_tutor \
-p 5432:5432 pgvector/pgvector:pg16
##2. Install dependencies
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
3. Configure .env
DATABASE_URL=postgresql://tutor:tutor123@localhost:5432/ai_tutor
OPENROUTER_API_KEY=sk-or-v1-your-key
OPENAI_API_KEY=sk-your-openai-key
OPENROUTER_MODEL=openrouter/free
EMBEDDING_MODEL=nvidia/nemotron-3-embed-1b:free
EMBEDDING_BASE_URL=https://openrouter.ai/api/v1
4. Run the server
python server.py
Testing
Use MCP Inspector:
fastmcp dev inspector server.py
Tech Stack
FastMCP (MCP SDK for Python)
PostgreSQL 16 + pgvector
OpenAI Python SDK (via OpenRouter)
Python 3.11+
License
Apache 2.0Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Shared knowledge base for AI agents. Semantic search across agents, no setup required — just a URL.
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceA local-first knowledge base server that enables AI clients to store, retrieve, and manage documents using semantic search. Provides privacy-focused, offline-capable memory for AI assistants with tools for ingesting, querying, updating, and deleting knowledge.721 npm-
- AlicenseCqualityDmaintenanceEnables AI agents to ingest documents, generate embeddings, and perform semantic search via PostgREST APIs.3ISC
- AlicenseAqualityDmaintenanceEnables ingestion and semantic search over text documents using PostgreSQL + pgvector and OpenAI-compatible embeddings, allowing any LLM agent to retrieve relevant chunks for grounded answers.4AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceMCP server for a shared Postgres-backed knowledge base with hybrid retrieval and agentic RAG, enabling coding agents to upload, search, and ask questions over documents with cited answers.-