⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

agents-sdk-typescript

microsoft@microsoft⭐ 1.1k stars· last commit 6d ago· 93 open issues

>

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐⭐⭐⭐ 1.1k on GitHubGitHub ↗

Very popular

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

Microsoft 365 Agents SDK

With the Microsoft 365 Agents SDK, you can create agents deployable to channels of your choice, such as Microsoft 365 Copilot, Microsoft Teams, Web & Custom Apps and more, with scaffolding to handle the required communication. Developers can use the AI Services of their choice, and make the agents they build available using the channel management capabilities of the SDK.

Developers need the flexibility to integrate agents from any provider or technology stack into their enterprise systems. The Agents SDK simplifies the implementation of agentic patterns using the AI of their choice, allowing them to select one or more services, models, or agents to meet their specific requirements.

Use the Agents SDK to:

  • Quickly build an agent 'container' with state, storage, and the ability to manage activities and events. Deploy this container across any channel, such as Microsoft 365 Copilot or Microsoft Teams.
  • Implement agentic patterns without being restricted to a specific technology stack. The Agents SDK is agnostic regarding the AI you choose.
  • Customize your agent to align with the specific behaviors of clients, such as Microsoft Teams.

Get Started

You can get started right here by scolling up and clicking the 'samples' folder in this repo, selecting your language and reviewing the samples list before picking which one you want to start with (QuickStart is recommended for fundamentals).

Microsoft 365 Copilot is one of many channels supported by this SDK, and a Microsoft 365 Copilot subscription is not required to get started with or use this SDK unless your working specifically with that channel (or others, that require a subscription/service to use their client).

C#, JavaScript, & Python Repository links

The source for the client libraries exists for the most part in repositories for each language. This repository is meant to be a jumping off point into those language specific repositories. Issues related to a specific language should be opened in the corresponding repository but cross cutting issues can be opened in this repository.

LanguageRepo
General (This repo)[Agents Repository]
C# /.NET[Agents-for-net Repository]
JavaScript[Agents-for-js Repository]
Python[Agents-for-python Repository]

Agent Plugins (Skills)

The Agents SDK provides AI coding assistant plugins that give your assistant deep knowledge of SDK APIs, patterns, and common mistakes. Skills activate automatically based on the language and task you are working on.

The plugins are hosted in microsoft/Agents — agent-plugins.

Available plugins across the SDKs:

PluginSDKsSkills Included
agents-sdk-commonAll languagesAzure provisioning, identity credentials, and OAuth setup through the az CLI
agents-for-jsTypeScript/JavaScriptBuilding agents, debugging authentication and startup issues, and configuring OpenTelemetry observability
agents-for-netC#/.NETBuilding agents, debugging, OpenTelemetry observability, Bot Framework migration, and ActivityHandler-to-AgentApplication migration
agents-for-pythonPythonConfiguring and troubleshooting OpenTelemetry observability

Installation (GitHub Copilot CLI or Claude Code):

/plugin marketplace add microsoft/Agents
/plugin install agents-sdk-common@microsoft-agents-sdk
/plugin install agents-for-js@microsoft-agents-sdk
/plugin install agents-for-net@microsoft-agents-sdk
/plugin install agents-for-python@microsoft-agents-sdk

Install the common plugin and the plugins for the SDKs you use. Skills activate automatically—no manual loading is needed. Run /plugin to verify installation.

Documentation

To learn more about the Agents SDK, you can read our official docs here: Agents SDK Documentation

The configuration schema preview defines a canonical JSON document for structural validation in downstream projects. It does not establish runtime support or replace SDK-specific configuration loading.

Related SDKs and Agent Platforms

  • Semantic Kernel. Semantic Kernel is an SDK that integrates Large Language Models (LLMs) like OpenAI, Azure OpenAI, and Hugging Face with conventional programming languages like C#, Python, and Java. Semantic Kernel achieves this by allowing you to define plugins that can be chained together in just a few lines of code.

  • Azure AI Foundry. Provides the core backend agent functionality, providing reasoning, retrieval augmentation, observability, among other core functions. Developers can leverage the Azure AI Agent Service or build their agent functionality with individual components from this SDK.

  • Copilot Studio. Copilot Studio is an agent building platform that can be used with the Microsoft 365 Agents SDK to integrate your agent into your applications & create multi-agent patterns with Copilot Studio Agents. To get started, go to the samples folder in this repo and select the Copilot Studio Client sample in your chosen language.

The Microsoft 365 Agents SDK brings together core components to allow for developers to create, manage and utilize AI Services and third-party SDKs to power orchestration and develop custom agent logic functionality.

Using other services with the Agents SDK

Your use of other services in connection with the Microsoft 365 Agents SDK is governed by the respective agreements for those services, which may include codes of conduct and other restrictions

Contributing

Note for Microsoft internal developers

Non-Microsoft developers

  • This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

  • When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Recommended VS Code Extensions

To ensure a consistent development environment, we recommend using the following VS Code extensions:

ExtensionDescription
ESLintIntegrates ESLint into VS Code. Allows you to find and fix problems in JavaScript code.
GitHub Copilot ChatGitHub Copilot is an AI peer programming t

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • agent-plugins/agents-for-js/skills/agents-sdk-typescript/SKILL.md7.8 KBupstream ↗
    ---
    name: agents-sdk-typescript
    description: >
      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.
    ---
    
    ## 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) ID
    - `clientSecret` — Certificates & secrets
    - `tenantId` — 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):**
    ```
    connections__serviceConnection__settings__clientId=<your-app-id>
    connections__serviceConnection__settings__clientSecret=<your-secret>
    connections__serviceConnection__settings__tenantId=<your-tenant-id>
    connectionsMap__0__connection=serviceConnection
    connectionsMap__0__serviceUrl=*
    ```
    
    **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)
    - `serviceUrl` is 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):
    ```
    connections__mainConn__settings__clientId=<app-id-1>
    connections__mainConn__settings__clientSecret=<secret-1>
    connections__mainConn__settings__tenantId=<tenant-id>
    
    connections__teamsConn__settings__clientId=<app-id-2>
    connections__teamsConn__settings__clientSecret=<secret-2>
    connections__teamsConn__settings__tenantId=<tenant-id>
    
    connectionsMap__0__connection=teamsConn
    connectionsMap__0__serviceUrl=https://smba.trafficmanager.net/.*
    connectionsMap__1__connection=mainConn
    connectionsMap__1__serviceUrl=*
    ```
    
    Optional `audience` field on a map entry restricts matching to activities whose JWT `aud` claim equals that value:
    ```
    connectionsMap__0__connection=teamsConn
    connectionsMap__0__serviceUrl=*
    connectionsMap__0__audience=<teams-app-id>
    ```
    
    **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 modern `connections__` format above.
    
    ```
    clientId=<your-app-id>
    clientSecret=<your-secret>
    tenantId=<your-tenant-id>
    ```
    
    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):
    ```
    AgentApplication__UserAuthorization__Handlers__graph__Settings__azureBotOAuthConnectionName=GraphOAuthConnection
    AgentApplication__UserAuthorization__Handlers__graph__Settings__title=Sign in with Microsoft
    AgentApplication__UserAuthorization__Handlers__graph__Settings__text=Please sign in to continue
    AgentApplication__UserAuthorization__Handlers__graph__Settings__invalidSignInRetryMax=3
    AgentApplication__UserAuthorization__Handlers__graph__Settings__enableSso=false
    
    # OBO (on-behalf-of) — auto-exchange on routes using exchangeToken()
    AgentApplication__UserAuthorization__Handlers__graph__Settings__oboConnectionName=OBOConnection
    AgentApplication__UserAuthorization__Handlers__graph__Settings__oboScopes=https://graph.microsoft.com/.default,Mail.Read
    
    # Custom error messages
    AgentApplication__UserAuthorization__Handlers__graph__Settings__invalidSignInRetryMessage=That code was invalid, please try again.
    AgentApplication__UserAuthorization__Handlers__graph__Settings__invalidSignInRetryMessageFormat=Please enter the 6-digit code from the sign-in card.
    AgentApplication__UserAuthorization__Handlers__graph__Settings__invalidSignInRetryMaxExceededMessage=Too many failed attempts. Please try again later.
    ```
    
    **AgenticUserAuthorization handler** (agent-to-agent, no user prompt):
    ```
    AgentApplication__UserAuthorization__Handlers__myHandler__Settings__type=AgenticUserAuthorization
    AgentApplication__UserAuthorization__Handlers__myHandler__Settings__scopes=https://graph.microsoft.com/.default
    AgentApplication__UserAuthorization__Handlers__myHandler__Settings__altBlueprintConnectionName=altConn
    ```
    
    #### 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
    
    ```typescript
    import { startServer } from '@microsoft/agents-hosting-express'
    import { AgentApplication, MemoryStorage, TurnContext, TurnState } from '@microsoft/agents-hosting'
    
    class MyAgent extends AgentApplication<TurnState> {
      constructor() {
        super({ storage: new MemoryStorage() })
    
        this.onConversationUpdate('membersAdded', async (ctx: TurnContext) => {
          await ctx.sendActivity('Hello! Send me a message.')
        })
    
        this.onActivity('message', async (ctx: TurnContext, state: TurnState) => {
          let coun
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/microsoft-agents-agent-plugins-agents-for-js-skills-agents-sdk-typescript.md

// REPO STATS

1.1k stars
93 open issues
Last commit: 6d ago