loading…
Search for a command to run...
loading…
Enables searching and fetching LlamaIndex documentation for integration with VS Code Copilot and other MCP clients.
Enables searching and fetching LlamaIndex documentation for integration with VS Code Copilot and other MCP clients.
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.
Clone or create the project structure:
git clone <repo-url>
cd llamaindex-mcp-server
Build and run with Docker Compose:
docker-compose up -d --build
http://localhost:8000.mcp-server.liteobject/llamaindex-mcp-server.The container exposes a healthcheck endpoint:
GET http://localhost:8000/rpc
Response:
{"status": "ok", "method": "GET /rpc healthcheck"}
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"
}
}
}
settings.json.When configuring MCP servers in VS Code or other clients, you may encounter different server types. Here is a brief explanation of each:
http://localhost:8000/rpc). This is the type used by this project.For this server, use the http type as shown in the VS Code Integration section above.
Once configured, the MCP server provides the following tools to VS Code Copilot via HTTP:
query (string), limit (integer, optional)uri (string)The server automatically discovers and provides access to:
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"
}
}
}
PYTHONUNBUFFERED=1PYTHONPATH=/appUVICORN_LOG_LEVEL=warningTo run locally without Docker:
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000
Container fails to start:
docker logs mcp-serverVS Code doesn't recognize the MCP server:
Documentation fetching fails:
VS Code Copilot
↓
MCP Protocol (HTTP)
↓
Docker Container / Python MCP Server (FastAPI)
↓
LlamaIndex Docs API
For a comprehensive guide to the Model Context Protocol (MCP), including protocol architecture, message formats, implementation patterns, and best practices, see MCP_GUIDE.md.
MIT License - feel free to use and modify as needed.
For issues related to:
Выполни в терминале:
claude mcp add llamaindex-documentation-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.