LlamaCloud RAG MCP Server

LlamaCloud RAG MCP Server

Enables querying LlamaCloud document indices using retrieval-augmented generation, providing intelligent answers with sources directly in Cursor IDE.

Category
Visit Server

README

๐Ÿฆ™ LlamaCloud RAG MCP Server

License: MIT Node.js TypeScript

Professional Model Context Protocol (MCP) server for Retrieval-Augmented Generation using LlamaCloud API. Built with TypeScript following industry best practices from the Cursor MCP Integration Guide 2025.

Transform your Cursor IDE into an AI powerhouse! Connect any LlamaCloud document index and get intelligent answers with sources directly in your development workflow.

โœจ Features

  • ๐Ÿš€ Professional TypeScript Implementation: Type-safe, compiled, production-ready
  • ๐Ÿฆ™ LlamaCloud Integration: Direct API connection to cloud-hosted document indices
  • ๐Ÿ› ๏ธ Three Powerful Tools: Query, search, and inspect your knowledge base
  • ๐Ÿ“‹ MCP Protocol Compliant: Full compatibility with Cursor IDE
  • โšก Performance Optimized: Efficient API calls and response handling
  • ๐Ÿ” Secure: Environment-based API key management
  • ๐Ÿ“ฆ Easy Installation: Automated setup script included

๐ŸŽฏ Quick Start

Option 1: Automated Installation (Recommended)

# Clone the repository
git clone https://github.com/uiqkos/llamacloud-rag-mcp.git
cd llamacloud-rag-mcp

# Run the interactive installer
chmod +x install.sh
./install.sh

The installer will:

  • โœ… Check Node.js version
  • ๐Ÿ“ฆ Install dependencies
  • ๐Ÿ”ง Build the project
  • ๐Ÿ”‘ Setup your API key + Organization ID + Pipeline ID
  • ๐Ÿ“‚ Configure Cursor MCP
  • ๐Ÿงช Test the connection

Option 2: Manual Installation

# 1. Clone and setup
git clone https://github.com/uiqkos/llamacloud-rag-mcp.git
cd llamacloud-rag-mcp
npm install
npm run build

# 2. Get your LlamaCloud API key
# Visit: https://cloud.llamaindex.ai/

# 3. Configure Cursor
# Add to ~/.cursor/mcp.json or .cursor/mcp.json:
{
  "mcpServers": {
    "llamacloud-rag": {
      "command": "node",
      "args": ["/absolute/path/to/llamacloud-rag-mcp/dist/index.js"],
      "env": {
        "LLAMA_CLOUD_API_KEY": "your-api-key-here",
        "LLAMA_CLOUD_ORGANIZATION_ID": "your-organization-id",
        "LLAMA_CLOUD_PIPELINE_ID": "your-pipeline-id"
      }
    }
  }
}

# 4. Restart Cursor IDE

๐Ÿ”ง Prerequisites

  • Node.js 18.0+ and npm
  • LlamaCloud API Key (get it here)
  • LlamaCloud Organization ID
  • LlamaCloud Pipeline ID (or a full Pipeline URL)
  • Cursor IDE with MCP support

๐Ÿ“‹ Available Tools

๐Ÿ” query_rag

Ask questions about your documents and get comprehensive answers with sources.

Input:

  • question (string, 1-1000 chars): Your question about the documents

Output:

  • ๐Ÿ“ Detailed answer based on retrieved content
  • ๐Ÿ“š List of source documents with relevance scores
  • ๐Ÿ‘€ Preview text from each source

Example:

Question: "What is database normalization?"
Answer: Based on the found documents, database normalization is...
Sources: 
1. Database Design Principles (relevance: 0.95)
2. SQL Fundamentals (relevance: 0.87)

๐Ÿ“„ search_documents

Search for relevant documents without generating an answer.

Input:

  • query (string, 1-500 chars): Search query
  • top_k (number, 1-10, default 5): Number of results

Output:

  • ๐Ÿ“„ List of matching documents
  • ๐Ÿ” Content previews and metadata
  • ๐Ÿ“Š Relevance scores

โ„น๏ธ get_index_info

Get detailed information about your LlamaCloud index.

Input: None

Output:

  • ๐Ÿ“‹ Index name, project, organization details
  • โœ… Current status and configuration
  • ๐Ÿ”— Pipeline URL and last update time

๐Ÿงช Testing Your Setup

# Test with npm scripts
npm run test

# Manual testing
npm run test:init  # Test initialization
npm run test:tools # Test tool listing

# Test with your API key
LLAMA_CLOUD_API_KEY="your-key" LLAMA_CLOUD_ORGANIZATION_ID="your-org-id" LLAMA_CLOUD_PIPELINE_ID="your-pipeline-id" npm run test

๐Ÿ“ Project Structure

llamacloud-rag-mcp/
โ”œโ”€โ”€ ๐Ÿ“‚ src/
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ index.ts           # Main MCP server implementation
โ”œโ”€โ”€ ๐Ÿ“‚ dist/                  # Compiled JavaScript (auto-generated)  
โ”œโ”€โ”€ ๐Ÿ“„ package.json           # Node.js configuration
โ”œโ”€โ”€ ๐Ÿ“„ tsconfig.json          # TypeScript configuration
โ”œโ”€โ”€ ๐Ÿ“„ install.sh            # Automated installer
โ”œโ”€โ”€ ๐Ÿ“„ cursor-mcp-config.example.json  # Configuration example
โ”œโ”€โ”€ ๐Ÿ“„ config.example         # LlamaCloud config template
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE               # MIT license
โ””โ”€โ”€ ๐Ÿ“„ README.md             # This file

๐Ÿ” Security & Best Practices

  • โœ… API Key Protection: Never commit keys to version control
  • โœ… Environment Variables: Secure configuration management
  • โœ… Type Safety: Full TypeScript implementation
  • โœ… Error Handling: Comprehensive error catching and reporting
  • โœ… Input Validation: Secure parameter validation
  • โœ… No Data Logging: Your queries stay private

๐ŸŽจ Customization

Using Your Own LlamaCloud Index

  1. Create your index in LlamaCloud
  2. Set the required environment variables in your Cursor MCP config:
LLAMA_CLOUD_API_KEY=...
LLAMA_CLOUD_ORGANIZATION_ID=...
LLAMA_CLOUD_PIPELINE_ID=...
# or set LLAMA_CLOUD_PIPELINE_URL=... instead of PIPELINE_ID
  1. Rebuild: npm run build

Custom Tools

Extend the server by adding new tools in src/index.ts. Follow the existing patterns for type safety and error handling.

๐Ÿ› Troubleshooting

Tools not showing in Cursor?

  1. โœ… Check env vars: Ensure LLAMA_CLOUD_API_KEY, LLAMA_CLOUD_ORGANIZATION_ID, and LLAMA_CLOUD_PIPELINE_ID (or LLAMA_CLOUD_PIPELINE_URL) are set correctly
  2. ๐Ÿ”„ Restart Cursor: Fully quit and restart Cursor IDE
  3. ๐Ÿ“ Check paths: Ensure absolute paths in MCP configuration
  4. ๐Ÿ” Check logs: Look at Cursor developer console for errors
  5. ๐Ÿงช Test manually: Run npm run test to verify server works

Common Issues

"Module not found": Run npm run build first "Missing required environment variables": Set LLAMA_CLOUD_API_KEY, LLAMA_CLOUD_ORGANIZATION_ID, and LLAMA_CLOUD_PIPELINE_ID (or LLAMA_CLOUD_PIPELINE_URL)
"Connection failed": Check your LlamaCloud API key and internet connection "Tools not listed": Verify Cursor MCP configuration syntax

Getting Help

  • ๐Ÿ“– Check the MCP Documentation
  • ๐Ÿ’ฌ Open an issue
  • ๐Ÿ” Review Cursor logs in developer console

๐Ÿค Contributing

Contributions are welcome! Please read our contributing guidelines and open an issue or pull request.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments


Made with โค๏ธ for the developer community

Star โญ this repository if it helped you!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured