Teams agents

From markus41/claude · View interactive version

Teams agents is an AI agent skill from the GitHub repository markus41/claude. Build Teams-native agents with the Teams SDK (formerly Teams AI Library v2) — App class, activity routing, adaptive cards, streaming, AI-generated labels, feedback, message extensions, Teams-as-MCP-server, and the bring-your-own-AI pattern with Agent Framework.

How to use this skill

Skill file

Teams Agents — Teams SDK

The Teams AI Library is now renamed to Teams SDK (branded "Teams AI Library v2" in some

docs) — rebuilt from the ground up for Teams-native agents. **GA for JavaScript and C#;

Python is developer preview. v1 is deprecated.**

Docs: https://learn.microsoft.com/microsoftteams/platform/teams-ai-library/welcome/overview

· Repos: microsoft/teams.ts, microsoft/teams.py

Packages and CLI

(MessageActivity and friends), @microsoft/teams.common

Bring your own AI. The SDK deprecated its own AI packages (@microsoft/teams.ai

ChatPrompt/Model, old @microsoft/teams.mcp, @microsoft/teams.a2a). The documented

pattern: run the agent loop with the OpenAI SDK or Microsoft Agent Framework

(skills/agent-framework) and wire MCP/A2A directly — Teams SDK handles activity routing

and Teams affordances.

Minimal agent

import { App } from '@microsoft/teams.apps';

const app = new App();
app.on('message', async ({ send, activity }) => {
  await send({ type: 'typing' });
  await send(`you said "${activity.text}"`);
});
app.start(process.env.PORT || 3978).catch(console.error);

Agent Framework loop streaming into Teams (Python preview)

@app.on_message
async def handle_message(ctx: ActivityContext[MessageActivity]):
    async for chunk in agent.run(ctx.activity.text or "", stream=True):
        if chunk.text:
            ctx.stream.emit(chunk.text)
    ctx.stream.emit(MessageActivityInput().add_ai_generated().add_feedback(mode="custom"))

Teams-specific capabilities

| Capability | Notes |

|---|---|

| Adaptive Cards | Dialogs, message extensions, link unfurling — validate card JSON against the schema |

| Streaming | ctx.stream.emit(...) for progressive responses |

| AI-generated label | .addAiGenerated() — required UX for AI output in Teams |

| Feedback controls | .addFeedback('custom') — thumbs/feedback affordances on agent messages |

| Citations | Attach sources to generated answers |

| Prompt starters | Suggested first prompts in the agent's Teams surface |

| Proactive messages | Agent-initiated notifications to users/channels |

| Meetings | Meeting-aware agents (join context, transcripts where permitted) |

| Teams as MCP server | Expose Teams to agents: notify / ask / request_approval reach humans |

| Bot-to-bot A2A | Agent-to-agent conversations across Teams bots |

Relationship to the M365 Agents SDK

Teams SDK is Teams-centric (collaborative, multi-user, meetings, real-time). To extend the

same agent to Outlook, M365 Copilot, and other channels, use the M365 Agents SDK

(skills/m365-agents-sdk) — which also ships microsoft-agents-hosting-teams for the

Teams surface. Both build and publish through the Microsoft 365 Agents Toolkit.

Rule of thumb: Teams-only experience → Teams SDK; multi-channel custom engine agent →

M365 Agents SDK, adding Teams affordances through its Teams hosting package.

Practices

reviewers and store validation look for both.

Microsoft 365 Agents Toolkit — see /msagent-migrate for the project-structure map.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.