LlamaIndex Documentation MCP Server

LlamaIndex Documentation MCP Server

Enables searching and fetching LlamaIndex documentation for integration with VS Code Copilot and other MCP clients.

Category
Visit Server

README

LlamaIndex Documentation MCP Server

A Model Context Protocol (MCP) server that fetches and serves LlamaIndex documentation for VS Code Copilot integration. This server now runs as an HTTP service (using FastAPI) and provides searchable access to LlamaIndex documentation.

Features

  • 🔍 Search through LlamaIndex documentation
  • 📚 Fetch specific documentation resources
  • 🐳 Containerized for easy deployment
  • 🔧 VS Code Copilot integration
  • ⚡ Async HTTP client for fast fetching
  • 💾 Content caching for improved performance
  • 🌐 HTTP API for multi-client (multi-VS Code) support

Table of Contents

Prerequisites

  • Docker and Docker Compose installed
  • VS Code with Copilot extension
  • Python 3.11+ (for local development)

Quick Start

  1. Clone or create the project structure:

    git clone <repo-url>
    cd llamaindex-mcp-server
    
  2. Build and run with Docker Compose:

    docker-compose up -d --build
    
    • The service will be available at http://localhost:8000.
    • The container will be named mcp-server.
    • The Docker image will be named liteobject/llamaindex-mcp-server.

Healthcheck

The container exposes a healthcheck endpoint:

GET http://localhost:8000/rpc

Response:

{"status": "ok", "method": "GET /rpc healthcheck"}

VS Code Integration

To use this MCP server with VS Code Copilot or compatible extensions, add the following to your VS Code settings.json:

"mcp": {
  "inputs": [],
  "servers": {
    "llamaindex-docs": {
      "type": "http",
      "url": "http://localhost:8000/rpc"
    }
  }
}
  • Make sure your server is running and accessible at the specified URL.
  • You can add this block to your global or workspace settings.json.

MCP Server Types

When configuring MCP servers in VS Code or other clients, you may encounter different server types. Here is a brief explanation of each:

  • http: Communicates with the MCP server over HTTP(S) using a URL (e.g., http://localhost:8000/rpc). This is the type used by this project.
  • stdio: Communicates with the MCP server via standard input/output (stdin/stdout). Typically used for local processes started by the client.
  • sse: Uses Server-Sent Events (SSE) over HTTP for streaming responses from the server. Useful for real-time updates or long-running operations.
  • websocket: Uses a WebSocket connection for bidirectional communication between client and server.

For this server, use the http type as shown in the VS Code Integration section above.

API Usage

Once configured, the MCP server provides the following tools to VS Code Copilot via HTTP:

Tools Available

  • search_llamaindex_docs: Search through LlamaIndex documentation
    • Parameters: query (string), limit (integer, optional)
  • get_llamaindex_resource: Get full content of a specific documentation resource
    • Parameters: uri (string)

Resources Available

The server automatically discovers and provides access to:

  • Getting Started guides
  • Module guides (loading, indexing, querying)
  • Agent documentation
  • API references
  • Examples and tutorials

Example: JSON-RPC Request

Send a JSON-RPC 2.0 request to the server:

curl -X POST http://localhost:8000/rpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "initialize"}'

Example response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2024-11-05",
    "capabilities": {
      "resources": {"subscribe": true, "listChanged": true},
      "tools": {"listChanged": true}
    },
    "serverInfo": {
      "name": "llamaindex-docs-server",
      "version": "1.0.0"
    }
  }
}

Environment Variables

  • PYTHONUNBUFFERED=1
  • PYTHONPATH=/app
  • UVICORN_LOG_LEVEL=warning

Local Development

To run locally without Docker:

pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000

Troubleshooting

Common Issues

  1. Container fails to start:

    • Check Docker is running
    • Verify the image was built successfully
    • Check container logs: docker logs mcp-server
  2. VS Code doesn't recognize the MCP server:

    • Ensure the configuration is in the correct settings.json
    • Restart VS Code completely
    • Check VS Code developer console for errors
  3. Documentation fetching fails:

    • Check internet connectivity from container
    • Verify LlamaIndex docs are accessible
    • Check container logs for HTTP errors

Architecture

VS Code Copilot
      ↓
   MCP Protocol (HTTP)
      ↓
  Docker Container / Python MCP Server (FastAPI)
      ↓
  LlamaIndex Docs API

MCP Protocol Guide

For a comprehensive guide to the Model Context Protocol (MCP), including protocol architecture, message formats, implementation patterns, and best practices, see MCP_GUIDE.md.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with Docker
  5. Submit a pull request

License

MIT License - feel free to use and modify as needed.

Support

For issues related to:

  • MCP Protocol: Check the MCP specification
  • VS Code Integration: Check VS Code Copilot documentation
  • LlamaIndex Docs: Check LlamaIndex documentation
  • This Server: Create an issue in the repository

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