cd /news/ai-agents/how-i-built-a-read-only-mcp-server-f… · home › topics › ai-agents › article
[ARTICLE · art-174115] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

How I Built a Read-Only MCP Server for Microsoft Teams by Parsing IndexedDB in Go

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.

key 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.

by read3 min views1 publishedNov 22, 2026

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.

── more in #ai-agents 4 stories · sorted by recency
── more on @teamscache 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-i-built-a-read-o…] indexed:0 read:3min 2026-11-22 · —