Guide
Connect OneDrive to Hermes Agent or OpenClaw with Composio
Find the latest proposal, inspect who can access it, and prepare a reviewed upload or sharing change without letting an ambiguous filename overwrite the wrong Microsoft 365 file.
A useful first job: locate the right client file
A client asks for “the latest proposal,” but OneDrive contains a personal copy, a team copy, and an older shared link. The useful agent workflow is to search, show metadata and locations, and let you choose one item. Only after that should it download, update, or share anything.
Connect the managed integration
The connection steps are identical for hosted Hermes Agent and OpenClaw. Both frameworks receive tools through the same managed Composio bridge.
- Open Dashboard → Integrations and search for OneDrive.
- Select that exact card and click Connect. The verified Composio toolkit slug is
one_drive. - Complete Microsoft OAuth with the personal or work account that owns or can access the files.
- After Connected appears, ask the agent to identify the user and available drives without modifying files.
Composio lists both OAuth2 and service-to-service OAuth2 in its OneDrive toolkit reference. The managed dashboard flow uses the authentication offered by its connection screen. Microsoft explains that Graph represents a storage container as a Drive and a file or folder as a DriveItem in its file API overview.
Read first with verified actions
composio connections
composio search one_drive list drives
composio search one_drive search items
composio search one_drive item metadataONE_DRIVE_GET_USERidentifies the connected Microsoft user.ONE_DRIVE_LIST_DRIVESdiscovers available drives.ONE_DRIVE_SEARCH_DRIVE_ITEMSsearches files and folders.ONE_DRIVE_GET_ITEMreads metadata for a selected item.ONE_DRIVE_LIST_FOLDER_CHILDRENenumerates a known folder.ONE_DRIVE_GET_ITEM_PERMISSIONSinspects current access before sharing changes.
Action schemas can change across toolkit versions. Have the agent retrieve the current schema and preserve returned drive IDs and item IDs rather than guessing paths or parameters.
Use my connected OneDrive account. Identify the connected user and list available drives. Search for files whose names contain “Q3 proposal.” Show each file’s name, drive, path, modified time, size, and item ID. Do not download, upload, move, share, update, or delete anything.
After selecting one result, continue:
Inspect that item’s metadata and current permissions. Then show a plan to download it and create a reviewed copy in the Drafts folder. Stop before writing or changing permissions.
Choose file operations deliberately
The toolkit exposes ONE_DRIVE_DOWNLOAD_FILE, ONE_DRIVE_ONEDRIVE_UPLOAD_FILE, ONE_DRIVE_UPDATE_FILE_CONTENT, ONE_DRIVE_MOVE_ITEM, and ONE_DRIVE_CREATE_LINK. These have different consequences. Uploading a new file is usually safer than updating an existing item; creating a sharing link changes who may access content; moving an item can break a colleague's expected path.
Ask for a preview containing the source item ID, destination drive and folder, proposed filename, conflict behavior, and intended audience. After the operation, have the agent return the new item ID and read its metadata once. For shared links, review the permission type and role, then inspect permissions after creation.
Understand shared and team files
Microsoft Graph can address a user's default OneDrive, group drives, SharePoint document libraries, and items reached through sharing URLs. A shared folder can appear as a remote item whose underlying file belongs to another drive. Microsoft's shared-item reference documents resolving a DriveItem from a sharing URL.
If a normal download returns 404 for a file that opens in the browser, use ONE_DRIVE_GET_DRIVE_ITEM_BY_SHARING_URL or another verified shared-item action, then use the returned identity. Composio's OneDrive troubleshooting guide specifically calls out shared-file 404s and recommends current toolkit versions when folder behavior looks stale.
Troubleshooting OneDrive
- The expected drive is absent: verify the Microsoft tenant and account used for OAuth. Personal OneDrive, work OneDrive, group drives, and SharePoint sites are separate containers.
- A shared file returns 404: resolve its sharing URL or share ID first; do not assume it is in the default drive.
- Folder contents look stale: refresh tool discovery and use the latest toolkit version rather than retrying a pinned older action.
- An upload fails: inspect the current upload action schema and its accepted file input. Composio documents FileUploadable or shared-storage/data-URI inputs where supported.
- Access denied: confirm the connected account can open the item in Microsoft 365 and that the selected action's Graph scopes cover the operation.
- The wrong duplicate was selected: search again and compare drive, path, modified time, size, and item ID before any write.
- A sharing change is too broad: inspect existing permissions and delete or replace only the permission you deliberately created.
Self-hosted setup for Hermes Agent and OpenClaw
For an installation you run yourself, create a server in your own Composio project, select this app and the tools you need, and connect the intended account. Copy the complete generated MCP URL for that user. The examples below use Composio Platform MCP and a Composio project API key in x-api-key. An app password or provider API key belongs in the app connection flow, not in this header.
Set COMPOSIO_API_KEY in the environment of the agent process and replace the URL placeholder below. Merge the entry into your existing configuration. Keep your project key out of chat and source control. A connection on OpenClaw Launch does not automatically transfer to your own Composio project; Composio connections are scoped to their project and user.
Hermes Agent
Add the server under mcp_servers in ~/.hermes/config.yaml. You can set the environment variable in ~/.hermes/.env.
mcp_servers:
composio:
url: "YOUR_GENERATED_PLATFORM_MCP_URL"
headers:
x-api-key: "${COMPOSIO_API_KEY}"
connect_timeout: 60
timeout: 180Run hermes mcp test composio to check discovery, then start a new session or use /reload-mcp in the Hermes CLI. See the Hermes MCP configuration reference for reload behavior and tool filters.
OpenClaw
Use a release with the native openclaw mcp commands. Its server definitions belong under mcp.servers in ~/.openclaw/openclaw.json:
{
"mcp": {
"servers": {
"composio": {
"url": "YOUR_GENERATED_PLATFORM_MCP_URL",
"transport": "streamable-http",
"headers": {
"x-api-key": "${COMPOSIO_API_KEY}"
}
}
}
}
}Ensure the Gateway service receives the environment variable, restarting that service after changing its environment. Run openclaw mcp doctor composio --probe and begin a new agent session. If your version lacks these commands, update before using this config. The native registry is separate from mcporter. See OpenClaw's MCP reference and HTTP transport fields.
Discovery confirms the MCP connection. Finish with this guide's first read request to check access to the actual app. The hosted composio shell commands earlier in this guide are supplied by OpenClaw Launch; a standalone MCP setup exposes tools through the agent's MCP client instead.
Frequently asked questions
Does OneDrive through Composio work with Hermes Agent?
Yes. Managed Hermes Agent and OpenClaw instances connect OneDrive through the same Integrations page and use the same Microsoft-backed toolkit.
Does OneDrive include SharePoint files?
The toolkit contains OneDrive, group drive, and SharePoint site and list actions. Access still depends on the connected Microsoft account and the specific drive or site being addressed.
Can the agent share a file publicly?
The toolkit can create sharing links and permissions, but sharing changes access. Ask it to display the item, audience, link type, and role first, then approve the exact write.
Why does downloading a shared file return 404?
A shared item may belong to another drive. Resolve it with its sharing URL or shared-item action, then use the returned drive and item identity instead of assuming it belongs to the connected user’s default drive.