If you work as an external consultant or contractor across multiple client tenants, you probably know this problem. You want to automate your workflow or connect an AI assistant like Claude Code to your Microsoft Teams messages, so you look into the Microsoft Graph API.
However, you quickly run into a restriction. Reading messages through Graph requires permissions like Chat.Read and tenant admin consent. When you are a guest in another organization's tenant, getting an Azure app registration approved just to read your own chats is usually not possible.
However, if you use the new Microsoft Teams (v2) desktop client, your recent conversations are already stored on your disk.
I built teamscache, a Go CLI and read-only MCP server that reads chats, messages, and @-mentions directly from the local Teams desktop cache. It requires no Graph API access, no OAuth tokens, and makes zero network requests.
The new Teams client (com.microsoft.teams2 on macOS, the MSTeams package on Windows) is built on Edge WebView2. Like other Chromium-based apps, it stores local application data in IndexedDB, which Chromium saves on disk using LevelDB with values encoded in Blink and V8 serialization formats.
When teamscache runs, it performs five steps:
--leveldb path).teamscache copies the data and referenced blob files to a temporary directory with owner-only permissions and deletes the copy right after parsing..ldb tables and .log files (including Snappy-compressed blocks) in pure Go without running a LevelDB engine.replychains (and numbered stores like replychains-2), chat metadata from conversations, and mentions from mentions-metadata-items, grouped by tenant and user ID.
Since LevelDB keeps older versions of updated records until compaction, teamscache uses only the newest version of each record. If someone edits a message or you read a mention in the UI, the tool reflects the current state.
You can install teamscache via Homebrew on macOS or Linux:
brew install stn1slv/tap/teamscache
Or install it with Go 1.27 or later:
go install [github.com/stn1slv/teamscache/cmd/teamscache@latest](https://github.com/stn1slv/teamscache/cmd/teamscache@latest)
Pre-built binaries for macOS, Linux, and Windows are also available on the GitHub Releases page.
Every CLI command prints structured JSON to stdout and a short summary to stderr, so you can cleanly pipe output to jq or save it to a file:
teamscache accounts
teamscache overview --days 7
teamscache mentions --unread
teamscache search "architecture review"
teamscache read "19:abc@thread.v2" --limit 0 > chat.json
If you switch between multiple tenants or Edge WebView2 profiles, you can filter any command using --account "<tenantId>:<userId>" or --profile "Default".
Running teamscache mcp starts a read-only Model Context Protocol server over stdio. Here is how to add it to your Claude Desktop or Claude Code configuration:
{
"mcpServers": {
"teams": {
"command": "teamscache",
"args": ["mcp"]
}
}
}
Once connected, your assistant gets access to tools such as overview, recent_messages, unread_messages, search_messages, list_conversations, and read_conversation.
For example, you can ask Claude Code:
To restrict the MCP server to a single work tenant or return full message bodies without truncation, pass flags in args:
{
"mcpServers": {
"teams": {
"command": "teamscache",
"args": ["mcp", "--max-content", "0", "--account", "<tenantId>:<userId>"]
}
}
}
The server caches the parsed data in memory (180 seconds by default) and parses again when the TTL expires or when Teams writes new data to disk.
@-mentions, which makes mentions --unread (or the unread_messages MCP tool) the reliable way to find incoming requests that need your attention.
The source code is available under the MIT license at github.com/stn1slv/teamscache. If you test it on different OS versions or run into edge cases with the Teams v2 cache schema, feel free to open an issue or send a pull request.