microsoft/agents/agents-sdk-typescript
Claude Code and agent skill by microsoft/agents
- vendor
Checking that the SKILL.md file is still in the repository.
Use when any code imports @microsoft/agents-hosting, @microsoft/agents-hosting-express, or related Agents SDK packages, or when the user is building, configuring, or asking questions about a Microsoft 365 Agents SDK agent in TypeScript. Trigger on questions about environment variables, connection configuration, AgentApplication patterns, OAuth sign-in flows, storage backends, cards, streaming, or local testing with the Agents Playground — even if no code exists yet and the user is planning or asking how to get started.
Install
npx vskill@latest install microsoft/agents/agents-sdk-typescriptSKILL.md
The same SKILL.md was published earlier as microsoft/agents/agents-sdk-typescript.
Overview
The Microsoft 365 Agents SDK builds multichannel agents for Teams, Copilot Studio, and web chat.
| Package | Purpose | |
|---|---|---|
@microsoft/agents-hosting | Core: AgentApplication, CloudAdapter, TurnContext, TurnState, storage | |
@microsoft/agents-hosting-express | startServer() convenience wrapper | |
@microsoft/agents-hosting-storage-blob | Azure Blob Storage backend | |
@microsoft/agents-hosting-storage-cosmos | CosmosDB backend | |
@microsoft/agents-hosting-dialogs | Dialog system |
Requires Node 18+. Use node --env-file .env (Node 20+) to load environment variables.
Azure Resources Required
Microsoft Entra App Registration
clientId— Application (client) IDclientSecret— Certificates & secretstenantId— Directory (tenant) ID
Azure Bot Resource
- Messaging endpoint:
https://<your-host>/api/messages - Microsoft App ID must match
clientId
Local dev: Use Bot Framework Emulator. No Azure Bot needed until deployment. Leave clientId blank to skip auth validation.
Environment Variables
Modern format (recommended)
Uses connections__ and connectionsMap__ prefixes. Double underscores (__) separate path segments; .settings. is stripped automatically.
Single connection (most common):
How `connectionsMap` works: Each entry maps a serviceUrl pattern to a named connection. The first matching entry wins.
serviceUrl=*— matches any service URL (use as the default/fallback)serviceUrlis treated as a regex for all other values
connectionsMap can be omitted when there is only one connection — the SDK defaults it to serviceUrl=*.
Multiple connections (e.g. different identities for different channels):
Optional audience field on a map entry restricts matching to activities whose JWT aud claim equals that value:
Available connection settings fields: clientId, clientSecret, tenantId, authority, certPemFile, certKeyFile, sendX5C, connectionName, scope
Legacy format — backwards compatibility only
Never use the legacy format for new agents. It exists solely for backwards compatibility with older BotFramework-based bots. Always use the modernconnections__format above.
Both startServer() and loadAuthConfigFromEnv() auto-detect the format. Leave clientId blank locally to skip auth.
OAuth authorization handler variables
These control the user sign-in flow configured via authorization: { [id]: { ... } }. The id is the key used in the authorization options (e.g. graph).
Modern format (recommended)
Uses the prefix AgentApplication__UserAuthorization__Handlers__<id>__Settings__<property>. Case-insensitive.
AzureBot handler (default — user OAuth flow via Azure Bot Service):
AgenticUserAuthorization handler (agent-to-agent, no user prompt):
Legacy format (deprecated)
Do not use the legacy format for new agents. It exists solely for backwards compatibility. The SDK emits deprecation warnings when legacy variables are detected.
| Legacy variable | Modern equivalent | |
|---|---|---|
graph_connectionName | ...Handlers__graph__Settings__azureBotOAuthConnectionName | |
graph_connectionTitle | ...Handlers__graph__Settings__title | |
graph_connectionText | ...Handlers__graph__Settings__text | |
graph_maxAttempts | ...Handlers__graph__Settings__invalidSignInRetryMax | |
graph_enableSso | ...Handlers__graph__Settings__enableSso | |
graph_obo_connection | ...Handlers__graph__Settings__oboConnectionName | |
graph_obo_scopes | ...Handlers__graph__Settings__oboScopes | |
graph_messages_invalidCode | ...Handlers__graph__Settings__invalidSignInRetryMessage | |
graph_messages_invalidCodeFormat | ...Handlers__graph__Settings__invalidSignInRetryMessageFormat | |
graph_messages_maxAttemptsExceeded | ...Handlers__graph__Settings__invalidSignInRetryMaxExceededMessage | |
myHandler_type=agentic | ...Handlers__myHandler__Settings__type=AgenticUserAuthorization | |
myHandler_scopes | ...Handlers__myHandler__Settings__scopes | |
myHandler_altBlueprintConnectionName | ...Handlers__myHandler__Settings__altBlueprintConnectionName |
Priority when both formats are present: runtime options (code) > modern env vars > legacy env vars.
Quick Start
Run: node --env-file .env dist/index.js
Server Setup
Option A: startServer() (preferred)
startServer(agent) creates an Express app with:
express.json()+authorizeJWT()middlewarePOST /api/messagesroute- Listens on
PORTenv var (default 3978) - Returns the Express instance — add extra routes to the return value
Option B: Manual Express
Proactive Messaging
Save a reference during a turn, then use adapter.continueConversation from any route. req.user comes from authorizeJWT middleware.
Validating Your Configuration
1. Validate bot credentials (clientId / clientSecret / tenantId)
This tests that your Entra app registration credentials are correct and can authenticate with the Bot Framework. A successful response includes access_token; an error response includes error and error_description.
Common errors:
AADSTS700016—clientIdnot found in tenant (wrong ID or wrong tenant)AADSTS7000215— invalidclientSecret(expired or incorrect)AADSTS90002—tenantIdnot found
2. Validate the agent is running and reachable
401— agent is running; JWT auth rejected the empty request (expected — means auth is working)000or connection refused — agent is not running or wrong port200— agent is running with auth disabled (local dev with blankclientId)
3. Validate an OAuth connection name
OAuth connection names (set via AgentApplication__UserAuthorization__Handlers__graph__Settings__azureBotOAuthConnectionName) can only be tested end-to-end through a real sign-in flow. Use the Azure portal:
Azure Portal → Your Bot Resource → Settings → OAuth Connection Settings → [your connection] → Test Connection
This confirms the connection name matches, the OAuth app has the right scopes, and the redirect URI is configured correctly.
Local Testing with Agents Playground
The Agents Playground lets you test your agent locally without deploying to Azure or configuring a Bot resource. It acts as a mock connector service and channel client.
Install:
Recommended package.json scripts
Include these scripts when creating a new agent's package.json. The test script starts the agent and playground together in parallel — no separate terminals needed:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 12 Jun 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagent-plugins/agents-for-js/skills/agents-sdk-typescript/SKILL.md
Popularity
- Repository stars
- 956
- Repository forks
- 311
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/agents/agents-sdk-typescript)