devxoul/agent-messenger
Overview
This skill enables AI agents and humans to interact with Microsoft Teams from the command line: send and read messages, list channels and users, manage reactions, upload files, and capture full team snapshots. It uses seamless token extraction from the Teams desktop app and supports multiple teams with JSON output optimized for AI consumption. Note: Teams tokens are short-lived and require periodic re-extraction.
How this skill works
The tool auto-extracts the Teams session token (skypetoken_asm) from the desktop app cookies, validates it against the Teams API, and stores credentials securely. Commands operate against the selected team and channel IDs, returning structured JSON by default and a pretty human-readable mode with --pretty. Snapshot captures team metadata, channels, recent messages, and member lists for agent processing.
When to use it
- Automating message posting or deletion from an AI agent into Teams channels.
- Collecting channel history, members, and recent messages for summarization or analysis.
- Monitoring a channel for new messages with a periodic snapshot workflow.
- Adding or removing reactions to messages as part of an automated workflow.
- Uploading or listing files in a channel from CI or agent tasks.
Best practices
- Always run auth status before operations and re-run auth extract if the token is expired (60–90 minute lifespan).
- Use channel list to find precise 19:...@thread.tacv2 channel IDs; channel names are not accepted.
- Prefer snapshot --limit to bound message volume when building summaries or training data.
- Handle 401 Unauthorized responses by triggering a re-authentication flow and retrying idempotent operations.
- Store and restrict credentials file (~/.config/agent-messenger/teams-credentials.json) permissions to owner-only (0600).
Example use cases
- Send scheduled reports from an AI agent to a specific channel: agent-teams message send <channel-id> "Report"
- Generate a daily team summary by running snapshot --channels-only --limit 10 and feeding JSON to a summarizer.
- Monitor a support channel and add a reaction when tickets match specific patterns using reaction add.
- Upload generated artifacts (PDFs, logs) to a channel with file upload and post the file link to the team.
FAQ
Teams tokens expire in roughly 60–90 minutes; check auth status before operations and run auth extract when expired.
Can I use channel names instead of IDs?
No. Teams uses UUID-style channel IDs (e.g., 19:abc123@thread.tacv2). Run channel list to obtain IDs.
Does this support real-time events or WebSockets?
No. There is no real-time event or WebSocket support; use polling or periodic snapshots to monitor channels.
3 skills
This skill helps AI agents manage Microsoft Teams interactions by sending messages, reading channels, and handling multi-team tokens efficiently.
This skill helps you manage Discord servers with AI agents by automating messages, channel queries, and server state retrieval.
This skill helps teams manage Slack bot tokens and perform message actions across workspaces with multi-bot support and CI/CD friendly authentication.