by @microsoft
Official Microsoft Files MCP Server implementation for OneDrive local testing and community contribution. HTTP server using delegated authentication to access your environment via Microsoft Graph API. Provides 6 core tools: list_items (list files/folders in OneDrive), get_item (get file/folder details by ID/path), search (search OneDrive content), download (download file content), upload (upload files to OneDrive), create_folder (create new folders). Uses Microsoft Graph API with delegated scopes Files.ReadWrite.All (full file access) and Sites.Read.All (read SharePoint sites). Built with TypeScript, Node.js. HTTP server runs on localhost:3001/mcp. Requires Microsoft Entra ID app registration with TENANT_ID and CLIENT_ID environment variables. Installation: clone repository locally, add to MCP client using npx command with absolute local path, configure server with HTTP transport type, set URL to http://localhost:3001/mcp. Local development: create .env file with ODMCP_TENANT_ID and ODMCP_CLIENT_ID, hit F5 to start server, test with Inspector or LLM client. Visual Studio Code Insiders supports protected resource flow for delegated authentication. WARNING: For developer environment ONLY - NOT FOR PRODUCTION. Follow Microsoft identity platform security guidance. Testing purposes only. GitHub: 88 stars, 13 forks, 42 commits, 3 open issues, 4 open PRs. MIT license. TypeScript 100%. Example queries: "List all files in my OneDrive", "Search for documents related to project X", "Upload this file to my OneDrive", "Create a new folder named Reports", "Download the latest presentation". Supports any MCP client that implements Model Context Protocol. Configuration example: {"mcp": {"servers": {"files-localhost-debug": {"type": "http", "url": "http://localhost:3001/mcp"}}}}. Authentication: delegated authentication flow with Microsoft Entra ID, requires user consent for Graph API scopes. Use cases: local OneDrive file management, testing MCP integrations, development workflows, file search and retrieval, automated file operations. Community contribution welcome via GitHub. Microsoft open source project with Code of Conduct, Contributing guidelines, Security policy, Support documentation. Requires local clone (not published to NPM yet). Development testing: F5 to start server, Inspector for MCP testing, integrates with LLM clients supporting MCP protocol.
This server provides the following tools for AI assistants:
List files and folders in OneDrive or a specific folder by ID/path
Get detailed information about a file or folder by ID or path (metadata, size, modified date)
Search for files and folders in OneDrive by query string (content, filename, metadata)
Download file content from OneDrive by file ID or path
Upload files to OneDrive to a specific folder or root directory
Create a new folder in OneDrive at a specific location