{"slug": "how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in", "title": "How I Built a Read-Only MCP Server for Microsoft Teams by Parsing IndexedDB in Go", "summary": "A developer built teamscache, an open-source Go CLI and read-only MCP server that extracts Microsoft Teams chats, messages and @-mentions directly from the new Teams desktop client's local IndexedDB/LevelDB cache, avoiding Microsoft Graph API permissions and tenant admin consent. The tool parses LevelDB tables and Snappy-compressed blocks in pure Go, decodes Blink and V8 serialized values, copies data to a temporary owner-only directory for parsing, and makes zero network requests. It exposes tools such as overview, search_messages and read_conversation to assistants like Claude Code over stdio.", "body_md": "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.\n\nHowever, 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.\n\nHowever, if you use the new Microsoft Teams (v2) desktop client, your recent conversations are already stored on your disk.\n\nI built **[teamscache](https://github.com/stn1slv/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.\n\nThe 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**.\n\nWhen `teamscache` runs, it performs five steps:\n\n`--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.\nSince 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.\n\nYou can install `teamscache` via Homebrew on macOS or Linux:\n\n```\nbrew install stn1slv/tap/teamscache\n```\n\nOr install it with Go 1.27 or later:\n\n```\ngo install [github.com/stn1slv/teamscache/cmd/teamscache@latest](https://github.com/stn1slv/teamscache/cmd/teamscache@latest)\n```\n\nPre-built binaries for macOS, Linux, and Windows are also available on the [GitHub Releases page](https://github.com/stn1slv/teamscache/releases).\n\nEvery 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:\n\n```\n# List all tenant and user accounts found in the cache\nteamscache accounts\n\n# See recent activity grouped by conversation over the last 7 days\nteamscache overview --days 7\n\n# Check unread @-mentions that need your attention\nteamscache mentions --unread\n\n# Search messages by text or sender name\nteamscache search \"architecture review\"\n\n# Read all cached messages in a specific conversation (oldest first)\nteamscache read \"19:abc@thread.v2\" --limit 0 > chat.json\n```\n\nIf you switch between multiple tenants or Edge WebView2 profiles, you can filter any command using `--account \"<tenantId>:<userId>\"` or `--profile \"Default\"`.\n\nRunning `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:\n\n```\n{\n  \"mcpServers\": {\n    \"teams\": {\n      \"command\": \"teamscache\",\n      \"args\": [\"mcp\"]\n    }\n  }\n}\n```\n\nOnce connected, your assistant gets access to tools such as `overview`, `recent_messages`, `unread_messages`, `search_messages`, `list_conversations`, and `read_conversation`.\n\nFor example, you can ask Claude Code:\n\nTo restrict the MCP server to a single work tenant or return full message bodies without truncation, pass flags in `args`:\n\n```\n{\n  \"mcpServers\": {\n    \"teams\": {\n      \"command\": \"teamscache\",\n      \"args\": [\"mcp\", \"--max-content\", \"0\", \"--account\", \"<tenantId>:<userId>\"]\n    }\n  }\n}\n```\n\nThe 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.\n\n`@-mentions`, which makes `mentions --unread` (or the `unread_messages` MCP tool) the reliable way to find incoming requests that need your attention.\nThe source code is available under the MIT license at **[github.com/stn1slv/teamscache](https://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.", "url": "https://wpnews.pro/news/how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in", "canonical_source": "https://dev.to/stn1slv/how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in-go-51cf", "published_at": "2026-11-22 09:41:03+00:00", "updated_at": "2026-11-22 09:42:17.846136+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "developer-tools", "ai-tools"], "entities": ["teamscache", "Microsoft Teams", "Microsoft Graph API", "Claude Code", "Claude Desktop", "Microsoft", "Go", "IndexedDB"], "also_reported_by": [], "takeaway": "teamscache shows that Chromium-based desktop apps' IndexedDB/LevelDB caches can be parsed in pure Go to feed a read-only MCP server, giving assistants access to Teams chats without Graph API permissions or OAuth tokens.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in", "markdown": "https://wpnews.pro/news/how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in.md", "text": "https://wpnews.pro/news/how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in.txt", "jsonld": "https://wpnews.pro/news/how-i-built-a-read-only-mcp-server-for-microsoft-teams-by-parsing-indexeddb-in.jsonld"}}