--- title: RAG Books MCP (ESL+ISLP+FES+PDSH+R4DS) emoji: 📖 colorFrom: indigo colorTo: purple sdk: gradio sdk_version: 5.50.0 app_file: app.py pinned: false license: apache-2.0 short_description: MCP RAG sobre 5 libros de Statistical Learning. tags: - mcp-server-track - rag - statistical-learning - chromadb - educational --- # 📖 RAG Books MCP — ESL + ISLP + FES + PDSH + R4DS Servidor MCP (Model Context Protocol) que expone búsqueda semántica sobre cinco libros de referencia de Statistical Learning, Data Science y Data Wrangling, accesible tanto por interfaz web como por clientes MCP (Kiro, Claude Desktop, Cursor, etc.). | Libro | Autores | Rol | |---|---|---| | **ESL** — *The Elements of Statistical Learning* | Hastie, Tibshirani, Friedman | Teoría rigurosa | | **ISLP** — *An Introduction to Statistical Learning with Python* | James, Witten, Hastie, Tibshirani | Teoría intuitiva con Python | | **FES** — *Feature Engineering and Selection* | Kuhn, Johnson | Heurísticas de FE | | **PDSH** — *Python Data Science Handbook* | VanderPlas | Implementación Python | | **R4DS** — *R for Data Science, 2nd Ed.* | Wickham, Çetinkaya-Rundel, Grolemund | EDA iterativo y data wrangling | > ℹ️ **R4DS y la cláusula NoDerivatives** — *R for Data Science* está bajo > licencia CC BY-NC-ND 3.0 US. Está incluido en este Space para uso académico > con atribución explícita. Si los autores o el editor consideran que excede > su política, abre un issue en el repo del MCP server y se retirará en menos > de 24 h. Detalles en el [DATA_CARD del dataset v2](https://huggingface.co/datasets/gusdelact/rag-esl-islp-chromadb). > ⚠️ **R4DS está escrito en R/tidyverse**, no en Python. El valor de su > indexación son los principios de EDA y data wrangling que se traducen 1-a-1 > a pandas/seaborn. Cualquier cliente MCP debe presentar el código en el > lenguaje del usuario, nunca copiar R como solución. ## v1 vs v2 - **v1 (este Space):** la base ChromaDB se empaqueta dentro del Space (~95 MB de archivos en el repo). Más simple de operar. - **v2:** la base ChromaDB vive en un dataset HF independiente ([`gusdelact/rag-esl-islp-chromadb`](https://huggingface.co/datasets/gusdelact/rag-esl-islp-chromadb)) y el Space la descarga al primer uso. Permite re-ingestar sin redeploy. Ver [Space v2](https://huggingface.co/spaces/gusdelact/rag-books-mcp-v2). ## Endpoint MCP ``` https://-.hf.space/gradio_api/mcp/ ``` ## Conexión desde un cliente MCP ```jsonc { "mcpServers": { "rag-books-mcp": { "url": "https://-.hf.space/gradio_api/mcp/" } } } ``` Si tu cliente MCP no soporta streamable HTTP nativo, usa `mcp-remote` como puente: ```jsonc { "mcpServers": { "rag-books-mcp": { "command": "npx", "args": [ "mcp-remote", "https://-.hf.space/gradio_api/mcp/" ] } } } ``` ## Tools | Tool | Descripción | |------|-------------| | `search_theory(query, book, top_k)` | Búsqueda semántica en los 5 libros (filtrable por libro). | | `get_section(book, chapter, section, max_chunks)` | Sección específica por referencia. | | `cite_foundation(topic, detail_level)` | Fundamentación teórica multi-libro. | | `list_available_topics()` | Lista capítulos y secciones indexados. | ## Stack - **Embeddings:** `sentence-transformers/all-MiniLM-L6-v2` (local, sin API key) - **Vector store:** ChromaDB persistente, **3689 chunks** publicados (1093 ESL + 884 ISLP + 465 FES + 563 PDSH + 684 R4DS). - **UI / MCP:** Gradio con `mcp_server=True` ## Repositorio Código fuente y variante stdio (Git/local): ver el repo del autor.