npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@teolin/mcp-azure-ad

v3.3.6

Published

MCP server for Azure AD authentication with device code flow

Readme

Azure AD MCP Server

Features

Model Context Protocol (MCP) server for Azure Active Directory authentication using OAuth 2.0 device code flow.

  • Device Code Flow: Interactive authentication for CLI/headless environments
  • Token Caching: Automatically caches and reuses access tokens
  • Authenticated Requests: Make HTTP requests with Azure AD Bearer tokens
  • Token Management: Check auth status and clear cached tokens

Prerequisites

  • Node.js >=18.0.0
  • Azure AD Application Registration
  • Internet connection for authentication
# 1. Register application in Azure Portal
# - Go to Azure AD > App registrations > New registration
# - Name: Your application name
# - Supported account types: Choose appropriate option
# - Redirect URI: Public client/native, use http://localhost
# - Note the Application (client) ID
# - Go to Authentication > Advanced settings
# - Enable "Allow public client flows"

# 2. Setup environment
cp .env.example .env
# Add:
#   AZURE_CLIENT_ID=your-client-id
#   AZURE_AUTHORITY=https://login.microsoftonline.com/common
#   AZURE_SCOPES=https://graph.microsoft.com/.default

# Done! MCP will handle device code flow authentication

Setup

| Method | Pros | Cons | When | | -------------- | ----------------------------- | -------------------------------- | -------------- | | npx | No install, latest version | Slower, needs internet | Quick demos | | Global npm | Instant, offline | Takes disk space, manual updates | Default choice | | Local npm | Version controlled, team sync | Extra disk per project | Shared teams |

# Option 1: npx (fastest)
claude mcp add azuread --scope user -- npx --yes @teolin/mcp-azure-ad
gemini mcp add azuread npx --yes @teolin/mcp-azure-ad

# Option 2: Global install (recommended)
npm install --global @teolin/mcp-azure-ad
claude mcp add azuread --scope user -- azuread-mcp
gemini mcp add azuread azuread-mcp

# Option 3: Local project
npm install @teolin/mcp-azure-ad
claude mcp add azuread --scope project -- node ./node_modules/@teolin/mcp-azure-ad/src/index.js

# Verify
claude mcp list
gemini mcp list

# Remove
claude mcp remove azuread --scope user
gemini mcp remove azuread

Available Tools

1. authenticate

Authenticate with Azure AD using device code flow. Prompts you to visit a URL and enter a code.

2. get_access_token

Get the current access token. Triggers authentication if no valid token exists.

3. check_auth_status

Check if currently authenticated and view token expiration details.

4. clear_token_cache

Clear the cached access token to force re-authentication. Access tokens are cached automatically and reused until expiration (~1 hour).

5. make_authenticated_request

Make an HTTP request with Azure AD authentication.

Parameters:

  • url (string, required): URL to request
  • method (string): HTTP method (GET, POST, PUT, DELETE, PATCH) - default: GET
  • headers (object): Additional headers
  • body (object): Request body for POST/PUT/PATCH

Usage Examples

Example 1: Authenticate and get profile

// In Claude Code:
"Authenticate with Azure AD and get my profile"
// Triggers device code flow, then calls Microsoft Graph API

Example 2: Check authentication status

// In Claude Code:
"Am I authenticated with Azure AD?"
// Shows token status and expiration

Example 3: Make authenticated request

// In Claude Code:
"Get my Azure AD user info"
// Uses: make_authenticated_request with https://graph.microsoft.com/v1.0/me

Example 4: Clear cached token

// In Claude Code:
"Clear my Azure AD authentication cache"
// Removes cached token, requires re-authentication