Skip to main content

Quickstart

Get started with Teams SDK quickly using the Teams Developer CLI.

Set up a new project​

Prerequisites​

Instructions​

Install the Teams Developer CLI​

Install teams globally:

npm install -g @microsoft/teams.cli
teams --version
info

The Teams Developer CLI is the command-line tool for scaffolding, registering, and managing Teams apps. It's currently in Preview.

Creating Your First Agent​

Let's begin by creating a simple echo agent that responds to messages. Run:

teams project new csharp quote-agent --template echo

This command:

  1. Creates a new directory called Quote.Agent.
  2. Bootstraps the echo agent template files into your project directory.
  3. Creates your agent's manifest files, including a manifest.json file and placeholder icons in the Quote.Agent/appPackage directory. The Teams app manifest is required for sideloading the app into Teams.

The echo template creates a basic agent that repeats back any message it receives - perfect for learning the fundamentals.

Running your agent​

  1. Navigate to your new agent's directory:
cd Quote.Agent/Quote.Agent
  1. Install the dependencies:
dotnet restore
  1. Start the development server:
dotnet run
  1. In the console, you should see a similar output:
[INFO] Microsoft.Hosting.Lifetime Now listening on: http://localhost:3978
[INFO] Microsoft.Hosting.Lifetime Application started. Press Ctrl+C to shut down.
[INFO] Microsoft.Hosting.Lifetime Hosting environment: Development

The HTTP server is now listening on port 3978. To test your agent locally without sideloading it into Teams, use the Microsoft 365 Agents Playground.

Install the playground globally:

npm install -g @microsoft/m365agentsplayground

Then, with your agent still running, open a second terminal and launch the playground pointed at your agent:

agentsplayground -e http://localhost:3978/api/messages -c emulator

The playground opens at http://localhost:56150. Send a message in the compose box and your agent's reply renders inline.

Microsoft 365 Agents Playground showing a user message 'hello!' and an agent reply 'you said "hello!"'.

Add to an Existing Project​

If you already have a project and want to add Teams support, install the SDK directly:

Then initialize the Teams app with your existing server:

app.initialize() registers the Teams endpoint on your server without starting a new one — you keep full control of your server lifecycle.

Next steps​

After creating and running your first agent, read about the code basics to better understand its components and structure.

Otherwise, if you want to run your agent in Teams, you can check out the Running in Teams guide.

Resources​