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.

How Teams v2 stores data on disk

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:

  1. Locates the cache: Finds the WebView2 LevelDB directory on macOS and Windows (with best-effort discovery on Linux, or an explicit --leveldb path).
  2. Copies locked files: Because a running Teams client holds file locks on LevelDB, teamscache copies the data and referenced blob files to a temporary directory with owner-only permissions and deletes the copy right after parsing.
  3. Reads LevelDB directly: Parses LevelDB .ldb tables and .log files (including Snappy-compressed blocks) in pure Go without running a LevelDB engine.
  4. Decodes IndexedDB and V8 values: Parses Chromium IndexedDB key prefixes and decodes Blink and V8 serialized payloads (a Go port of parts of ccl_chromium_reader).
  5. Maps the Teams schema: Extracts messages from 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.

Quick start with the CLI

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:

# List all tenant and user accounts found in the cache teamscache accounts # See recent activity grouped by conversation over the last 7 days teamscache overview --days 7 # Check unread @-mentions that need your attention teamscache mentions --unread # Search messages by text or sender name teamscache search "architecture review" # Read all cached messages in a specific conversation (oldest first) 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".

Connecting Teams to Claude Code or Claude Desktop (MCP)

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:

  • "Check my unread Teams mentions from the last 3 days and summarize what people are asking me for."
  • "Find the recent thread with Alex about the API gateway timeout and pull the error details."

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.

Practical notes and privacy

  • Local cache only: teamscache only sees messages that the desktop client has cached locally on disk. It does not fetch older history from Microsoft servers.
  • Read and unread state: The local Teams cache does not store a general unread flag for regular messages. It only tracks the read state for @-mentions, which makes mentions --unread (or the unread_messages MCP tool) the reliable way to find incoming requests that need your attention.
  • macOS permissions: If you run teamscache from a terminal or Claude Desktop on macOS, the host app needs Full Disk Access in System Settings so it can read the Teams container directory.
  • Offline and read-only: The binary never modifies the Teams cache and makes zero network calls.

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.