Get the FREE Ultimate OpenClaw Setup Guide →

files

A OneDrive MCP server implementation for local testing and community contribution

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio microsoft-files-mcp-server npx -y /path/to/files-mcp-server \
  --env ODMCP_CLIENT_ID="Client ID for authentication" \
  --env ODMCP_TENANT_ID="Tenant ID for authentication"

How to use

This MCP server provides a local testing endpoint for clients implementing the Model Context Protocol (MCP). It acts as an HTTP server with delegated authentication, enabling you to simulate access to your environment using the Files.ReadWrite.All and Sites.Read.All delegated Graph scopes. The server is intended for development and testing, allowing clients to request MCP context and interact with resources as if they were in a real Microsoft Graph-backed environment. To use it, configure your MCP client to point at the server and ensure the required environment variables for authentication are set, then start the server and begin issuing MCP requests through the client.

The server exposes an MCP endpoint (as described in the README) and relies on the delegated authentication flow to obtain access to resources in your tenant. You can test the delegated authentication flow using the provided inspector tool or your own MCP client, and you should see responses that reflect the Files and Sites scopes granted for testing. The setup is designed for local development, not production, and you should only run it in a developer environment as noted in the documentation.

How to install

Prerequisites:

  • Node.js installed (for using npx to run the local MCP server)
  • Access to the repository containing this MCP server (locally or via path)

Install and run locally:

  1. Clone the repository locally (or reference the local path to the MCP server):
    • If cloning: git clone <repository-url> && cd files-mcp-server
    • If using a local path: keep the path ready for the npx command shown in the mcp_config
  2. Install dependencies if required by the server package.json (navigate to the server directory and run):
    npm install
    
  3. Start the server (using the local path as in the mcp_config example):
    npx -y /path/to/files-mcp-server
    
  4. Set up environment variables for development:
    ODMCP_TENANT_ID="{TENANT_ID}"
    ODMCP_CLIENT_ID="{CLIENT_ID}"
    
  5. In your MCP client, register the server as shown in the README example, pointing to the local URL (for example http://localhost:3001/mcp) and use the provided config to enable the server.

Additional notes

Tips and common considerations:

  • Make sure the required Graph scopes (Files.ReadWrite.All and Sites.Read.All) are consented in your tenant for testing.
  • Use a local .env file to provide ODMCP_TENANT_ID and ODMCP_CLIENT_ID during development, as described in the README.
  • The example mcp_config uses a local path; replace /path/to/files-mcp-server with the actual absolute path to your local server when running with npx.
  • The server is explicitly for development use; do not deploy to production without proper hardening and security reviews.
  • If you encounter authentication flow issues, the Visual Studio Code Insiders build mentioned in the README may assist with testing the protected resource flow.
  • If you modify the server, ensure the MCP client configuration points to the correct URL (e.g., http://localhost:3001/mcp) and that the environment variables are loaded at runtime.

Related MCP Servers

Sponsor this space

Reach thousands of developers