explaingit

hexuxiu/m365-copilot2api

Analysis updated 2026-05-18

75GoAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A Go based gateway that lets you call Microsoft 365 Copilot using the same request format as OpenAI or Anthropic APIs.

Mindmap

mindmap
  root((repo))
    What it does
      Wraps M365 Copilot
      OpenAI compatible API
      Anthropic compatible API
    Tech stack
      Go
      Docker
      MCP protocol
    Use cases
      Swap in Copilot models
      Build MCP tool servers
      Self hosted AI gateway
    Audience
      Developers
      AI tool builders
      Self hosters

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Point existing OpenAI or Anthropic API client code at Microsoft 365 Copilot models instead.

USE CASE 2

Run an MCP tool server that lets compatible AI apps call external tools through the gateway.

USE CASE 3

Manage multiple Microsoft accounts and API keys from a single web admin console.

USE CASE 4

Get web connected answers to current-events questions through the built in search capable model.

What is it built with?

GoDockerMCPSSEWebSocket

How does it compare?

hexuxiu/m365-copilot2apigastownhall/wastelandthephw/claude-meseeks
Stars757676
LanguageGoGoGo
Last pushed2026-06-20
MaintenanceMaintained
Setup difficultymoderatemoderateeasy
Complexity3/53/51/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Microsoft 365 Copilot account and Go or Docker, default admin password must be changed after first login.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

M365 Copilot2API is a gateway written in Go that turns Microsoft 365 Copilot into an API you can call the same way you would call OpenAI or Anthropic. If you already have code, scripts, or tools built around the OpenAI or Anthropic chat APIs, you can point them at this gateway instead and reach Microsoft's Copilot models through the same familiar request format. It exposes endpoints that match the OpenAI chat completions format, the newer OpenAI responses format, and the Anthropic messages format, and it supports streaming replies so text appears word by word instead of all at once. It also runs its own MCP, or Model Context Protocol, server with endpoints for listing and calling tools, which lets compatible AI tools discover and use external functions through this gateway. Several Copilot backed models are available through it, including options tuned for everyday conversation, faster lightweight replies, web connected answers for things like current weather, and slower models meant for harder math or logical reasoning tasks. One of the models can search the web directly as part of answering a question. The project includes a web based admin console for managing accounts, generating and revoking API keys, adjusting settings, and reviewing logs. It supports multiple Microsoft accounts logged in through OAuth, and it can route requests through a pool of proxies that rotates and pauses ones that fail. To run it, you clone the repository and start it directly with Go, or you can run it through Docker Compose. By default it listens only on your local machine and ships with a default admin password that the README says should be changed immediately after first login. For anyone exposing it beyond their own computer, the README recommends adding TLS encryption and a reverse proxy in front of it. The project is released under the MIT License.

Copy-paste prompts

Prompt 1
Help me set up M365-Copilot2API with Docker Compose and change the default admin password.
Prompt 2
Show me how to call the /v1/chat/completions endpoint with streaming enabled.
Prompt 3
Explain how the MCP tools/list and tools/call endpoints work in this gateway.
Prompt 4
Walk me through configuring a reverse proxy with TLS in front of this service for public exposure.
Prompt 5
How do I add and manage multiple Microsoft 365 accounts through the admin console?

Frequently asked questions

What is m365-copilot2api?

A Go based gateway that lets you call Microsoft 365 Copilot using the same request format as OpenAI or Anthropic APIs.

What language is m365-copilot2api written in?

Mainly Go. The stack also includes Go, Docker, MCP.

What license does m365-copilot2api use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is m365-copilot2api to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is m365-copilot2api for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.