home / mcp / onedrive mcp server

OneDrive MCP Server

This read-only MCP Server allows you to connect to Microsoft OneDrive data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out our MCP Server for Microsoft OneDrive (https://www.cdata.com/drivers/onedrive/download/mcp).

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cdatasoftware-microsoft-onedrive-mcp-server-by-cdata": {
      "command": "java",
      "args": [
        "-jar",
        "/PATH/TO/CDataMCP-jar-with-dependencies.jar",
        "/PATH/TO/microsoft-onedrive.prp"
      ]
    }
  }
}

You can query live Microsoft OneDrive data through a read-only MCP server that wraps the CData JDBC Driver. This server exposes OneDrive data via a simple MCP interface so you can ask natural language questions and get up-to-date results without writing SQL, making it easier for language models and clients to fetch live data.

How to use

You connect your MCP client (such as Claude Desktop or another compatible AI client) to the OneDrive MCP server you run locally. Start the server, then load it into your client configuration as an MCP server. Once connected, you can ask questions like “What are the most recent documents in my Drive?” or “Show me files larger than 10 MB in the last 30 days.” The server presents data using predefined tools that enumerate tables and columns, and can execute read-only queries against your OneDrive data managed through the CData JDBC Driver.

How to install

Prerequisites: you need Java and Maven installed on your machine to build and run the MCP server.

1) Clone the project and enter the directory.

git clone https://github.com/cdatasoftware/microsoft-onedrive-mcp-server-by-cdata.git
cd microsoft-onedrive-mcp-server-by-cdata

2) Build the MCP server JAR with dependencies.

mvn clean install

3) Install and license the CData JDBC Driver for Microsoft OneDrive. Follow these steps to obtain the driver and license it.

# Download the driver from the CData site and install it following their instructions.
# After installation, license the driver:
# Windows example
# Run from the lib directory in the installation:
# java -jar cdata.jdbc.onedrive.jar --license
# Enter your name, email, and TRIAL (or your license key).

4) Configure your connection to OneDrive and create a .prp file.

# Use the driver to generate a connection string
java -jar cdata.jdbc.onedrive.jar
# Test the connection in the utility, then copy the connection string.
# Create microsoft-onedrive.prp with your settings, using the example format:
Prefix=onedrive
ServerName=CDataOneDrive
ServerVersion=1.0
DriverPath=PATH/TO/cdata.jdbc.onedrive.jar
DriverClass=cdata.jdbc.onedrive.OneDriveDriver
JdbcUrl=jdbc:onedrive:InitiateOAuth=GETANDREFRESH;
Tables=

5) Run the MCP server using the prepared .prp file.

java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/microsoft-onedrive.prp

Additional notes

The server runs in stdio mode, meaning it communicates with clients on the same machine. You can stop the server by terminating the Java process. When you run the server, your MCP client can access the OneDrive data through built-in tools that list tables, list columns, and run read-only queries.

Troubleshooting

If you have trouble seeing or using the MCP server in your client, fully quit the client and restart it so the server appears. Verify that your connection string is correct and that the .prp file includes the correct DriverPath and JdbcUrl. If you cannot connect to OneDrive, re-run the connection string utility and test again. For further help, contact CData Support or join the CData Community.

License

This MCP server is released under the MIT License. You may use, modify, and distribute it in accordance with the MIT License terms.

Available tools

onedrive_get_tables

Retrieves a list of tables available in the OneDrive data source. The output is provided in CSV with the first line containing column headers.

onedrive_get_columns

Retrieves a list of columns for a specified table. The output is provided in CSV with the first line containing column headers.

onedrive_run_query

Executes a SQL SELECT query against the OneDrive data source via the MCP server.