{"_id":"@charansamanchi/mcp-onedrive","_rev":"5-aa3120e12e9483d8718acc88d1401d47","name":"@charansamanchi/mcp-onedrive","dist-tags":{"latest":"1.1.3"},"versions":{"1.0.0":{"name":"@charansamanchi/mcp-onedrive","version":"1.0.0","keywords":["mcp","onedrive","sharepoint","claude","anthropic","filesystem"],"license":"MIT","_id":"@charansamanchi/mcp-onedrive@1.0.0","maintainers":[{"name":"charansamanchi","email":"charan.samanchi@sap.com"}],"bin":{"mcp-onedrive":"src/index.js"},"dist":{"shasum":"feabb0ea91d78fae5c92576d6f1f12e145e9d997","tarball":"https://registry.npmjs.org/@charansamanchi/mcp-onedrive/-/mcp-onedrive-1.0.0.tgz","fileCount":20,"integrity":"sha512-0sfqzu+pjboGbxMJcip/AbgGRAFBs+8Gc79bIy5Y5NGua01rpUVwmdEImaU4br1CfnHEOTzaQqecIH9iYb5JOA==","signatures":[{"sig":"MEYCIQC3CYT8jRTNT1XX8QNejBHxhfBbDk3lmFiVErg/wTBc3QIhAPrdVnH1T65n+Rx/YdKjEaaKLzzT2PGHzKjxOoWRmSnq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61477},"main":"src/index.js","gitHead":"8a6061479ed359489fc37946eb2da3e0f16aeef9","scripts":{"dev":"node --watch src/index.js","start":"node src/index.js","index-file":"node scripts/index-file.js","build-index":"node scripts/build-index.js"},"_npmUser":{"name":"charansamanchi","email":"charan.samanchi@sap.com"},"_npmVersion":"11.8.0","description":"MCP server for local OneDrive folder — list, search and read files (txt, md, docx, pdf, xlsx, csv, pptx)","directories":{},"_nodeVersion":"24.13.1","dependencies":{"zod":"^3.23.8","xlsx":"^0.18.5","axios":"^1.7.2","dotenv":"^16.4.5","mammoth":"^1.8.0","vectordb":"^0.4.20","pdf-parse":"^1.1.1","officeparser":"^4.1.2","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-onedrive_1.0.0_1784010495255_0.1235830583850599","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@charansamanchi/mcp-onedrive","version":"1.1.0","keywords":["mcp","onedrive","sharepoint","claude","anthropic","filesystem"],"license":"MIT","_id":"@charansamanchi/mcp-onedrive@1.1.0","maintainers":[{"name":"charansamanchi","email":"charan.samanchi@sap.com"}],"bin":{"mcp-onedrive":"src/index.js"},"dist":{"shasum":"d2bc268f90fd33e02765003f9f67d6e880970ee1","tarball":"https://registry.npmjs.org/@charansamanchi/mcp-onedrive/-/mcp-onedrive-1.1.0.tgz","fileCount":20,"integrity":"sha512-+yvGkBzzyS/wEoINK+hqreOQ/FW9+1baHAC6FrdVVlrOKEy8W8v+7dO/GlQ6cgNBZ0Tc4Wu9gQhGo89MH5s6gg==","signatures":[{"sig":"MEQCID0LXZwrIybnl6EhABOeXX9TTfysSr6sqhnJRMgHycdzAiAIPmqdGzFqndrUCbTQAA5qImbuTLUgi6CHstLNjub41Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63501},"main":"src/index.js","gitHead":"8a6061479ed359489fc37946eb2da3e0f16aeef9","scripts":{"dev":"node --watch src/index.js","start":"node src/index.js","index-file":"node scripts/index-file.js","build-index":"node scripts/build-index.js"},"_npmUser":{"name":"charansamanchi","email":"charan.samanchi@sap.com"},"_npmVersion":"11.8.0","description":"MCP server for local OneDrive folder — list, search and read files (txt, md, docx, pdf, xlsx, csv, pptx)","directories":{},"_nodeVersion":"24.13.1","dependencies":{"zod":"^3.23.8","xlsx":"^0.18.5","axios":"^1.7.2","dotenv":"^16.4.5","mammoth":"^1.8.0","vectordb":"^0.4.20","pdf-parse":"^1.1.1","officeparser":"^4.1.2","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-onedrive_1.1.0_1784012107259_0.9728065050708103","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@charansamanchi/mcp-onedrive","version":"1.1.1","keywords":["mcp","onedrive","sharepoint","claude","anthropic","filesystem"],"license":"MIT","_id":"@charansamanchi/mcp-onedrive@1.1.1","maintainers":[{"name":"charansamanchi","email":"charan.samanchi@sap.com"}],"bin":{"mcp-onedrive":"src/index.js"},"dist":{"shasum":"c9038534dbea860d96614037589112447a1b3d54","tarball":"https://registry.npmjs.org/@charansamanchi/mcp-onedrive/-/mcp-onedrive-1.1.1.tgz","fileCount":20,"integrity":"sha512-wC3/ZmeMsNe7IV6u9Y/CXEovR0j+1cxz9ayqEod1Yu5AbgO7jk8jrLQxcVr/PhsdAJcgLKAPO6zHqHpboFwxeg==","signatures":[{"sig":"MEUCIEFhe5IzZDdkhqEGxg5UWlTj9DtJmtnM5eDSVLJiDPbRAiEA3Gk0zCGIM9t/7Q+P5GUxAkOvN2p4UfQfdPg/ZpXXCZE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64898},"main":"src/index.js","gitHead":"8a6061479ed359489fc37946eb2da3e0f16aeef9","scripts":{"dev":"node --watch src/index.js","start":"node src/index.js","index-file":"node scripts/index-file.js","build-index":"node scripts/build-index.js"},"_npmUser":{"name":"charansamanchi","email":"charan.samanchi@sap.com"},"_npmVersion":"11.8.0","description":"MCP server for local OneDrive folder — list, search and read files (txt, md, docx, pdf, xlsx, csv, pptx)","directories":{},"_nodeVersion":"24.13.1","dependencies":{"zod":"^3.23.8","xlsx":"^0.18.5","axios":"^1.7.2","dotenv":"^16.4.5","mammoth":"^1.8.0","vectordb":"^0.4.20","pdf-parse":"^1.1.1","officeparser":"^4.1.2","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-onedrive_1.1.1_1784012869346_0.46038234991950056","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@charansamanchi/mcp-onedrive","version":"1.1.2","keywords":["mcp","onedrive","sharepoint","claude","anthropic","filesystem"],"license":"MIT","_id":"@charansamanchi/mcp-onedrive@1.1.2","maintainers":[{"name":"charansamanchi","email":"charan.samanchi@sap.com"}],"bin":{"mcp-onedrive":"src/index.js"},"dist":{"shasum":"22e02e16c1e70c8e7b9960621dd9aad7ab8b1617","tarball":"https://registry.npmjs.org/@charansamanchi/mcp-onedrive/-/mcp-onedrive-1.1.2.tgz","fileCount":20,"integrity":"sha512-WeyboLYD3k6cKIp+iQKsymMTtHQl2Nq8YXc4qkJDumzuicSB/fb4EjtHNqhPiFcciT/xwNbiv4heLGZEV9JVRA==","signatures":[{"sig":"MEUCIQCjEkeCHgs9RR+FVutZ9CNboWnZVZBA+8ZMqa64IFZXAwIgEFlgSPSPpVd+zDuP/GhPKHhDiADm0/XpeKHy2VEFulk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66539},"main":"src/index.js","gitHead":"8a6061479ed359489fc37946eb2da3e0f16aeef9","scripts":{"dev":"node --watch src/index.js","start":"node src/index.js","index-file":"node scripts/index-file.js","build-index":"node scripts/build-index.js"},"_npmUser":{"name":"charansamanchi","email":"charan.samanchi@sap.com"},"_npmVersion":"11.8.0","description":"MCP server for local OneDrive folder — list, search and read files (txt, md, docx, pdf, xlsx, csv, pptx)","directories":{},"_nodeVersion":"24.13.1","dependencies":{"zod":"^3.23.8","xlsx":"^0.18.5","axios":"^1.7.2","dotenv":"^16.4.5","mammoth":"^1.8.0","vectordb":"^0.4.20","pdf-parse":"^1.1.1","officeparser":"^4.1.2","@modelcontextprotocol/sdk":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-onedrive_1.1.2_1784013949912_0.8420394295373503","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@charansamanchi/mcp-onedrive","version":"1.1.3","description":"Give Joule Work Desktop and Claude Desktop semantic search over your local OneDrive documents — powered by SAP AI Core embeddings and LanceDB.","main":"src/index.js","bin":{"mcp-onedrive":"src/index.js"},"scripts":{"start":"node src/index.js","dev":"node --watch src/index.js","build-index":"node scripts/build-index.js","index-file":"node scripts/index-file.js"},"keywords":["mcp","onedrive","sharepoint","claude","anthropic","filesystem"],"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","axios":"^1.7.2","dotenv":"^16.4.5","mammoth":"^1.8.0","officeparser":"^4.1.2","pdf-parse":"^1.1.1","vectordb":"^0.4.20","xlsx":"^0.18.5","zod":"^3.23.8"},"gitHead":"5805cc54d7498a1dcbf5bcfbb0ea4a5c8101ed29","_id":"@charansamanchi/mcp-onedrive@1.1.3","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-Z1TtymVJG9zyrS+O2nrhbseoPqfMnC2JZMedAs78LMNtANi1/a4/QkgiUh7IxCDHA/jbanDvh/lkfTujKtS+qQ==","shasum":"1e0969197e9de24746d6be6eae24c34eb5f6eacc","tarball":"https://registry.npmjs.org/@charansamanchi/mcp-onedrive/-/mcp-onedrive-1.1.3.tgz","fileCount":20,"unpackedSize":68278,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICswdC95YhtCxqXHJXCEwAYA52EgC0CLGeCugeeb/3EfAiAmQVAQVNasAD3dJGLgiMwB8QTP7p1xjGgdOsSZlU6ocA=="}]},"_npmUser":{"name":"charansamanchi","email":"charan.samanchi@sap.com"},"directories":{},"maintainers":[{"name":"charansamanchi","email":"charan.samanchi@sap.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-onedrive_1.1.3_1784064636915_0.6960980452655232"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-14T06:28:15.158Z","modified":"2026-07-14T21:30:37.146Z","1.0.0":"2026-07-14T06:28:15.411Z","1.1.0":"2026-07-14T06:55:07.448Z","1.1.1":"2026-07-14T07:07:49.480Z","1.1.2":"2026-07-14T07:25:50.055Z","1.1.3":"2026-07-14T21:30:37.053Z"},"license":"MIT","keywords":["mcp","onedrive","sharepoint","claude","anthropic","filesystem"],"description":"Give Joule Work Desktop and Claude Desktop semantic search over your local OneDrive documents — powered by SAP AI Core embeddings and LanceDB.","maintainers":[{"name":"charansamanchi","email":"charan.samanchi@sap.com"}],"readme":"# Local OneDrive Semantic Search\n\nGive Joule Work Desktop and Claude Desktop semantic search over your local OneDrive documents — powered by SAP AI Core embeddings and LanceDB. Ask questions like \"what do my files say about Q4 budget?\" and get answers with source citations across PDFs, Word docs, Excel sheets, PowerPoint files, and more. Uses vector similarity to find content by meaning, not just filename. Incremental indexing with a file watcher keeps the index current automatically. Runs entirely on your machine — your files and index never leave your device.\n\nAsk Claude things like:\n- _\"What do my files say about Q4 budget?\"_\n- _\"Find my architecture diagram for the BTP project\"_\n- _\"Summarise the contract I have with Vendor X\"_\n\n---\n\n## Quick Start — SAP Joule Work Desktop\n\n```bash\n# 1. Install\nnpm install -g @charansamanchi/mcp-onedrive\n\n# 2. Configure — create a .env file with your credentials\n#    (see Configuration section below for all parameters)\n\n# 3. Build your local index (one-time)\nmcp-onedrive build-index\n\n# 4. Start the HTTP server\nmcp-onedrive --http\n#    → listening on http://localhost:7722/mcp\n\n# 5. In Joule Work Desktop → Add Connector\n#    Name: OneDrive\n#    URL:  http://localhost:7722/mcp\n```\n\n> The server runs **locally on your machine** — your files and index never leave your device. Joule connects to `localhost:7722`.\n\n---\n\n## How It Works\n\n```\nINDEXING (one-time + file watcher)\n  OneDrive files\n    │\n    ▼  parse → chunk (~500 tokens, strategy varies by file type)\n    │     pdf/txt → split by paragraph\n    │     docx    → split by heading\n    │     pptx    → split by slide\n    │     xlsx    → batches of 50 rows\n    │\n    ▼  SAP AI Core embeddings (batched 20/call, 150ms delay between batches)\n    │\n    ▼  LanceDB vector store  →  persisted to disk (index/)\n\nQUERY TIME (every semantic_search call)\n  Your question\n    │\n    ▼  SAP AI Core: one embed call for the query text\n    │\n    ▼  LanceDB L2 similarity search  →  top-K matching text chunks\n    │     score = 1 / (1 + L2_distance)  — typical relevant results: 0.50–0.65\n    │     threshold: results below 0.40 are considered low-confidence\n    │\n    ▼  Claude reads the text chunks and answers\n```\n\nDocument embeddings are pre-generated and stored locally. AI Core is called **once per query** to embed the search question — it never re-processes your files at query time.\n\nOAuth tokens for AI Core are cached in memory for their lifetime. Rotating `AICORE_CLIENT_SECRET` requires a process restart to take effect.\n\n---\n\n## Prerequisites\n\n| Requirement | Details |\n|---|---|\n| Node.js | v18 or later |\n| SAP AI Core | Instance with an OpenAI-compatible embeddings deployment |\n| OneDrive | Synced locally to a known absolute folder path |\n\n> **SAP corporate environments:** Microsoft Graph API requires Azure app registration, which SAP IT restricts for most corporate accounts. This server uses the local synced OneDrive folder directly — no Graph API or Azure registration needed.\n\n---\n\n## Installation\n\n### Option A — npm (global install)\n\n```bash\nnpm install -g @charansamanchi/mcp-onedrive\n```\n\n### Option B — clone and run locally\n\n```bash\ngit clone https://github.tools.sap/I355335/mcp-ai-onedrive.git\ncd mcp-ai-onedrive\nnpm install\n```\n\n---\n\n## Configuration\n\nCopy `.env.example` to `.env` and fill in your values:\n\n```bash\ncp .env.example .env\n```\n\n```env\n# ── OneDrive local path ───────────────────────────────────────\nONEDRIVE_ROOT=C:\\Users\\YourName\\OneDrive - Your Org\n# ONEDRIVE_PERSONAL=C:\\Users\\YourName\\OneDrive   # optional second root\n\n# ── File size limits ──────────────────────────────────────────\nMAX_READ_KB=1024\nMAX_INDEX_MB=50\n\n# ── SAP AI Core credentials ───────────────────────────────────\nAICORE_CLIENT_ID=<client-id>\nAICORE_CLIENT_SECRET=<client-secret>\nAICORE_TOKEN_URL=https://<subdomain>.authentication.<region>.hana.ondemand.com/oauth/token\nAICORE_API_URL=https://api.ai.<region>.hana.ondemand.com\nAICORE_RESOURCE_GROUP=default\n\n# If your embedding deployment is in a different resource group, set this.\n# Leave blank to use AICORE_RESOURCE_GROUP above.\nAICORE_EMBEDDING_RESOURCE_GROUP=\n\n# ── Embedding model deployment ────────────────────────────────\nAICORE_EMBEDDING_DEPLOYMENT_ID=<your-deployment-id>\n\n# ── Vector index ──────────────────────────────────────────────\n# Use an ABSOLUTE path — relative paths break when launched via Claude Desktop\nVECTOR_INDEX_PATH=C:\\Users\\YourName\\path-to\\mcp-onedrive\\index\nSEMANTIC_TOP_K=5\n```\n\n### Parameter reference\n\n| Variable | Required | Description |\n|---|---|---|\n| `ONEDRIVE_ROOT` | Yes | Absolute path to your primary OneDrive folder |\n| `ONEDRIVE_PERSONAL` | No | Optional second OneDrive root (e.g. personal alongside work) |\n| `MAX_READ_KB` | No | Max file size for `read_file` tool in KB. Default: `1024`. Files above this must be accessed via `semantic_search` instead. |\n| `MAX_INDEX_MB` | No | Max file size for the indexing pipeline in MB. Default: `50`. Files above this are skipped during `build-index`. |\n| `AICORE_CLIENT_ID` | Yes | SAP AI Core service key client ID |\n| `AICORE_CLIENT_SECRET` | Yes | SAP AI Core service key client secret |\n| `AICORE_TOKEN_URL` | Yes | OAuth token URL from SAP AI Core service key |\n| `AICORE_API_URL` | Yes | SAP AI Core API base URL (no trailing slash) |\n| `AICORE_RESOURCE_GROUP` | Yes | Resource group for your deployments. Default: `default` |\n| `AICORE_EMBEDDING_RESOURCE_GROUP` | No | Resource group for the embedding deployment if different from above. Falls back to `AICORE_RESOURCE_GROUP`. |\n| `AICORE_EMBEDDING_DEPLOYMENT_ID` | Yes | Deployment ID for the embedding model |\n| `VECTOR_INDEX_PATH` | No | Where LanceDB stores the vector index. **Must be an absolute path when used via Claude Desktop.** Default: `./index` |\n| `SEMANTIC_TOP_K` | No | Number of chunks returned per `semantic_search` call. Default: `5` |\n\n> **SAP AI Core embedding endpoint:** The embedding API path requires a `/v1/` prefix — `POST .../deployments/{id}/v1/embeddings`. This differs from SAP AI Core chat models which use `/invoke`. If you see 404 errors on embed calls, check the URL structure.\n\n---\n\n## Build the Index (Required Before First Use)\n\nThis is a **one-time prerequisite**. It walks your OneDrive folder, parses all supported files, generates embeddings via AI Core, and stores them in a local LanceDB database. Subsequent runs are **incremental** — only new or changed files are re-processed.\n\n```bash\n# Global install\nmcp-onedrive build-index\n\n# Scope to a specific folder (global install)\nmcp-onedrive build-index --folder \"C:\\Users\\YourName\\OneDrive\\Projects\"\n\n# Or if running locally\nnpm run build-index\nnode scripts/build-index.js --folder \"C:\\Users\\YourName\\OneDrive\\Projects\"\n```\n\nProgress is shown as files are indexed:\n```\n[indexer] Found 2335 supported files\n[indexer] To index/update: 142\n  [1/142] Annual Report 2024.pdf → 24 chunks\n  [2/142] Budget Q4.xlsx → 8 chunks\n```\n\n**After the initial build**, a file watcher keeps the index current automatically. However:\n- Files **larger than 2 MB** added after the initial build are **not** auto-indexed by the watcher. Re-run `build-index` to include them.\n- Files that fail to parse (encrypted PDFs, malformed xlsx, etc.) are logged to `index/index-failures.json` and skipped. Use `get_index_status` to see failures, or inspect the file directly.\n\n> **Note on large Excel files:** The xlsx parser can hang on very large or malformed `.xlsx` files. The indexer applies a 60-second parse timeout — files that exceed it are recorded in `index-failures.json` and skipped. The build continues without them.\n\n### Supported file types\n\n`.txt` `.md` `.json` `.csv` `.xml` `.yaml` `.yml` `.docx` `.pdf` `.xlsx` `.xls` `.pptx` `.js` `.ts` `.py`\n\n---\n\n## Usage\n\n### Joule Work Desktop (HTTP connector)\n\nStart the server in HTTP mode:\n\n```bash\nONEDRIVE_ROOT=\"C:\\Users\\YourName\\OneDrive - Your Org\" mcp-onedrive --http\n# listening on http://127.0.0.1:7722/mcp\n```\n\nIn Joule Work Desktop → **Add Connector**:\n- **Name:** OneDrive\n- **URL:** `http://127.0.0.1:7722/mcp`\n\nThen ask Joule to run `semantic_search` or `search_files` to find content in your OneDrive.\n\n### Claude Desktop (stdio)\n\nAdd to `claude_desktop_config.json` — see full config in the Claude Desktop Setup section below.\n\n```bash\n# Server is spawned automatically by Claude Desktop — no manual start needed\nnode src/index.js\n```\n\n### CLI / stdio\n\n```bash\nnode src/index.js\n```\n\n---\n\n## Claude Desktop Setup (stdio)\n\nAdd this to your Claude Desktop `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"onedrive\": {\n      \"command\": \"node\",\n      \"args\": [\n        \"--max-old-space-size=512\",\n        \"C:/Users/YourName/path-to/mcp-onedrive/src/index.js\"\n      ],\n      \"env\": {\n        \"NODE_NO_WARNINGS\": \"1\",\n        \"ONEDRIVE_ROOT\": \"C:\\\\Users\\\\YourName\\\\OneDrive - Your Org\",\n        \"AICORE_CLIENT_ID\": \"<client-id>\",\n        \"AICORE_CLIENT_SECRET\": \"<client-secret>\",\n        \"AICORE_TOKEN_URL\": \"https://<subdomain>.authentication.<region>.hana.ondemand.com/oauth/token\",\n        \"AICORE_API_URL\": \"https://api.ai.<region>.hana.ondemand.com\",\n        \"AICORE_RESOURCE_GROUP\": \"default\",\n        \"AICORE_EMBEDDING_DEPLOYMENT_ID\": \"<your-deployment-id>\",\n        \"VECTOR_INDEX_PATH\": \"C:\\\\Users\\\\YourName\\\\path-to\\\\mcp-onedrive\\\\index\"\n      }\n    }\n  }\n}\n```\n\n**Important notes on the config:**\n\n- `--max-old-space-size=512` — limits Node.js heap to 512 MB. Without this, the file watcher can queue a large number of debounce timers at startup, grow the heap to several GB, and crash. Claude Desktop shows \"Server disconnected\" with no other indication.\n- `NODE_NO_WARNINGS=1` — suppresses Node.js deprecation warnings to stderr/stdout. The `pdf-parse` library emits a warning on `require()` that would be written to stdout, corrupting the MCP JSON-RPC stream and causing `Unexpected token 'W'...` errors on every tool call.\n- `VECTOR_INDEX_PATH` — must be an **absolute path**. Claude Desktop spawns the MCP server with a working directory under its own AppData folder, so a relative `./index` would resolve to the wrong location and the server would start with an empty index on every restart.\n\n**After saving the config:** fully quit Claude Desktop via the **system tray → Quit** (not just closing the window — the process stays running in the tray otherwise), then reopen it.\n\n> **Note:** You can use either a `.env` file (for local/dev use) or the `env` block in `claude_desktop_config.json`. The config block takes precedence. `VECTOR_INDEX_PATH` in `.env` can remain as `./index` for local CLI use — only the config block needs the absolute path.\n\n---\n\n## Joule Work Desktop Setup (HTTP)\n\nStart the server in HTTP mode:\n\n```bash\nnode src/index.js --http\n# listening on http://127.0.0.1:7722/mcp\n```\n\nOr with a custom port via environment variable:\n\n```bash\nMCP_PORT=7722 node src/index.js --http\n```\n\nThen in **Joule Work Desktop → Add Connector**:\n- **Name:** OneDrive\n- **URL:** `http://127.0.0.1:7722/mcp`\n\n> The server must be running before Joule can connect. The stdio mode (Claude Desktop) and HTTP mode (Joule) can both run simultaneously on the same machine — they are independent processes.\n\n---\n\n## Available MCP Tools\n\n| Tool | Description |\n|---|---|\n| `semantic_search` | Search files by meaning using vector similarity. Returns top-K chunks with file path, score, and excerpt. |\n| `search_files` | Search for files and folders by name keyword. Returns file path, size, and modified date. |\n| `read_file` | Read the full contents of a specific file. Limited by `MAX_READ_KB` — if a file exceeds the limit, use `semantic_search` instead (the file is still indexed and searchable). |\n| `list_files` | List files in a folder |\n| `get_file_info` | Get metadata (size, dates, type) for a file |\n| `get_index_status` | Check index coverage and list any files that failed to index |\n| `list_drives` | List configured OneDrive roots |\n\n---\n\n## Embedding Deployments (SAP AI Core)\n\n| Model | Dimensions | Use |\n|---|---|---|\n| `text-embedding-3-small` | 1536 | Default — faster, recommended for indexing |\n| `text-embedding-3-large` | 3072 | Higher accuracy — swap deployment ID if needed |\n\nDeploy these via SAP AI Core under your resource group and set the deployment ID in your config.\n\nEmbeddings are generated in **batches of 20** with a **150 ms delay** between batches to stay within AI Core rate limits. Large initial builds with thousands of files will take proportionally longer.\n\n---\n\n## Troubleshooting\n\n### Server not responding / \"Server disconnected\" in Claude Desktop\n\nCheck the MCP server log:\n```\n%APPDATA%\\Claude\\logs\\mcp-server-onedrive.log\n```\nThis file captures all stderr output from the MCP server process and is the first place to look for errors.\n\n### Search returns no results or very low scores\n\n- Semantic search scores use the formula `1 / (1 + L2_distance)`. Typical relevant results score between `0.50–0.65`. Results below `0.40` are considered low-confidence.\n- If all results score below `0.40`, Claude will fall back to `search_files` (filename search).\n- If the index is empty or outdated, run `build-index` again (it only re-processes changed files).\n\n### `read_file` says file is too large\n\nThe file is still fully indexed and searchable. Use `semantic_search` with a specific question about the file's content instead of trying to read it directly.\n\n### Files added after initial build are not found by semantic search\n\nFiles larger than 2 MB are not auto-indexed by the file watcher. Re-run `build-index` to include them:\n```bash\nnpm run build-index\n```\n\n### build-index hangs or freezes\n\nA malformed or very large Excel file may be causing the indexer to hang. The indexer applies a 60-second timeout per file — if a file exceeds it, the build should eventually skip it and continue. Check `index/index-failures.json` after the build for skipped files.\n\n### \"Access is denied\" or LanceDB write conflict errors\n\nThe file watcher and a tool call tried to write to LanceDB at the same time. From v1.1.2 onward the watcher automatically pauses during active tool calls. If you see this on an older version, upgrade:\n```bash\nnpm install -g @charansamanchi/mcp-onedrive@latest\n```\n\n---\n\n## Changelog\n\n### v1.1.2\n- Fixed LanceDB write conflict — watcher now pauses during active tool calls (`getActiveTools` lock)\n- Fixed `mcp-onedrive build-index` subcommand for global npm installs\n\n### v1.1.1\n- Fixed `mcp-onedrive build-index` subcommand routing in `src/index.js`\n\n### v1.1.0\n- Added `--http` mode for Joule Work Desktop (`StreamableHTTPServerTransport`, default port `7722`)\n- Updated `semantic_search` and `search_files` tool descriptions with fallback-to-online-docs guidance\n- Added `MCP_PORT` env var for configurable HTTP port\n\n### v1.0.0\n- Initial release — stdio MCP server with semantic search, file search, read, list, and index tools\n\n---\n\n## Extending the Server\n\n> The MCP server communicates over **stdio** (stdin/stdout). stdout is the JSON-RPC wire channel between the server and Claude Desktop. Any text written to stdout (e.g. `console.log()`) will corrupt the protocol stream. Always use `process.stderr.write()` for logging.\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}