m365-copilot-proxy

OpenAI-compatible proxy for Microsoft 365 Copilot — use the Copilot licence you already have as a backend for pi, openclaw and other coding agents. Prompt-emula

What is m365-copilot-proxy?

OpenAI-compatible proxy for Microsoft 365 Copilot — use the Copilot licence you already have as a backend for pi, openclaw and other coding agents. Prompt-emulated tool calling, no extra licence, no MCP.

Overview of m365-copilot-proxy

What it is

m365-copilot-proxy is an open-source proxy that translates Microsoft 365 Copilot's WebSocket/SignalR protocol into an OpenAI-compatible API. It allows users to use their existing M365 Copilot license as a backend for OpenAI-compatible coding agents such as pi and OpenClaw. The project is written in TypeScript and published as a monorepo with three packages: @m365-copilot/core, @m365-copilot/proxy, and @m365-copilot/openclaw-plugin. It requires a work or school (Entra ID) account with M365 Copilot Chat; personal Microsoft accounts are not supported. The proxy supports tool calling via a Markdown-fence emulation method and can create a Copilot Studio agent to improve tool-calling reliability. It also supports conversation reuse to save quota, as the 600-message limit applies per conversation.

Key features

  • OpenAI-compatible HTTP server with /v1/chat/completions and /v1/models endpoints.
  • Tool calling emulated via Markdown-fence format, including shell-routing for agentic behavior.
  • Automatic creation of a Copilot Studio agent with tool-calling instructions via the PowerPlatform API.
  • Conversation reuse across turns to preserve server-side context and save quota.
  • Supports both automated TOTP-based login and interactive approval for tenants without TOTP.
  • Includes a standalone proxy binary and an OpenClaw plugin with config generator and setup CLI.

Use cases

  • Using Microsoft 365 Copilot as the LLM backend for OpenAI-compatible coding agents like pi and OpenClaw.
  • Running multi-turn agentic coding tasks that require tool calling, such as automated bug fixing.
  • Leveraging an existing M365 Copilot license without purchasing additional API credits.
  • Headless or server-side automation of coding workflows using a work/school account.

Getting started

sh git clone https://github.com/cramt/m365-copilot-proxy cd m365-copilot-proxy pnpm install pnpm build Create ~/.config/opencode-m365/secrets.json with your email, password, and TOTP base32 secret. Then run the proxy: m365-proxy 4141. For interactive approval, set M365_ENABLE_INTERACTIVE_APPROVAL=1 and run the same command.

License and pricing

The project is licensed under MIT. It is open source and free to use. Pricing is not stated beyond the license; users must have their own M365 Copilot license.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/cramtm365-copilot-proxy.svg)](https://yunodb.com/tools/cramtm365-copilot-proxy?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/cramtm365-copilot-proxy?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/cramtm365-copilot-proxy.svg" alt="Featured on YunoDB" height="20"></a>