msloop-mcp

msloop-mcp

MCP server that provides read access to Microsoft Loop workspaces and pages by reusing your Loop web session, enabling listing, reading, and searching across Loop content without app registration.

Category
访问服务器

README

msloop-mcp

npm version npm downloads node license

MCP server for Microsoft Loop. No app registration required.

Give any MCP client (Claude, Cursor, Devin, ...) read access to your Microsoft Loop workspaces and pages. It works by reusing your existing Loop web session, the same way msteams-mcp and msoutlook-mcp reuse the Teams and Outlook web sessions: you sign in once in a browser, then tokens are cached and refreshed automatically.

Why

Microsoft does not publish a public API for Loop. This server reuses the Loop web app's own first party client ID, so your access is exactly what your account already has, with no Azure app registration, no admin consent, and no client secrets. Nothing leaves your own machine.

What it can and cannot do

Loop is built differently from Teams or Outlook. Pages are not REST resources, they are Fluid Framework documents stored in SharePoint Embedded containers, and there is no public content-write API. So this server is a read and discovery tool, not a read-write one:

  • Supported: list workspaces, list pages in a workspace, read a page's content as Markdown (or raw HTML), search across your Loop files, and an experimental workspace creation.
  • Not supported: creating or editing page content, real time collaboration. These need the in browser Fluid runtime and have no HTTP API.

Page content is read by asking SharePoint to render the Fluid document to HTML on demand (the ?format=html export), which is then converted to Markdown. Rich, interactive components (tables, voting, mentions) may render approximately.

How it works

The Loop web app (loop.cloud.microsoft) uses MSAL to store OAuth tokens in the browser. This server:

  1. Opens a browser to loop.cloud.microsoft via Playwright.
  2. Extracts the MSAL tokens from local and session storage, using Loop's own first party client ID (a187e399-0c36-4b98-8f04-1edc167a0996). It keeps three: a Substrate token (workspace and page metadata), a SharePoint token (page content), and a Graph token (search).
  3. Caches the access tokens, refresh token, and session state in ~/.msloop-mcp-server/ (AES-256-GCM encrypted).
  4. Refreshes tokens automatically using the refresh token (HTTP, no browser) or a headless browser as fallback.

Quick start

{
  "mcpServers": {
    "loop": {
      "command": "npx",
      "args": ["-y", "msloop-mcp@latest"]
    }
  }
}

Then run loop_login from your MCP client. On first use a browser opens so you can sign in; after that, logins are silent and no browser appears. Do not close the window manually, it closes itself once you are signed in.

Tools

Auth

Tool Description
loop_login Sign in to Loop (silent if possible, browser only when needed)
loop_status Check authentication status and token validity
loop_logout Clear the saved session and tokens

Workspaces and pages

Tool Description
loop_list_workspaces List all Loop workspaces you can access, including your personal "My workspace"
loop_list_pages List the pages in a workspace (pass a workspace id)
loop_get_page Read a page's content as Markdown (or html) by page id
loop_search Search across your Loop pages and components by keyword (via Microsoft Graph)
loop_create_workspace Experimental. Create a new shared workspace. Content cannot be created via API

Session storage

Session files are stored encrypted in ~/.msloop-mcp-server/:

  • session-state.json: Playwright browser session (cookies + localStorage)
  • token-cache.json: Extracted and cached tokens
  • browser-profile/: Persistent browser profile for headless refresh

If your session expires, run loop_login again.

Token refresh

Tokens are refreshed automatically:

  1. HTTP refresh (fast, no browser): uses the cached refresh token with Loop's client ID, one call per resource (Substrate, SharePoint, Graph).
  2. Headless browser refresh: fallback if HTTP refresh fails; opens a headless browser with the saved profile to silently reacquire tokens.

Requirements

  • Node.js 20+
  • A Chromium based browser: Edge or Chrome (detected automatically from system default)
  • A Microsoft 365 work or school account with access to Microsoft Loop

Environment variables

Variable Description
MSLOOP_DEBUG=true Enable debug logging to stderr
MSLOOP_BROWSER=chrome Force a specific browser: chrome or msedge. If unset, uses the macOS system default; falls back to Chrome on macOS/Linux and Edge on Windows
MSLOOP_CHROME_PROFILE Pin a specific Chrome profile dir for cookie import (e.g. Profile 1). Defaults to Default
MSLOOP_EDGE_PROFILE Pin a specific Edge profile dir for cookie import (e.g. Profile 1). Defaults to Default
MSLOOP_SKIP_COOKIE_IMPORT=true Skip importing SSO cookies from your real browser (avoids the one time Keychain/keyring prompt). You sign in once manually; the persistent profile then remembers the session

Security notes

  • Uses the same auth as the Loop web client, so your access is limited to what your account can do.
  • Tokens are encrypted at rest (AES-256-GCM with a machine derived key).
  • Uses undocumented internal APIs, which Microsoft may change without notice.

Acknowledgements

The Loop endpoint mapping (Substrate discovery, the SharePoint multipart "GET via POST" convention, and the HTML export route) was informed by exec-astraea/loop-migration and Nico De Cleyre's "Microsoft Loop under the hood".

License

MIT. See LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选