connect_m365_account
Connect your Microsoft 365 account. Call once to get a login code, then call again after you've authenticated at microsoft.com/devicelogin to confirm the connection.
This record as markdown: /tools/com-local-mcp-local-mcp/connect-m365-account.md
What connect_m365_account does on Local
AI agents use connect_m365_account to create or update resources in Local, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Local environment.
Why connect_m365_account is rated Medium
This tool creates and stores a new connection to M365 services, which is a reversible configuration change. While it doesn't directly read/write user data, it modifies the system state by establishing authenticated access. It's Write rather than Execute because the primary effect is storing credentials/connection state rather than triggering external operations.
From the tool's definition Tool description states 'Connect your Microsoft 365 account' and requires authentication flow via microsoft.com/devicelogin, indicating it establishes a credential/connection by storing authentication tokens.
Attacks that exploit this kind of access
The rule that runs connect_m365_account safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Local, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For connect_m365_account, this is the rule to start with:
connect_m365_account stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Local, apply this rule, and every connect_m365_account call is checked against it from then on.
Questions about connect_m365_account
Connect your Microsoft 365 account. Call once to get a login code, then call again after you've authenticated at microsoft.com/devicelogin to confirm the connection. It is categorised as a Write tool in the Local MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
Register the Local MCP server in PolicyLayer and add a rule for connect_m365_account: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Local. Nothing to install.
connect_m365_account is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the connect_m365_account rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for connect_m365_account. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
connect_m365_account is provided by the Local MCP server (local-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Local, and thousands of servers like it.
This server
Across the catalogue