How shabib87/supernova-mcp-rag works
SuperNova MCP RAG Server lets a user search imaginary product documentation from an MCP client. Startup loads HTML documentation, extracts and chunks its text, then embeds the chunks into an in-memory vector store; the registered search tool queries that store and returns matching passages. The graph preserves the sampled entry point and helper modules alongside the documented indexing stages. Some library internals are represented from README documentation rather than inspected source.
Main entry points: rag.ts RAG pipeline · mcp.ts MCP tool server · index.ts Server entry · getEnv.ts Environment loader
Components 13
MCP Interface
- Server entry
mcp-rag-server/src/index.ts - MCP tool server
mcp-rag-server/src/mcp.ts
Document Indexing
- RAG pipeline
mcp-rag-server/src/rag.ts - HTML text extractor
mcp-rag-server/src/helpers/extractTextFromHtml.ts - Text chunking
- HF embeddings
- Memory vector store
Documentation Source
- SuperNova HTML docs
docs/SuperNovaStorybook-Mobile-Swift
Runtime Helpers
- Path resolver
mcp-rag-server/src/helpers/dirName.ts - Environment loader
mcp-rag-server/src/helpers/getEnv.ts - Console redirect
mcp-rag-server/src/helpers/redirectConsole.ts
Other components
- Cursor user
- Hugging Face API
Connections 17
- Cursor user → MCP tool server: asks via MCP
README.md - Server entry → MCP tool server: starts
mcp-rag-server/src/index.ts - Server entry → Console redirect: loads
mcp-rag-server/src/index.ts - MCP tool server → RAG pipeline: creates
mcp-rag-server/src/mcp.ts - MCP tool server → RAG pipeline: initializes
mcp-rag-server/src/mcp.ts - RAG pipeline → SuperNova HTML docs: loads HTML
mcp-rag-server/src/rag.ts - RAG pipeline → HTML text extractor: extracts text
mcp-rag-server/src/rag.ts - RAG pipeline → Text chunking: chunks text
README.md - RAG pipeline → HF embeddings: embeds chunks
README.md - HF embeddings → Hugging Face API: requests embeddings
README.md - RAG pipeline → Memory vector store: builds index
mcp-rag-server/src/rag.ts - MCP tool server → Memory vector store: searches
mcp-rag-server/src/mcp.ts - Memory vector store → MCP tool server: returns matches
mcp-rag-server/src/mcp.ts - MCP tool server → Cursor user: returns passages
README.md - RAG pipeline → Path resolver: resolves path
mcp-rag-server/src/rag.ts - RAG pipeline → Environment loader: loads credentials
mcp-rag-server/src/rag.ts - Environment loader → Path resolver: resolves env path
mcp-rag-server/src/helpers/getEnv.ts