MCP HubMCP Hub
run-llama

mcp-server-llamacloud

by: run-llama

A MCP server connecting to managed indexes on LlamaCloud

72created 04/12/2024
Visit
LlamaCloud
index

📌Overview

Purpose: To provide a TypeScript-based MCP server for connecting multiple tools to managed indexes on LlamaCloud.

Overview: The LlamaCloud MCP Server serves as a gateway to various managed indexes, allowing users to interact with specific data through defined tools. Each tool represents a unique index, facilitating targeted queries and data retrieval.

Key Features:

  • Tool Creation: Generates a dedicated tool for each defined index, enabling focused querying of that index's data.

  • Query Support: Each tool includes a query parameter for executing searches within its specific index.

  • Auto-naming Convention: Automatically generates intuitive tool names based on the corresponding index names for easier identification and usage.


LlamaCloud MCP Server

A TypeScript-based MCP server connecting to multiple managed indexes on LlamaCloud. Each tool is created via command-line arguments and connects to a specific managed index.

Features

Tools

  • Creates a separate tool for each index you define.
  • Each tool provides a query parameter to search its specific index.
  • Auto-generates tool names like get_information_index_name based on index names.

Installation

To use with your MCP Client (e.g. Claude Desktop, Windsurf, or Cursor), add the following configuration to your MCP client config:

{
  "mcpServers": {
    "llamacloud": {
      "command": "npx",
      "args": [
        "-y",
        "@llamaindex/mcp-server-llamacloud",
        "--index",
        "10k-SEC-Tesla",
        "--description",
        "10k SEC documents from 2023 for Tesla",
        "--index",
        "10k-SEC-Apple",
        "--description",
        "10k SEC documents from 2023 for Apple"
      ],
      "env": {
        "LLAMA_CLOUD_PROJECT_NAME": "<YOUR_PROJECT_NAME>",
        "LLAMA_CLOUD_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

For Claude, the MCP config file locations:

  • On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json

Tool Definition Format

In the args array of the MCP config, define multiple tools by providing pairs of --index and --description arguments. Each pair defines a new tool.

Example:

--index "10k-SEC-Tesla" --description "10k SEC documents from 2023 for Tesla"

Adds a tool for the 10k-SEC-Tesla LlamaCloud index to the MCP server.

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

To use the development version, replace in your MCP config:

npx @llamaindex/mcp-server-llamacloud

with

node ./build/index.js

Debugging

MCP servers communicate over stdio, which can make debugging challenging. Use the MCP Inspector, available as a package script:

npm run inspector

The Inspector provides a URL for browser-based debugging tools.