LlamaIndex Documentation MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LlamaIndex Documentation MCP ServerSearch LlamaIndex docs for query engine"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Clone or create the project structure:
git clone <repo-url> cd llamaindex-mcp-serverBuild and run with Docker Compose:
docker-compose up -d --buildThe 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/rpcResponse:
{"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=1PYTHONPATH=/appUVICORN_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 8000Troubleshooting
Common Issues
Container fails to start:
Check Docker is running
Verify the image was built successfully
Check container logs:
docker logs mcp-server
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
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 APIMCP 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
Fork the repository
Create a feature branch
Make your changes
Test with Docker
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
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LiteObject/llamaindex-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server