Connect Microsoft 365, read as each person
- graal Agentic Platform
- Version 0.30 (actuelle)
- Open source · Apache 2.0
- Source : graalsystems/tranibor-agents@983db67
For an organisation administrator. Procedure connector.mcp.microsoft-365, version 2, reviewed 2026-11-26 against the vendor’s own pages. It applies to the connector type mcp/microsoft-365.
It ships with the plugin microsoft-365 0.1.6: its source. In the console, once the plugin is installed, it opens with How to set this up on the connector of the plugin’s server, and on Library › Plugins.
Addresses are written <api_url>, <public_url> and <org> here: the console shows the same text with your deployment’s own.
Before you start
Section intitulée « Before you start »- A Microsoft Entra tenant where you can register an application, and someone who can grant tenant-wide admin consent (a Privileged Role Administrator, Cloud Application Administrator or Application Administrator).
- The
microsoft-365plugin installed in your organisation (Catalogue, Plugins). Its server runs in the platform; there is nothing to host. A plugin that brings a server needs a second person’s approval. - A platform administrator of this Tranibor deployment: the application’s client secret is read from the
deployment’s environment (
env:), which only they write. - Decide the stage. Stage 2 reads the calendar only (
list_events_with). Stage 3 adds the mail and Teams chats a person shares with another (search_mail_with,search_chats_with). Start with stage 2; moving to stage 3 is a new consent, by the tenant and then by each person. - This procedure is written from Microsoft’s documentation and the plugin’s fake tenant; it has not yet been run end to end against a live tenant.
At Microsoft Entra
Section intitulée « At Microsoft Entra »- Register the application. Entra admin center, Identity, Applications, App registrations, New
registration: name
tranibor-microsoft-365(an application registered from an earlier version of this page aschoregos-microsoft-365keeps its name: the name is only a label, nothing reads it), supported account types Accounts in this organizational directory only (single tenant). Redirect URI: platform Web,<api_url>/api/v1/me/connected-accounts/callback. Register. - Copy two ids from its Overview: the Application (client) ID and the Directory (tenant) ID.
- Remove what Entra adds by default. API permissions: remove
User.Read. The server never reads a profile; the platform asks Graph for the scopes below only. - Add the stage’s delegated permissions. API permissions, Add a permission, Microsoft Graph,
Delegated permissions:
offline_accessandCalendars.Read(stage 2); addMail.ReadandChat.Readfor stage 3. Never an application permission: the server reads only as a person. - Grant admin consent for the tenant (Grant admin consent for <tenant>), so that each person is not asked to consent on their own. Every permission shows Granted.
- A client secret. Certificates & secrets, New client secret, an expiry your policy allows (note the date: Tranibor cannot read Graph for anyone once it expires). Copy its Value once and hand it to the platform administrator through your secret manager, never by mail or chat.
- Authentication. Leave implicit grant off (no access tokens, no ID tokens) and Allow public client flows off.
- Check it automatically. With the Azure CLI, export the application as Entra holds it and run the
plugin’s check for your stage, from the plugin’s
server/directory:az ad app show --id <client id> > app.json, thenuv run python -m tranibor_microsoft_365.entra --stage 2 app.json. It printsok, or each permission, redirect URI or setting that breaks the stage’s rules. The plugin’sserver/entra/stage-2.jsonandstage-3.jsonare the reference applications.
Permissions
Section intitulée « Permissions »- Delegated only: Tranibor reads Microsoft 365 as the person who asks, never with an identity of its own, so Microsoft 365 decides what that person may read. A call without the person’s connected account is refused before anything reaches Graph.
- Stage 2:
Calendars.Read(their calendar) andoffline_access(a refresh token, sealed in the person’s own space in Tranibor). Stage 3 addsMail.Read(their mailbox) andChat.Read(their Teams chats). - Nothing is written to Microsoft 365. The server stores nothing; it returns at most 20 items, 300-character snippets, never a full body nor an attachment, and only mail and chats the other person takes part in.
- The client secret stays with the platform, which redeems each person’s code and refreshes their token; the server never receives it.
In Tranibor
Section intitulée « In Tranibor »-
The client secret (platform administrator). Put the secret’s value in the API’s environment as
CONNECTOR_MICROSOFT_365_CLIENT_SECRET(from your secret manager, as for anyenv:reference of the deployment), and allowlogin.microsoftonline.comandgraph.microsoft.comin the organisation’s network bounds. -
Declare the consent on the connector. The plugin’s install created the connector
microsoft-365. Set its configuration (Connectors,microsoft-365, orPATCH <api_url>/api/v1/orgs/<org>/connectors/microsoft-365with aconfigbody) to:identity_modes: [user_consent]user_consent:authorization_endpoint: https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/authorizetoken_endpoint: https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/tokenclient_id: <client id>client_secret_ref: env:CONNECTOR_MICROSOFT_365_CLIENT_SECRETscopes: [offline_access, Calendars.Read] # stage 3: add Mail.Read and Chat.ReadThe server’s schema refuses another mode, a multi-tenant endpoint (
common,organizations) and any other scope. Microsoft offers no revocation endpoint for these tokens: leave none. -
Bind it. An assistant that needs Microsoft 365 binds its need to this connector with the
user_consentidentity (the installation’s bindings). Its tools are<need>__list_events_with, and at stage 3<need>__search_mail_withand<need>__search_chats_with. -
Each person connects their account once, at
<public_url>/me/connected-accounts: Connect next tomicrosoft-365, then Microsoft’s sign-in. Until they do, a tool answersaccount_not_connectedwith that page’s address, and the assistant goes on without the source.
- As a person who connected their account, ask an assistant bound to the connector for your meetings of
the next 24 hours: it calls
list_events_withwithwithin_hours: 24and lists them, each with itsas_of. - Ask for your one-to-one meetings with a colleague:
one_to_one_onlyleaves out a meeting of three. - Stage 3: ask for your recent mail with that colleague. Only threads they sent or received come back, each with a snippet, never a body nor an attachment.
- Disconnect your account at
<public_url>/me/connected-accounts: the next call answersaccount_not_connectedand nothing reaches Microsoft.
When it fails
Section intitulée « When it fails »account_not_connected: the person has not connected their account, or disconnected it, or the connector’s consent settings changed since they connected (Tranibor then asks them to connect again).identity_unavailable: no person’s token came with the call (the need is not bounduser_consent), or Microsoft refused it: expired, revoked, or the client secret expired. Renew the secret, then each person connects again.forbidden: the tenant has not consented to the permission the tool needs (search_mail_withat stage 2, for instance), or a Conditional Access policy refuses the platform. Grant the stage’s consent again; check the sign-in logs of the application.- AADSTS50011 at sign-in: the redirect URI is not exactly
<api_url>/api/v1/me/connected-accounts/callback. - AADSTS65001 at sign-in: admin consent was not granted, or a scope asked is not on the application.
rate_limited: Microsoft throttled the calls; the message says when to retry.- To cut every access of a person at once, beyond disconnecting their account: revoke their sessions in
Entra (
revokeSignInSessions), which invalidates the refresh token Tranibor holds.
| Field | What to put in it |
|---|---|
identity_modes |
[user_consent]: each person connects their own account; the server has no identity of its own |
user_consent |
the tenant’s authorize and token endpoints, the application’s client id, the client secret’s reference, the scopes of the stage |
Network egress
Section intitulée « Network egress »Hosts the platform must be allowed to reach:
graph.microsoft.comlogin.microsoftonline.com