# Microsoft Work IQ

> Query your Microsoft 365 data with natural language — emails, meetings, documents, Teams messages, and more.

[![npm version](https://img.shields.io/npm/v/@microsoft/workiq)](https://www.npmjs.com/package/@microsoft/workiq)

Work IQ is a CLI and an MCP (Model Context Protocol) server that connects AI assistants to your Microsoft 365 Copilot data. Ask questions like *"What did my manager say about the project deadline?"* or *"Find my recent documents about Q4 planning."*

See project [README](https://github.com/microsoft/work-iq/blob/main/README.md) for usage details.

## 📋 Changelog

### 1.0.0

🎉 **General Availability release**

- First stable release of Work IQ
- Entity tools for reading and writing Microsoft 365 data: `fetch`, `create`, `update`, `delete`, `do-action`, `get-schema`, `search-paths`, and `call-function`
- Progress notifications during long-running `ask` requests
- MCP SDK 1.3.0
- Support for macOS, Linux, and Windows
- WAM broker authentication with fallback to browser auth flow
- Multi-tenant authentication support
- Interactive CLI mode with conversation continuation
- Agent targeting with `-a` flag

### 0.5.0-preview3

- New entity tools: `fetch`, `create`, `update`, `delete`, `do-action`, `get-schema`, `search-paths`, and `call-function` for reading and writing Microsoft 365 data. These tools proxy requests to the remote WorkIQ MCP Server for execution.
- Progress notifications during long-running `ask` requests (MCP clients that support progress will see status updates)
- Upgraded MCP SDK to 1.3.0

### 0.5.0-preview2

- Fix support for MacOS
- Fallback to Graph A2A when tenant is not consented for WorkIQ A2A
- Improved authentication error messages
- Fixed WAM broker errors not triggering endpoint fallback on Windows

#### ⚠️ Breaking: Command structure changes (since 0.4.x)

| Old command | New command |
|---|---|
| `workiq logout` | `workiq auth logout` |
| `workiq list-agents` | `workiq agents list` |
| `workiq get-agent-card` | `workiq agents get-card` |
| `workiq config` | `workiq config show` |

New commands:
- `workiq auth login` — explicit login command
- `workiq auth consent` — consent additional permissions and provision service principal
- `workiq config set <key> <value>` — set a config value (replaces flat `workiq config`)
- `workiq config unset <key>` — remove a config key
- `workiq config show` — display current configuration
- `workiq config reset` — delete the config file

### 0.5.0-preview1

- CLI now uses the WorkIQ A2A API
- Ask tool can be targeted at specific agents
- Ability to list available agents and retreive agent cards
- Consent command for consenting additional permissions and provisioning the API service principal for new tenants.
- Supports CAE tokens
- --developer mode for returning information about how the request was processed
- --conversation-id for allowing conversations to continue across requests

### 0.4.1

- Added web search support for WorkIQ Ask.
- Added multi-tenant authentication support.
- Added custom headers and diagnostic output for A2A mode.
- Added file URL validation before sending to API.
- Improved MCP error handling with structured errors and `IsError` flag.
- Upgraded MCP SDK to 1.1.0.
- Improved account switching support in `logout` command.
- Fixed streaming for both A2A and REST protocols with centralized markdown rendering.
- Fixed `token` command ignoring the `--account` parameter.
- Fixed duplicate agents appearing in `GetAvailableAgents`.
- Fixed WAM broker account picker prompting on every call.
- Fixed macOS broker auth threading and token cache reliability.

### 0.4.0

- Refactored Agent Relay architecture for improved reliability and maintainability.
- Added `--noCors` option to the A2A server command to disable CORS restrictions.
- Updated to .NET 10 SDK.
- Renamed `enableMacBroker` config key to `disableBrokeredAuth` (default: false, broker enabled). Legacy `enableMacBroker=false` configs are honored for backward compatibility.
- Added `Trace` log level that surfaces MSAL SDK logging for auth diagnostics.
- Fixed issue with single-file MCP on macOS attempting SilentAuth with `os_current_account`.
- Store `DefaultAccount` to enable cached token retrieval.
- Warm up token cache for MCP server mode.
- Enhanced interactive authentication flow with macOS broker fallback.
- Minimized redundant token acquisition calls and refactored startup.
- Added `logout` command.
- Improved authentication flow with effective app determination and account handling.
- Added macOS authentication with broker support and browser fallback.
- Added `--fileUrls` parameter to the `ask` command and the `ask` MCP tool.
- Changed startup to use win-64 binary when running under WSL.
- Added `mcpName` to packages.json to enable publishing to the mcp registry. 
- Added `--account` property for selecting between different logins
- Added `experimental` flag in the config.

### 0.2.8

- Updated README with reference to Github project. No functional changes.

### 0.2.7

- First public release

## 📄 License

By using this package, you accept the license agreement. See NOTICES.TXT and EULA [within the package](https://www.npmjs.com/package/@microsoft/workiq?activeTab=code) or at [this repository](https://github.com/microsoft/work-iq) for legal terms.

## ™️ Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.