Free and open source

Your Microsoft 365 Copilot, inside VS Code

Chat with @m365, edit code in place, review your changes and write commit messages with the Microsoft 365 Copilot you already have. No API key, no dashboard.

VS Code 1.104+ · Chrome, Edge and Firefox · English and Spanish

M365 Copilot and VS Code: the extension connects to Microsoft 365 Copilot, captures the token and links it to VS CodeM365 CopilotVS Code

Connected to VS Code. The token syncs by itself.

Up and running in four steps

The pack has two pieces: the extension for VS Code and a small browser extension that hands it your Copilot session.

  1. Install the VS Code extension

    Get it from the VS Marketplace, or load the .vsix from the GitHub releases.

  2. Install the browser extension

    Download it for Chrome, Edge or Firefox. It captures your Copilot session token, so there is nothing to copy and paste.

  3. Connect with one message

    Open m365.cloud.microsoft/chat and send any message. The popup turns green and VS Code has your token. It renews itself while a Microsoft 365 tab is open.

  4. Type @m365 in the chat

    Or pick an M365 Copilot model in the model picker. Select code and press Ctrl+Shift+Alt+I to edit it in place.

See it working

It lives in the chat, the editor and Source Control, where you already work.

VS Code with the chat open: M365 Copilot explains two problems in the selected getUser function and proposes a more robust version
Ask about your code Select a function and ask. M365 Copilot answers in VS Code’s own chat, with your selection as context.
VS Code editor with M365 Copilot review comments on the lines: an error about an off-by-one loop and a warning about an unvalidated discount
Code review as comments Findings appear on the lines, with a suggested fix, Apply fix and Dismiss. They are also listed in the Comments panel.
VS Code editor with a change proposed by M365 Copilot: the new lines are highlighted and a Keep, Undo and Show diff bar sits above them
Edit in place, then keep or undo Select code and say what to change. The result lands with Keep and Undo on each block, so nothing is applied behind your back.
VS Code Source Control view with a Conventional Commits message written by M365 Copilot in the commit box
Commit messages in one click The ✨ button in Source Control writes a Conventional Commits message from your diff. You read it and commit.

Screenshots of VS Code in English. The extension follows VS Code's language, English or Spanish.

Everything around your code

Not just a chat box: it plugs into the places where you edit, review and commit.

  • Chat in VS Code

    Type @m365, or pick an M365 Copilot model in the model picker, next to the others you use.

  • Edit code in place

    Select code, press Ctrl+Shift+Alt+I and say what to change. The result lands under Keep / Undo.

  • Code review as comments

    Findings appear as comments on the lines, each with Apply fix and Dismiss.

  • Commit messages

    A button in Source Control writes a Conventional Commits message from your diff. Optional auto-commit never pushes and has Undo.

  • Knows your project

    A local index of your workspace adds the relevant code to each request. Only the code in a request leaves your machine.

  • Web search

    Looks up current docs and error messages on the internet when it needs to. Needs the browser extension or the userscript.

  • Agent mode

    Reads, searches and edits files and runs commands through VS Code’s tools. Commands and commits always ask first.

  • Inline completions

    Ghost-text suggestions as you type. They take about 1–3 seconds, and you can switch them to manual.

  • English and Spanish

    The interface, the messages and the instructions sent to the model follow your language.

Download

What you need: VS Code 1.104 or later · A Microsoft 365 account with a Copilot licence · Chrome, Edge or Firefox 128+ (or Tampermonkey)

1

VS Code extension

Adds the @m365 chat participant, the models, the editor actions and the commit tools.

Or paste this in VS Code (Ctrl+P):

ext install m365-copilot-vscode.m365-copilot-vscode
2

Browser extension

Captures your Copilot session token and keeps it renewed in VS Code. Recommended.

Chrome and Edge: unzip and load unpacked. Firefox: open the file.

Userscript (alternative)

The same capture as a Tampermonkey or Violentmonkey script, for browsers where you cannot load extensions.

All releases · Changelog

Read the guide

Frequently asked questions

Is this an official Microsoft or GitHub product?

No. It is an independent open source project, not affiliated with Microsoft. It talks to Microsoft 365 Copilot with your own session, so you are responsible for following Microsoft's terms.

Do I need a Microsoft 365 Copilot licence?

Yes. The extension uses the Copilot of your Microsoft 365 account. Without a licence the service answers with a licence error, and the extension tells you so.

Why do I need a browser extension?

Microsoft 365 Copilot has no API key you can create. The browser extension reads the session token the web app already uses and sends it to VS Code on localhost. If you cannot install it, use the userscript, or paste the token by hand.

Where does my token go?

VS Code keeps it in its encrypted SecretStorage, on your machine, and only sends it to Microsoft endpoints. The local server that receives it from the browser only accepts the Microsoft 365 and Office origins and the browser extension.

Does it cost anything?

The extension is free and open source. It uses your existing Microsoft 365 Copilot plan. Inline completions make one request per suggestion, so switch them to manual if you want less usage.

What do I do when the token expires?

It lasts about an hour. With the browser extension and a Microsoft 365 tab open it renews by itself. Otherwise the status bar tells you: open M365 Copilot and send a message, or paste a new token.

Does it work in Visual Studio, the full IDE?

Not today. It is built for Visual Studio Code, and a version for Visual Studio would need a different approach.

Enjoying it? Give it a star

A star on GitHub is free, takes two seconds and helps other developers find the project.

Thank you: it is what keeps the project going.

Ready to try it?

Install both pieces, send one message in Microsoft 365 Copilot and start chatting.