
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
@mindstone/mcp-server-microsoft-shared
Advanced tools
Shared Microsoft Graph client, token persistence, logging, and types for @mindstone/mcp-server-microsoft-* connectors
Shared Microsoft Graph client, token persistence, structured logger, timezone
mapping, and types used by the @mindstone/mcp-server-microsoft-* connector
family (Mail, Calendar, Files, Teams, SharePoint).
This package exposes no MCP tools and ships no bin. It is consumed only by
its sibling Microsoft connector packages as a pinned dependencies entry.
npm install @mindstone/mcp-server-microsoft-shared@0.1.0
TokenProvider — per-account token persistence (atomic write, cross-process
refresh-race protection, host-injected refresh-disable gate).MicrosoftRefreshDisabledError — thrown by TokenProvider.getAccessToken
when the access token is expired and the host has set MICROSOFT_DISABLE_REFRESH=1.createGraphClient, createGraphClientWithRetry, listMicrosoftAccounts,
getTokenProvider, checkGraphConnection — Microsoft Graph client factory.createLogger — structured stderr logger.windowsToIanaTimezone — Windows timezone name → IANA identifier mapping../types.js: MicrosoftAccount, AccountsConfig,
ToolResult, successResult, errorResult, formatGraphError,
formatAuthRequiredError, detectAuthRequiredReason, hasScope,
SHAREPOINT_REQUIRED_SCOPE, and Graph response shapes for email, calendar,
drive, chats, mail folders, calendars, and SharePoint resources.TokenProvider is constructed with a config directory and OAuth client ID.
Token storage layout (host-owned, consumed by every Microsoft connector):
<configDir>/
accounts.json
credentials/
<sanitised-email>.token.json
Filenames sanitise email addresses via email.replace(/[^a-zA-Z0-9]/g, '-')
(unchanged from the bundled predecessor).
Host-injected environment variables interpreted by this library:
| Variable | Effect |
|---|---|
MICROSOFT_DISABLE_REFRESH | When set to "1", TokenProvider.getAccessToken throws MicrosoftRefreshDisabledError rather than calling Microsoft's token endpoint. The host owns refresh-token rotation in this mode. |
MICROSOFT_DISABLE_REFRESH is intentionally not a user-facing setup variable.
0o600 files, 0o700 directories), fsync, symlink rejection, and a stale
temp-file sweep on initialisation.MicrosoftRefreshDisabledError which callers translate into the host-neutral
auth_required envelope.This package is a strict 1:1 OSS port of an in-process Microsoft Graph helper library, with cohort hygiene fixes (atomic credential writes, host-injected refresh-disable gate, internal-reference scrub).
FAQs

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.