kdrive-mcp
v1.0.0
Published
MCP server for Infomaniak kDrive — search, list, and read files (text, Excel, Word, PDF, PowerPoint)
Downloads
27
Maintainers
Readme
kdrive-mcp
MCP server for Infomaniak kDrive — search, browse, and read files directly from your drive inside any MCP-compatible AI client.
Features
- Search file content across the drive (full-text, indexed files)
- Find any file by name using parallel recursive directory traversal
- Browse the folder tree with
list - Read plain-text files (txt, csv, json, xml, md, …)
- Parse structured documents and return clean text:
- Excel / Calc —
.xlsx,.xls,.ods→ CSV per sheet (SheetJS) - Word —
.docx→ plain text (mammoth) - PDF —
.pdf→ plain text (PDF.js via unpdf) - PowerPoint / Impress —
.pptx,.ppt,.odp→ plain text (officeparser) - Legacy / OpenDocument —
.doc,.odt→ plain text (officeparser)
- Excel / Calc —
- Smart router (
kdrive_read) — auto-detects format, falls back to file extension when the MIME type is generic - MCP Resource — expose any file as a base64 blob via
kdrive://{id}
Tools
kdrive_search
Full-text search across indexed file content.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| query | string | — | Search terms |
| limit | integer | 15 | Max results (1–50) |
Note: Binary files (xlsx, pdf, …) are not indexed by kDrive's search engine. Use
kdrive_findto locate them by filename.
kdrive_find
Recursively walks the directory tree (5 concurrent requests) to find files or folders by filename substring — reliable for all file types.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| query | string | — | Filename substring (case-insensitive) |
| folder_id | string | "1" | Folder to start from ("1" = drive root) |
| max_results | integer | 10 | Max matches (1–50) |
kdrive_list
List the contents of a folder (files and subdirectories).
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | Folder ID to list ("1" = root) |
kdrive_read ⭐
Smart router — inspects the MIME type (with file-extension fallback) and delegates to the right parser automatically.
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | ID of the file to read |
Supported formats: xlsx, xls, ods, docx, doc, pdf, pptx, ppt, odp, odt, and any plain-text format.
kdrive_read_text_file
Read a plain-text file (txt, csv, json, xml, md, …) decoded as UTF-8. Output capped at 100,000 characters.
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | ID of the text file |
kdrive_read_excel
Parse a spreadsheet and return all sheets as CSV. Supports .xlsx, .xls, and .ods. Output capped at 80,000 characters.
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | ID of the spreadsheet file |
kdrive_read_word
Extract plain text from a .docx file using mammoth (highest quality). Output capped at 80,000 characters.
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | ID of the .docx file |
For legacy
.docfiles usekdrive_read.
kdrive_read_pdf
Extract plain text from a PDF using PDF.js (via unpdf). All pages merged. Output capped at 80,000 characters.
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | ID of the PDF file |
kdrive_read_pptx
Extract slide text from a presentation using officeparser. Supports .pptx, .ppt, and .odp. Output capped at 80,000 characters.
| Parameter | Type | Description |
|-----------|------|-------------|
| file_id | string | ID of the presentation file |
Resources
kdrive://{id}
Exposes any kDrive file as a base64-encoded blob resource with the correct MIME type — useful for GUI-driven file selection in MCP clients that support resources.
Setup
Prerequisites
You need two values from your Infomaniak account:
KDRIVE_TOKEN— an Infomaniak API token with kDrive access.
Create one at app.infomaniak.com → API (scope: Drive).KDRIVE_ID— the numeric ID of your kDrive.
Find it in the kDrive web app URL:https://kdrive.infomaniak.com/app/drive/**123456**/…
Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"kdrive": {
"command": "npx",
"args": ["-y", "kdrive-mcp"],
"env": {
"KDRIVE_TOKEN": "your-api-token",
"KDRIVE_ID": "your-drive-id"
}
}
}
}Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Claude Code (CLI)
claude mcp add kdrive-mcp --scope project \
-e KDRIVE_TOKEN=your-api-token \
-e KDRIVE_ID=your-drive-id \
-- npx -y kdrive-mcpVS Code
Add to your workspace .vscode/mcp.json:
{
"servers": {
"kdrive": {
"type": "stdio",
"command": "npx",
"args": ["-y", "kdrive-mcp"],
"env": {
"KDRIVE_TOKEN": "your-api-token",
"KDRIVE_ID": "your-drive-id"
}
}
}
}Development
git clone https://github.com/ddanssaert/kdrive-mcp
cd kdrive-mcp
npm install
KDRIVE_TOKEN=your-token KDRIVE_ID=your-drive-id node index.jsInspect tools interactively with the MCP Inspector:
KDRIVE_TOKEN=your-token KDRIVE_ID=your-drive-id \
npx @modelcontextprotocol/inspector node index.jsDesign Notes
- Context bloat prevention — search and list results are mapped to minimal objects (
id,name,mime_type,size). Raw API responses with internal metadata are never forwarded to the model. - Binary safety — all downloads use
response.arrayBuffer(). Text is never decoded withresponse.text()+btoa(), which would corrupt non-UTF-8 bytes. - Output caps — parsed document text is sliced to 80,000–100,000 characters with a truncation notice so the model always knows when content is incomplete.
- Timeout protection — API calls abort after 15 s; file downloads after 2 min.
- Rate limit awareness — kDrive enforces 60 requests/min.
kdrive_findbatches directory listings 5 at a time to stay efficient without bursting.
License
MIT
