Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
166367 stories
·
33 followers

.NET MAUI Pager: Simplify Pagination in Data Controls

1 Share

.NET MAUI Pager

TL;DR: The Syncfusion® .NET MAUI Pager makes it easy to add pagination to DataGrid, ListView, CollectionView, and TreeGrid controls. This guide demonstrates how to set up the Pager, connect it to a DataGrid, customize page navigation, and load data on demand.

Displaying hundreds or thousands of records in a single list can make data-heavy screens difficult to navigate. Users may need to scroll through long lists to find specific records, while the application has to manage a large collection of data.

Pagination provides a simpler way to browse large datasets by displaying a limited number of records at a time. Users can move between pages or jump directly to a specific page.

The Syncfusion® .NET MAUI Pager, introduced in Volume 3 2026, provides ready-made navigation controls for this purpose. It works with DataGrid, ListView, CollectionView, and TreeGrid, allowing you to add pagination without building your own navigation interface.

The DataPager supports client-side and on-demand paging, customizable navigation buttons, and programmatic page navigation.

In this blog, we’ll explore how to integrate the DataPager with a DataGrid and use its key features in a .NET MAUI application.

Key features of the .NET MAUI Pager

The Syncfusion DataPager provides the following capabilities:

  • Page navigation: Move between the first, previous, next, and last pages, or select a page number directly.
  • Multiple data controls: Supports DataGrid, ListView, CollectionView, and TreeGrid through PagedSource.
  • On-demand paging: Load records from a service or database when users navigate to a page.
  • Flexible navigation: Choose which navigation buttons to display and use ellipsis for large page ranges.
  • Customization: Configure button shapes, sizes, spacing, colors, and orientation.
  • Programmatic control: Navigate between pages using commands and methods.
  • Events: Respond to page changes and cancel navigation when necessary.

Let’s see how to use these features in an application.

Get started with the .NET MAUI Pager

Before building the application, ensure you have:

  • .NET 10 or later with the .NET MAUI workload installed.
  • Visual Studio with .NET MAUI support or Visual Studio Code with the .NET MAUI extension.
  • Syncfusion.Maui.DataPager and Syncfusion.Maui.DataGrid NuGet packages, version 35.1.37 or later.
  • A valid Syncfusion license key.

If the .NET MAUI workload is not installed, run:

dotnet workload install maui

Install the NuGet packages

Create a .NET MAUI project and install the required packages:

dotnet add package Syncfusion.Maui.DataPager
dotnet add package Syncfusion.Maui.DataGrid

The DataPager package provides pagination functionality. The DataGrid package is required for the example in this blog.

Register the license and configure Syncfusion

Open MauiProgram.cs and register your Syncfusion license key before building the application. Also, configure the Syncfusion core:

using Syncfusion.Licensing;
using Syncfusion.Maui.Core.Hosting;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        SyncfusionLicenseProvider.RegisterLicense("YOUR-LICENSE-KEY");

        var builder = MauiApp.CreateBuilder();

        builder
            .UseMauiApp<App>()
            .ConfigureSyncfusionCore();

        return builder.Build();
    }
}

Keep your license key out of source control. You can store it in an environment variable or a secrets file instead of hard-coding it into a committed file.

Add pagination to a DataGrid

Let’s create an order-management screen that displays 1,000 sample orders in a DataGrid, with 20 records on each page.

Create the data source

First, create an OrderInfo model and an OrdersViewModel class in a file named OrdersViewModel.cs.

using System.Collections.ObjectModel;

namespace PagerDemo;

public class OrderInfo
{
    public string OrderID { get; set; }
    public string CustomerID { get; set; }
    public string Customer { get; set; }
    public string ShipCity { get; set; }
    public string ShipCountry { get; set; }

    public OrderInfo(string orderId, string customerId, string customer,
                     string shipCity, string shipCountry)
    {
        OrderID = orderId;
        CustomerID = customerId;
        Customer = customer;
        ShipCity = shipCity;
        ShipCountry = shipCountry;
    }
}

public class OrdersViewModel
{
    public ObservableCollection<OrderInfo> OrderInfoCollection { get; }

    private static readonly string[] CustomerNames =
        { "Maria Anders", "Ana Trujillo", "Antonio Moreno", "Thomas Hardy" };

    private static readonly string[] ShipCities =
        { "Berlin", "Munich", "Hamburg", "Paris", "Lyon", "Marseille" };

    private static readonly string[] ShipCountries =
        { "Germany", "France", "United Kingdom" };

    public OrdersViewModel()
    {
        OrderInfoCollection = new ObservableCollection<OrderInfo>();

        for (int i = 1; i <= 1000; i++)
        {
            OrderInfoCollection.Add(new OrderInfo(
                (10000 + i).ToString(),
                $"CUST{i:0000}",
                CustomerNames[(i - 1) % CustomerNames.Length],
                ShipCities[(i - 1) % ShipCities.Length],
                ShipCountries[(i - 1) % ShipCountries.Length]));
        }
    }
}

The OrderInfoCollection contains all 1,000 sample records. We’ll bind this collection to the DataPager.

Add DataGrid and DataPager

Open MainPage.xaml. Set its BindingContext to the OrdersViewModel, then add the DataGrid and DataPager:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:PagerDemo"
             xmlns:syncfusion="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid"
             xmlns:sfpager="clr-namespace:Syncfusion.Maui.DataPager;assembly=Syncfusion.Maui.DataPager"
             x:Class="PagerDemo.MainPage">

    <ContentPage.BindingContext>
        <local:OrdersViewModel />
    </ContentPage.BindingContext>

    <Grid RowDefinitions="*,Auto">

        <syncfusion:SfDataGrid
            Grid.Row="0"
            ItemsSource="{Binding Source={x:Reference dataPager}, Path=PagedSource}">

            <syncfusion:SfDataGrid.Columns>
                <syncfusion:DataGridTextColumn MappingName="OrderID" HeaderText="Order ID" />
                <syncfusion:DataGridTextColumn MappingName="CustomerID" HeaderText="Customer ID" />
                <syncfusion:DataGridTextColumn MappingName="Customer" HeaderText="Customer" />
                <syncfusion:DataGridTextColumn MappingName="ShipCity" HeaderText="Ship City" />
                <syncfusion:DataGridTextColumn MappingName="ShipCountry" HeaderText="Ship Country" />
            </syncfusion:SfDataGrid.Columns>
        </syncfusion:SfDataGrid>

        <sfpager:SfDataPager
            x:Name="dataPager"
            Grid.Row="1"
            HorizontalOptions="Fill"
            VerticalOptions="Center"
            HeightRequest="50"
            ButtonSize="36"
            ButtonSpacing="8"
            ButtonFontSize="14"
            PageSize="20"
            NumericButtonCount="5"
            Source="{Binding OrderInfoCollection}" />

    </Grid>
</ContentPage>

Here is how the two controls work together:

  • Source connects the DataPager to the complete order collection.
  • PageSize="20" displays 20 records on each page.
  • NumericButtonCount="5" displays five page numbers at a time.
  • PagedSource provides the records for the currently selected page to the DataGrid.

The DataPager handles page navigation, while the DataGrid displays the corresponding records.

Since the collection contains 1,000 records and each page displays 20, the Pager automatically calculates 50 pages.

Pagination in .NET MAUI DataGrid using the Pager
Pagination in .NET MAUI DataGrid using the Pager

What you’ll see: A DataGrid displaying 20 orders at a time, with navigation controls underneath to browse all 50 pages.

Use the Pager with other data controls

The DataPager isn’t limited to the DataGrid. You can also connect it to ListView, CollectionView, and TreeGrid.

The approach is similar: bind the Pager’s Source to your collection and bind the data control’s ItemsSource to the Pager’s PagedSource.

For example, with a CollectionView:

<CollectionView
    ItemsSource="{Binding Source={x:Reference dataPager}, Path=PagedSource}" />

You can use the same binding approach with ListView and TreeGrid. This allows you to reuse the Pager across different data presentation controls.

Customize page navigation

The DataPager provides options to control which navigation buttons appear and how users move between pages.

Choose navigation buttons

Use the DisplayMode property to select the buttons you want to display.

DisplayModeButtons displayed
FirstLastPreviousNextNumericFirst, Last, Previous, Next, and numeric buttons
PreviousNextNumericPrevious, Next, and numeric buttons
FirstLastNumericFirst, Last, and numeric buttons
FirstLastPreviousNextFirst, Last, Previous, and Next
NumericNumeric buttons only
NoneNo navigation buttons

For a compact layout on smaller screens, you can display only the previous, next, and numeric buttons:

<sfpager:SfDataPager
    DisplayMode="PreviousNextNumeric"
    PageSize="20"
    Source="{Binding OrderInfoCollection}" />

Handle large page ranges with ellipsis

When an application has many pages, displaying every page number can make the Pager difficult to use.

The AutoEllipsisMode property helps manage long page ranges by displaying an ellipsis that users can select to move through additional page numbers.

It supports None, Before, After, and Both modes.

<sfpager:SfDataPager
    AutoEllipsisMode="Both"
    PageSize="25"
    Source="{Binding OrderInfoCollection}" />

You can also customize the ellipsis label using AutoEllipsisText.

Customize the appearance

The DataPager provides properties to adjust its layout and navigation buttons.

PropertyPurpose
ButtonShapeSets buttons to circular or rectangular shapes.
ButtonSizeControls button size.
ButtonSpacingSets the spacing between buttons.
ButtonFontSizeAdjusts button text size.
ButtonCornerRadiusControls button corner rounding.
OrientationArranges the Pager horizontally or vertically.

To customize button colors, use DataPagerStyle through the DefaultStyle property:

<sfpager:SfDataPager
    ButtonShape="Rectangle"
    ButtonCornerRadius="6">

    <sfpager:SfDataPager.DefaultStyle>
        <sfpager:DataPagerStyle
            NumericButtonSelectionBackgroundColor="#0057FF"
            NumericButtonSelectionTextColor="White"
            NumericButtonTextColor="#1C1B1F"
            NavigationButtonIconColor="#49454F"
            NavigationButtonDisableIconColor="#9E9E9E" />
    </sfpager:SfDataPager.DefaultStyle>

</sfpager:SfDataPager>

Choose colors with sufficient contrast so users can easily identify the selected page and distinguish disabled navigation buttons.

Implement on-demand paging

In the previous example, the application loads all 1,000 records into memory, even though the DataGrid displays only 20 at a time.

For larger datasets or data retrieved from remote services, loading every record may not be practical. On-demand paging addresses this by requesting records only when a user navigates to a page.

To enable it, set UseOnDemandPaging to True, specify the total number of pages using PageCount, and handle the OnDemandLoading event.

<sfpager:SfDataPager
    x:Name="dataPager"
    UseOnDemandPaging="True"
    PageSize="20"
    PageCount="50"
    OnDemandLoading="OnDemandLoading" />

Handle the loading event in the page’s code-behind:

private void OnDemandLoading(object? sender, OnDemandLoadingEventArgs e)
{
    var items = orderService.GetOrders(e.StartIndex, e.PageSize);
    dataPager.LoadDynamicItems(e.StartIndex, items);
}

Here:

  • StartIndex identifies the starting position of the requested records.
  • PageSize specifies how many records to retrieve.
  • LoadDynamicItems() supplies the requested records to the Pager.

The orderService represents your application’s own data service. It is responsible for retrieving records from a database or remote API.

For example, a service can retrieve the requested range from a collection:

public class OrderService
{
    private readonly List<OrderInfo> all = GetAllOrders();

    public int TotalCount => all.Count;

    public IEnumerable<OrderInfo> GetOrders(int startIndex, int count)
    {
        return all.Skip(startIndex).Take(count);
    }

    private static List<OrderInfo> GetAllOrders()
    {
        // Load or generate the sample order records.
        return new List<OrderInfo>();
    }
}

Set PageCount using the total number of records and the configured page size:

dataPager.PageCount = (int)Math.Ceiling(
    orderService.TotalCount / (double)dataPager.PageSize);

Update the page count when the total number of records changes, such as after applying a filter.

When should you use each approach?

  • Client-side paging: Suitable when the complete dataset is manageable and can be loaded into the application.
  • On-demand paging: Suitable for large datasets or remote data sources where retrieving all records at once is unnecessary.

Note that on-demand paging requires your application to implement the data retrieval logic. The Pager manages page navigation and loading requests, while your service retrieves the actual records.

Handle page navigation programmatically

You can also control page navigation through events, commands, and methods.

Respond to page changes

The DataPager provides two events:

  • PageChanging: Occurs before navigation. You can cancel the operation when necessary.
  • PageChanged: Occurs after navigation is completed.

For example, use PageChanging to prevent users from leaving a page while they have unsaved changes:

dataPager.PageChanging += (s, e) =>
{
    if (hasUnsavedChanges)
        e.Cancel = true;
};

dataPager.PageChanged += (s, e) =>
{
    statusLabel.Text =
        $"Moved from page {e.OldPageIndex + 1} to {e.NewPageIndex + 1}";
};

The page index is zero-based, so add one when displaying page numbers to users.

For MVVM-based applications, the DataPager provides commands such as:

  • NavigateToFirstPageCommand
  • NavigateToPreviousPageCommand
  • NavigateToNextPageCommand
  • NavigateToLastPageCommand
  • NavigateToPageCommand

You can also use these methods in code-behind:

  • dataPager.MoveToFirstPage();
  • dataPager.MoveToPreviousPage();
  • dataPager.MoveToNextPage();
  • dataPager.MoveToLastPage();
  • dataPager.MoveToPage(2);

The MoveToPage(2) example navigates to the third page because page indexes start at zero.

Build Modern .NET MAUI Apps Faster

Add pagination, data grids, charts, schedulers, and more to your apps with Syncfusion .NET MAUI controls, with built-in theming, data binding, and consistent behavior across Android, iOS, Windows, and macOS.

Start Your Free Trial

Conclusion

The Syncfusion® .NET MAUI Pager provides a straightforward way to add pagination to DataGrid, ListView, CollectionView, and TreeGrid controls. You can use client-side paging for manageable collections or on-demand paging for large and remote datasets.

With customizable navigation buttons, styling options, events, and programmatic navigation, the Pager gives developers flexibility when building data-heavy .NET MAUI applications.

The Pager is available in Essential Studio 2026 Volume 3. Existing customers can get it from the License and Downloads page, while new users can explore it with a 30-day free trial.

Testflight 2x
Appcenter 2x
Googleplay 2x
Microsoft 2x
Github 2x

Frequently asked questions

Does the DataPager automatically calculate the total number of pages?

Yes. When using client-side paging, the DataPager calculates the page count based on the number of records in the source collection and the configured PageSize.

Does changing the PageSize affect the total number of pages?

Yes. Changing the PageSize changes the number of records displayed per page and recalculates the total number of pages accordingly.

Can I update the data displayed by the DataPager after applying a filter?

Yes. Update the source collection with the filtered records. When using on-demand paging, also update PageCount to reflect the filtered record count.

Does the DataPager retrieve data from a database automatically?

No. The DataPager handles pagination and raises loading requests. Your application must implement the data retrieval logic through a service, API, or database query.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Strings in text-overflow: A Win for Truncated Text!

1 Share

What does text-overflow: <string> do, exactly? Well, text-overflow: ellipsis adds an ellipsis (…) to the end of the line box, replacing however many characters it takes up.


Strings in text-overflow: A Win for Truncated Text! originally handwritten and published with love on CSS-Tricks. You should really get the newsletter as well.

Read the whole story
alvinashcraft
22 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Announcing TypeScript 7.1 RC

1 Share

Today we’re excited to announce the Release Candidate (RC) of TypeScript 7.1!

npm install -D typescript@rc

Let’s take a look at what’s new in TypeScript 7.1!

What’s New Since the Beta?

Since TypeScript 7.1 Beta, we’ve shipped a number of additions, refinements, and performance improvements. Beyond even better speed and memory usage, the release candidate improved upon functionality in the API, gave more powerful features and defaults for content mapper packages, and introduced a new --disableDynamicImportExtensionRewriting. Additionally, an experimental WebAssembly package has been published which makes it easier for TypeScript 7.1 to run in the browser and within WASI runtimes.

Support for Import Attributes in Ambient Modules

Import attributes are metadata that are attached to import statements. Typically, they’re meant to instruct runtimes and bundlers on how to interpret the content of an import, as well as the shape of the resulting module. For example,

import myData from "./data/someData.json" with { type: "json" };

Everything in the object following the with keyword is an import attribute. Environments like browsers can’t simply decide how to deal with an import based on file name extensions like .json. Specifying type: "json" tells whatever runtime that someData.json needs to be interpreted as a JSON file, parsed out, and provided via a default import (in our example above, that’s myData).

The type attribute has become the de facto way for runtimes to customize this behavior. ECMAScript (JavaScript) has a proposal that allows code to specify type: "text", which returns the import’s contents as a string.

import readme from "../README.md" with { type: "text" };

console.log(readme);

There is also a proposal for type: "bytes" to return a Uint8Array of raw bytes.

import { pngToPixels, boxBlur } from "./photoUtils.js";

import photo from "./myPhoto.png" with { type: "bytes" };
const blurryPhoto = boxBlur(pngToPixels(photo));

Browsers have also allowed importing CSS files as CSSStyleSheets with type: "css" for a few years now.

import someTheme from "./themes/someCoolTheme.css" with { type: "css" };

document.adoptedStyleSheets.push(someTheme);

To support importing these files, people might use ambient module declarations in TypeScript using a wildcard pattern (e.g. *.css).

// You can write this in a global `.d.ts` file with no import statements.

declare module "*.css" {
    const content: CSSStyleSheet;
    export default content;
}

declare module "*.txt" {
    const content: string;
    export default content;
}

declare module "*.md" {
    const content: string;
    export default content;
}

declare module "*.bin" {
    const content: Uint8Array;
    export default content;
}

This is okay, but it doesn’t work for all environments as it doesn’t account for import attributes at all.

You might ask why this is an issue – at first glance, it seems like the only problem is that it just allows people to accidentally leave off an import attribute.

// ❌ oops, forgot an import attribute
import readme from "../README.md";

// ✅ what we were supposed to write
import readme from "../README.md" with { type: "text" };

But that is still a problem worth fixing. Another issue is that it becomes repetitive. With import attributes, the entire issue is that the runtime cares about the attributes, not the file extension. We shouldn’t have to re-declare a pattern for both .txt and .md files if both were going to use type: "text".

But a major issue is that runtime environments may support different import attributes entirely, and may act differently depending on whether they’re present. For example, bundlers might use a build-time feature called CSS Modules as the default behavior when importing .css files, but specifying the browser-supported type: "css" in the import statement will override this behavior and ensure the .css file is brought in as a CSSStyleSheet object.

That’s why TypeScript 7.1 introduces support for import attributes in ambient module declarations. You can now declare the following in your TypeScript projects, get an error if you try to import a file without the required import attributes, and get the correct type based on the import attributes.

declare module "*" with { type: "css" } {
    const content: CSSStyleSheet;
    export default content;
}

declare module "*" with { type: "text" } {
    const content: string;
    export default content;
}

declare module "*" with { type: "bytes" } {
    const content: Uint8Array;
    export default content;
}

Note that imports matching these declarations are not validated against files on disk. As is currently the behavior when an import matches an ambient module declaration, failed lookups will be reported at runtime or during a bundler’s build process.

Also note that these declarations are not shipped as part of the TypeScript built-in libraries. We recommend libraries not include them in their published packages, and end-users will need to declare them in their own projects if necessary. That will provide end-users with flexibility on how the global scope is configured (e.g. lib.dom.d.ts versus @types/node) and will prevent conflicts with built-in declarations in the future.

For more information, see our implementing pull request here.

Source Phase Imports

Source phase imports are a proposed new feature in ECMAScript. The feature introduces a new source modifier/keyword that follows the import keyword. Only default imports can be written with import source.

import source SomeModule from "some-module";

The idea with this feature is that when we use import source, we’ll get back an object that represents the module after it’s been parsed and analyzed by the runtime, but before its imports have been loaded (and therefore, before they have been validated or linked against other modules, and before any code contained in the module can run). This object on its own is kind of “inert” – it’s an instance of something called an AbstractModuleSource which is eventually meant to be imported or instantiated.

For WebAssembly (wasm) imports, that object will be an instance of a WebAssembly.Module. What’s useful with these objects is that they can be passed directly into WebAssembly.instantiate.

import source SuperFastThing from "./super-fast-thing.wasm";
import { WASI } from "node:wasi";

const wasi = new WASI({ /*...*/ });
const fastThingInstance = await WebAssembly.instantiate(SuperFastThing, {
    wasi_snapshot_preview1: wasi.wasiImport
});

wasi.start(fastThingInstance);

WebAssembly source imports are already supported in recent versions of Node.js.

At the moment, you can’t do much with a source import of a JavaScript file. The spirit of the proposal implies at some point we might be able to pass a JavaScript module source directly into an import() call.

import source SomeModule from "./someModule.js";
const moduleInstance = await import(SomeModule);

Another part of the idea with JavaScript source imports is that, over time, we may gain other features that will allow us to be able to customize behavior around how modules are loaded and instantiated, similar to how we did with WebAssembly.instantiate above. But we’re not there yet, and in fact, many environments and tools still don’t currently support JavaScript source imports in the first place.

Source imports aren’t limited to import statements though. You can also perform a dynamic source import as well via the import.source meta-property function.

const SuperFastThing = await import.source("./super-fast-thing.wasm");
const fastThingInstance = await WebAssembly.instantiate(SuperFastThing, {
    // ...
});

Source imports retain identity. That means you can use them in Maps and Sets, or compare against them reliably.

// Note that `WebAssembly.instantiate` always returns a distinct object.
import source source1 from "./plugin.wasm"
import source source2 from "./plugin.wasm"
const source3 = await import.source("./plugin.wasm");

console.log(source1 === source2); // true
console.log(source2 === source3); // true

When using import source, every imported module has the type AbstractModuleSource, a new global type in lib.esnext.d.ts. You must have an appropriate --module setting (i.e. esnext, nodenext, or preserve) to use source imports, as well as the appropriate esnext option in --lib or --target.

This feature was implemented thanks to the work of Oleksandr Tarasiuk.

--target es2026

TypeScript 7.1 now supports es2026 as a stable --target and --lib option. Only lib additions are significant, as declarations have been added, or moved from esnext as proposed features have stabilized in ECMAScript 2026.

Stabilizations in --lib es2026 include:

  • Math.sumPrecise()
  • Iterator.concat()
  • JSON.rawJSON()
  • A JSON.parse() overload for parsing with original text
  • Error.isError()
  • Map.prototype.*
    • getOrInsert()
    • getOrInsertComputed()
  • WeakMap.prototype.*
    • getOrInsert()
    • getOrInsertComputed()
  • Uint8Array.prototype.*
    • toBase64()
    • setFromBase64()
    • toHex()
    • setFromHex()
  • Uint8Array.fromHex()
  • Uint8Array.fromBase64()
  • Array.fromAsync()

The work of creating the new targets, as well as many of the declaration files themselves, was done thanks to Oleksandr Tarasiuk.

New Library Methods

--lib esnext now includes a few proposed library methods in ECMAScript including:

Support for these Promise methods and Iterator methods was provided thanks to Oleksandr Tarasiuk.

TypeScript 7.1 API

TypeScript 7.1 ships a new API that allows building powerful tools and utilities using our syntactic and semantic analyses.

Rather than exposing a monolithic API, TypeScript 7.1 is organized into several entry points, each serving a specific purpose.

Entry point Purpose
typescript/sync A synchronous compiler client, which supports compiler options, type-checker and program APIs
typescript/async A Promise-based equivalent of the sync client
typescript/fs Request-scoped full and layered filesystems
typescript/ast Syntax tree node (AST) types and enums such as SyntaxKind and ScriptTarget
typescript/ast/is Node type guards
typescript/ast/factory create* and immutable update* functions
typescript/wasm (Experimental) WebAssembly (wasip1) entry-point for when @typescript/typescript-wasip1/wasm is installed

Here’s an example of how to conduct a simple compilation using the TypeScript 7.1 API, with filenames and compiler options passed explicitly on the command line. Unlike tsc, this example does not discover or load a tsconfig.json file and does not support --project.

// Compile explicit filenames using command-line compiler options.

import { API, formatDiagnosticsWithColorAndContext, type Diagnostic } from "typescript/sync";

using api = new API();
const reportErrors = (diagnostics: readonly Diagnostic[]) => {
    console.log(formatDiagnosticsWithColorAndContext(diagnostics, api))
};

// Parse command-line filenames and compiler options, report any errors.
const commandLineArgs = process.argv.slice(2);
const parsedCommandLine = api.parseCommandLine(commandLineArgs);
if (parsedCommandLine.errors.length > 0) {
    reportErrors(parsedCommandLine.errors);
    process.exit();
}

// Create the program by resolving and parsing all files in the entry point.
using program = api.createProgram(parsedCommandLine.fileNames, parsedCommandLine.options);

// Collect and report any diagnostics from the program before emitting.
// You can customize whether any of these block reporting errors in subsequent passes if desired.
const diagnostics = [
    ...program.getGlobalDiagnostics(),
    ...program.getProgramDiagnostics(),
    ...program.getSyntacticDiagnostics(),
    ...program.getSemanticDiagnostics(),
];
if (diagnostics.length > 0) {
    reportErrors(diagnostics);
}

// Emit files - this respects the `noEmitOnError` option,
// so nothing will be emitted if an earlier step reported errors.
const emitResult = program.emit();
if (emitResult.diagnostics.length > 0) {
    reportErrors(emitResult.diagnostics);
}

Notice the using keyword in our declarations above. You might not be familiar with using since it’s somewhat new in JavaScript, but don’t fret.

API instances and Program instances are both Disposable objects. When we ask to create them, TypeScript allocates memory and does book-keeping to make sure they stick around between the Go and JavaScript runtimes; however, when we are done with them, we can’t just let the garbage collector deal with them or else we’ll leak on the Go side. Instead, we have to do one of the following:

  • manually dispose of them with explicit method calls (e.g. api.close(), program.dispose(), or api[Symbol.dispose]()), or
  • automatically dispose of them when they go out of scope by declaring them with the using keyword.

After a program is disposed, we won’t be able to use it again.

Snapshots

Above, we modeled a straight-line “batch” compilation with the API; but lots of workflows with TypeScript are oriented around changes that might occur over time. Rather than build up the entire world every time we need, TypeScript is able to model transitions in state with new file updates – either on disk or as a user types.

Core to the API is the concept of a snapshot. A snapshot is a version of all the projects and programs at a point in time. We can always create a fresh snapshot with all the information we need with api.createSnapshot, but we can also derive a new snapshot from a prior one with the snapshot.update(/*...*/). This can often save a lot of work, both in sending over all the original information and having the compiler rebuild the world.

import { ScriptTarget } from "typescript/ast";
import { createFileSystemLayer, createFileSystemWithLib } from "typescript/fs";
import { API } from "typescript/sync";
import { resolve } from "node:path";

const fileName = resolve("snapshot-example.ts");

using api = new API();
using before = api.createSnapshot({
    fileSystem: createFileSystemWithLib([
        [fileName, 'export const answer: number = "forty-two";'],
    ]),
    createPrograms: [
        {
            rootFiles: [fileName],
            compilerOptions: {
                strict: true,
                noEmit: true,
                target: ScriptTarget.ES2022,
            },
        },
    ],
});

using beforeProgram = before.operation.createdPrograms[0];
console.log("before:", beforeProgram.getSemanticDiagnostics().length);

using after = before.update({
    fileSystem: createFileSystemLayer([
        [fileName, "export const answer: number = 42;"],
    ]),
    ensurePrograms: [beforeProgram.id],
});

using afterProgram = after.getProgram(beforeProgram.id);
if (!afterProgram) {
    throw new Error("The updated program was not found.");
}

console.log("after:", afterProgram.getSemanticDiagnostics().length);
console.log("before again:", beforeProgram.getSemanticDiagnostics().length);

// Outputs:
//  before: 1
//  after: 0
//  before again: 1

We’ll come back to those file system APIs in a bit.

One thing to notice here is that we were able to start with an original snapshot named before and derive a new snapshot after making a change called after. Snapshots can contain Program objects (and Projects) which have ids that persist between snapshot changes. We used ensurePrograms to specify the Programs which we care to observe updates on in the new snapshot (the current default is lazier and allows you to stack update() calls without forcing updates to Programs).

Notice that even after calling update, we’re able to use information from the prior snapshot. For example, we can still ask for diagnostics on both beforeProgram and afterProgram. That said, make sure you don’t mix and match objects derived from one snapshot’s program, project, or checker.

Snapshots are Disposables like our other types above, so we’ll need to either manually dispose() them or create a local binding for them with using declarations. After a Snapshot is disposed, we can’t use it again.

File System APIs

By default, TypeScript’s APIs will operate over the host file system. That means that it will hit files “on disk” unless we say otherwise.

Function Behavior
createFileSystem(files) Defines a complete file system. Unlisted files are absent, unless explicitly mounted.
createFileSystemWithLib(files) Defines a complete file system and mounts a read-only directory with the compiler’s default libraries.
createFileSystemLayer(files) Overrides selected files while falling back to the base snapshot’s file system, or the host file system.
createFileSystemFromSnapshot(oldSnapshot, extraFSLayer?) Reapplies the synthetic file system overrides from an earlier snapshot onto a newer snapshot, optionally layering additional changes on top.

In our earlier example, we created a (partial) virtual file system with createFileSystemWithLib and specified only the file in our program that we cared about. When we wanted to make an update, we were able to just use createFileSystemLayer for only the files that changed, and other files (like lib.d.ts and anything else) continued to resolve through the base file system layer that we made in our initial snapshot.

// ...

using snapshot = api.createSnapshot({
    fileSystem: createFileSystemWithLib([
        [
            mainFile,
            [
                'import { greeting } from "./generated.js";',
                "export const message: string = greeting;",
            ].join("\n"),
        ],
        [generatedFile, 'export const greeting = "Hello from memory!";'],
    ]),
    createPrograms: [
        {
            rootFiles: [mainFile],
            compilerOptions: {
                strict: true,
                module: ModuleKind.ESNext,
                moduleResolution: ModuleResolutionKind.Bundler,
                target: ScriptTarget.ES2022,
            },
        },
    ],
});

using program = snapshot.operation.createdPrograms[0];

// ...
// Get emit without writing files to any file system.
const emitResult = program.emitToString();

There are some ways to control how files are observed over these layers. For example, removedPaths can block out requests from the underlying system. You can also use createFileSystemFromSnapshot to carry forward layered file system overrides across newer snapshots (such as updated LSP snapshots) without re-sending unchanged virtual files.

If you need to provide some level of file watching, that currently needs to be done separately. File creations/deletions/modifications need to be provided via the fileNotifications option in snapshot.update(). Any modifications that occur that aren’t in the host file system need to be provided with another file system layer.

Content Mappers

TypeScript has long had powerful checking and tooling for TypeScript and JavaScript code; however, lots of developers use specialized file types for writing out their components. For example, Vue.js has regions of HTML, JavaScript, and CSS all within a single .vue file, along with embedded regions for JavaScript in that HTML. The same is true for libraries like Astro, Ember, Svelte, and others – these frameworks follow a similar way of declaring their components. At some point, a project called Volar emerged to provide TypeScript tooling for these single-file component formats to provide a seamless development experience in the editor. Volar surfaces errors, code completions, navigation, and more by using TypeScript’s language services, and has been able to extend its capabilities to other formats, such as MDX files.

Unfortunately, one of the challenges with Volar was that TypeScript lacked some of the APIs to easily provide a cohesive experience. For example, while Volar’s model shined for editor support, command-line type-checkers for these other file formats could not really use Volar because they integrate with completely different APIs from TypeScript. Another issue was the fact that Volar either had to embed TypeScript as a subcomponent and completely take over the editor experience, or it had to use awkward workarounds to integrate with the existing TypeScript tooling given limitations in our APIs. With TypeScript 7.0, we took an opportunity to rethink how the toolset could better support formats that embed JavaScript and TypeScript code. In fact, with TypeScript 7.1, Volar’s core model is now a first-class citizen.

TypeScript 7.1 introduces support for a new plugin point called content mappers. A content mapper can be registered with a specific file extension, and is able to produce a virtual representation of a file for TypeScript to see. This representation also has regions that map back to the original file, typically in the regions that contain the corresponding JavaScript or TypeScript code. That allows TypeScript to provide more accurate error messages and spans, and provide tooling for these embedded regions.

To use a content mapper, you’ll need to register it with a specific set of extensions in your project’s tsconfig.json. For example, if we installed a package called @vue/content-mapper (which is not currently on npm), we could include it in our tsconfig.json as follows:

{
  "compilerOptions": {
    // ...
  },
  "contentMappers": [
    {
      "package": "@vue/content-mapper",
      "extensions": [".vue"],
      "options": {
        "target": 3.5
      }
    }
  ]
}

Whenever a file is included in the program – whether that’s via files/include in your tsconfig.json, or through an import, TypeScript will check for registered content mappers and request content and mappings for that file. We can then run directly from the command line.

tsc --runExternalCode

Note the --runExternalCode flag, which is required to allow TypeScript to execute content mappers. Content mappers are effectively arbitrary executables that TypeScript dispatches to, so the --runExternalCode flag makes that explicit.

In editors like VS Code, TypeScript 7.1 “just works” with content mappers, though it requires both workspace trust and content mapper permissions to be granted. In our VS Code extension, you’ll have the power to also disable this entirely by configuring the new js/ts.contentMappers.enabled setting.

Content mappers have already been prototyped or implemented for various libraries and frameworks, including:

We even have an example content mapper for HTML files supporting <script> tags and event handler attributes.

For more information, see the write-up of content mappers on the implementing pull request.

More on the API

We’ll have more examples of our API in the near future, but we’re working with partner teams to ensure TypeScript 7.1’s API is both ergonomic and provides the appropriate performance for real-world usage. Feel free to give us some feedback on what works and doesn’t work for you!

--disableDynamicImportExtensionRewriting

When --rewriteRelativeImportExtensions is enabled, TypeScript normally emits a small runtime helper to rewrite file extensions in non-literal dynamic import() and require() calls. For example, if a user wrote import(dir + "/foo.ts"), the argument to import is intercepted with a call to a function that can rewrite the file extension according to the configured import extension rules.

However, this can often run into issues when content mappers decide on an output extension for their files and also specify which files should be included (e.g. a combination of a content mapper specifying both outputExtensions and an include glob filter). The runtime helper lacks the capability to reliably rewrite these paths, so a dynamic path import written under a combination of these options will trigger a new error.

TypeScript 7.1 adds a new --disableDynamicImportExtensionRewriting compiler option to opt out of emitting that runtime helper entirely.static relative import extension rewriting enabled. This is useful for projects that encounter the above issue, or which simply don’t want the extra runtime helper in the first place. Using --disableDynamicImportExtensionRewriting means that developers or other tools are responsible for writing the “correct” path and validating that it resolves correctly at runtime.

For more information, see the implementing pull request.

Experimental WebAssembly (wasip1) Support

TypeScript 7.1 introduces experimental wasip1/wasm support, allowing TypeScript to run in WebAssembly environments including browsers and VS Code for the Web.

A newly published package @typescript/typescript-wasip1-wasm includes the file lib/tsc.wasm. That WebAssembly file can either be consumed as a library and instantiated (e.g. with instantiateWasm) for API access. It can also be run as a WASI command to use the tsc CLI or LSP server using a WASI runtime like wasmtime, wasmer, or wazero.

This work also enables TypeScript 7.1 to run in the TypeScript Playground, along with experimental support in our extension for running in VS Code in the web.

For more information, see the implementing pull request.

Optimizations

With our last release, we said that TypeScript 7 often achieved somewhere around 10x the performance of TypeScript 6. While we’re proud of that, TypeScript 7.1 brings a ton of new optimizations to reduce memory pressure and speed up builds. Among them are:

Here’s how these improvements translate into real-world performance gains using the default of 4 type-checker threads and under --noEmit:

Performance of TypeScript 7.1 RC, as described by table below Memory Usage of TypeScript 7.1 RC, as described by table below

Codebase TypeScript 7 TypeScript 7.1 RC Speedup Time Reduction
bluesky 3.97s 3.3s 1.2x 16.9%
mui-docs 19.1s 8.77s 2.2x 54.2%
sentry 17.5s 12.8s 1.4x 26.6%
t3code-server 23s 16.9s 1.4x 26.5%
vscode 19.4s 14.9s 1.3x 23.0%
Codebase TypeScript 7 TypeScript 7.1 RC Memory Reduction
bluesky 2,036 MiB 1,466 MiB 28.0%
mui-docs 7,043 MiB 3,580 MiB 49.2%
sentry 6,459 MiB 4,668 MiB 27.7%
t3code-server 6,716 MiB 4,768 MiB 29.0%
vscode 8,401 MiB 6,162 MiB 26.6%

Notable Behavioral Changes

This section highlights a set of noteworthy changes that should be acknowledged and understood as part of any upgrade. Sometimes it will highlight deprecations, removals, and new restrictions. It can also contain bug fixes that are functionally improvements, but which can also affect an existing build by introducing new errors.

lib.d.ts

Types generated for the DOM may have an impact on type-checking your codebase. For more information, see linked issues related to DOM and lib.d.ts updates for this version of TypeScript.

Stronger Checks When Using Distributive Type Parameters

In TypeScript, a conditional type which evaluates against a type variable (e.g., T in T extends Whatever ? TrueType : FalseType) will distribute over union types when they are supplied in place of that type variable. For example:

type Foo<T> = T extends "a" | "b" | "c" ? { known: T } : { unknown: T };

// { known: "a" } | { known: "b" } | { unknown: "x" } | { unknown: "y" }
type Bar = Foo<"a" | "b" | "x" | "y">;

Here, T is a type parameter, and the string literal types "a", "b", "x", and "y" are each individually evaluated against the type on the right side of the extends. The appropriate branch is instantiated for each member of the union, and the resulting types are then unioned together for the type of Bar.

While in each branch of the conditional type above we referred to T, that is not quite the same T as the original type parameter. When distributing, T will represent a more specific subset of the original union type. However, previous versions of TypeScript did not distinguish the two.

type Show<A extends number, B extends A> = `${B} extends ${A}`;

type Issue<A extends number, B extends A> =
    A extends B ?
        never :
        Show<A, B>; // We shouldn't be allowed to write this branch!

In the type Issue, we wrote out Show<A, B> in the false branch, and we’ll show why that shouldn’t be allowed.

The Show type ensures that its second type parameter is a subtype of the first. Under TypeScript 7.0 and prior, that seemed true – the Issue type declares that B extends A, so why wouldn’t that be the case? Well distribution throws a wrench in that assumption.

// Forms the string literal type `"0 extends 1"`
type UhOh = Issue<0 | 1, 0>;

Again, the problem is that while a literal type like 0 is a subtype of the union 0 | 1 as a whole, cracking the union apart in each branch really leaves us with distinct types that could be unrelated. You can reframe this in a different way: a Cat might be a subtype of Animal, but it certainly won’t be a subtype of every type of Animal.

TypeScript 7.1 is stricter about this. In each branch, you can effectively think of T being a new type parameter that is a subtype of the original, but won’t have any relation with other types constrained to the original type parameter.

type Show<A extends number, B extends A> = `${B} extends ${A}`;

type Issue<A extends number, B extends A> =
    A extends B ?
        never :
        Show<A, B>;
//              ~
// error!
// Type 'B' does not satisfy the constraint 'A'.
//   'B' is only assignable to the non-distributed 'A', but 'A' has been distributed here.

Code that encounters this may need to be modified, either removing the original constraint if it’s unnecessary or adding additional conditional type checks to satisfy required constraints of other types.

For more information, see the reporting issue along with the pull request that introduced this change.

What’s Next?

At this point, TypeScript 7.1 is feature-complete, and we anticipate very few changes apart from critical bug fixes ahead of the stable release in the next two weeks. Otherwise, our focus will be shifting to TypeScript 7.2 with more details coming soon.

So give the RC a try today, let us know what you think!

Happy Hacking!

– Daniel Rosenwasser and the TypeScript Team

The post Announcing TypeScript 7.1 RC appeared first on TypeScript.

Read the whole story
alvinashcraft
39 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Docker and the move to post-quantum cryptography

1 Share

On December 2, the NSA advised organizations to speed up their move to post-quantum cryptography. A joint statement from ONCD, NSA and CISA said recent advances do not present an immediate and widespread threat. We agree with the direction, and we are speeding up our own work.

What you need to know

Should I continue using Docker?

Yes. There is no need to stop using Docker or change how you use Docker today. If that changes, we will notify customers directly.

What is Docker doing? 

Many connections to Docker already use hybrid post-quantum encryption when your client supports it, and so do Docker Hardened Images built on current base images. We are extending hybrid key exchange to the remaining endpoints, starting with Docker Hub image pulls, and aim to cover all Docker endpoints as early in 2027 as possible. We are also planning the move of our signing keys to stronger algorithms, and we will give advance notice before any key you verify against changes.

Recommended actions for users 

  • Keep Docker Desktop, the Docker CLI and Engine, and Docker Sandboxes up to date.
  • Use current Docker Hardened Images (Debian 13, or Alpine 3.22 or later), and rebuild regularly so you receive TLS library updates.
  • Check that your own clients and services use a TLS library that supports hybrid key exchange, such as OpenSSL 3.5 or later. Hybrid key exchange applies only when both ends of a connection support it.
  • If you verify Docker Hardened Images signatures, keep using the published keys. We will announce any change in advance.

Technical details

Hybrid key exchange protects data in transit against traffic recorded now and decrypted later. Signatures, including image and package signing, are a separate migration, covered below.

Where we are today

  • Connections to Docker Hub web application, Docker sign-in, Docker Hardened Images registry (dhi.io), and Docker Desktop and Engine downloads use hybrid post-quantum key exchange (X25519MLKEM768) when the connecting client also supports it.
  • Docker Hardened Images built on Debian 13 or Alpine 3.22 and shipped with OpenSSL 3.5 or later, offers hybrid post-quantum key exchange by default. Applications in those images that use the system OpenSSL only get hybrid key exchange whenever the other end supports it, and TLS library updates arrive through normal image updates. FIPS variants currently use the validated OpenSSL 3.1.2 FIPS provider, which does not support hybrid key exchange. We are moving the FIPS variants to the validated 3.5.9 FIPS provider, which does.
  • Docker Sandboxes (sbx) offers hybrid post-quantum key exchange by default on the outbound connections it makes. If a network blocks the larger handshake, the documented tls.postQuantumKeyExchange setting (sbx 0.55 or later) may be used to turn hybrid key exchange off.
  • For cloud sandboxes, the Docker Sandboxes cloud API and the hosted MCP gateway use hybrid key exchange. The scheduling service does not yet.
  • Image pulls from Docker Hub (docker.io), including Docker Official Images, do not use hybrid key exchange today.

What we are doing next

  • Inventorying all of Docker’s systems to confirm we have a clear plan for hybrid key exchange end-to-end, and taking urgent action wherever this capability is missing.
  • Inventorying the signing keys for Docker Hardened Images, Docker Official Images and our package repositories, and planning their move to stronger algorithms. We will give advance notice and publish the old and new keys side by side for an overlap period before we change any key that customers verify against.
  • Working with the third-party providers that handle some of our connections to make the same upgrades we are making ourselves.
  • Making sure all the tools we ship, such as Docker Desktop and the Docker CLI, offer hybrid key exchange by default, with a documented setting to turn hybrid key exchange off on networks that block the larger handshake. Docker Sandboxes already do both.
  • Documenting which Docker Hardened Images and Docker Official Images include TLS libraries that support hybrid key exchange.

Questions
Contact your account team or security@docker.com. We will continue to provide updates as our work progresses.

Read the whole story
alvinashcraft
45 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

What’s new in Postman: MCP Events and CLI testing

1 Share

An MCP server used to be something you called. You sent a request, got a response, and the conversation was over. Servers that push events change that: a deploy finishes or a build fails, and the server tells you instead of waiting to be asked. Testing that behavior means holding a connection open, picking a delivery mode and reading a stream of payloads as they arrive.

We’ve shipped updates that cover this end to end. MCP Events works in the Postman app, Agent Mode and the Postman CLI. The Postman CLI can now test any MCP server from the terminal. And Fabric connects to OAuth-protected MCP servers that don’t support dynamic client registration. Here’s what changed and how to use each one.

MCP Events in the Postman app, Agent Mode and the CLI

Postman now supports the MCP Events extension (SEP-3415) across MCP requests, Agent Mode and the Postman CLI. Connect to any Model Context Protocol server on protocol version 2026-07-28, subscribe to real-time events, and inspect or react to them from the app or your terminal. It’s available on the Free, Solo, Team and Enterprise plans in Postman app version 12.39.0 and Postman CLI version 1.95.0.

Subscribe from the Events tab

When a server declares the io.modelcontextprotocol/events capability, a new Events tab appears next to Tools, Prompts and Resources. Browse the event types the server offers, fill in typed argument filters and subscribe directly.

To subscribe:

  1. Open an MCP request and connect to your server.
  2. Open the Events tab and select an event type.
  3. Fill in any argument filters.
  4. Choose a delivery mode and click Subscribe.

Incoming events stream into the response timeline as events / <name>, next to subscription status changes (active, gap, error or ended). You can inspect each payload as it arrives.

Pick a delivery mode

Postman supports every delivery mode in the extension, so you can match the mode to how your client runs:

Mode Server method Use it when
Push events/stream You want events delivered over the open connection as they happen
Poll events/poll You want to fetch events on your own schedule
Webhook events/subscribe You want the server to call a URL when an event fires

You can set the SEP-3415 options cursor, maxAgeMs, maxEvents, heartbeatMs and ttlMs from the card UI. The card and the message editor stay in sync in both directions, so a change in one shows up in the other.

Webhook delivery works without extra setup. On desktop and in the CLI, Postman creates a per-user callback URL and tunnel for you. If you’d rather use your own endpoint, you can still provide your own webhook URL.

Ask Agent Mode to listen

You can also describe what you want in plain language. Ask Agent Mode to subscribe to a server’s events, and it picks a delivery mode the server supports, listens in the background and wakes up to react when an event arrives.

List and subscribe from the Postman CLI

The Postman CLI covers the same workflow in the terminal. List what a server offers:

postman mcp events list --url https://mcp.example.com/mcp

The output shows each event type and its delivery modes. The same information is counted in postman mcp inspect. Then stream one event type to your terminal:

postman mcp events subscribe deployment.finished \
  --url https://mcp.example.com/mcp \
  --arg environment=staging \
  --limit 5 \
  --timeout 60 \
  --json

Use --arg or --args to filter events and --cursor to resume from where a previous run stopped. --limit and --timeout bound the run so it finishes on its own. With --json, the CLI writes line-delimited JSON to stdout and keeps logs on stderr, and it exits with structured exit codes, so you can pipe events straight into a script:

postman mcp events subscribe deployment.finished \
  --url https://mcp.example.com/mcp \
  --limit 10 --json \
  | jq -r 'select(.data.status == "failed") | .data.service'

Try changing the delivery mode and the --cursor value to see how each one affects the events you receive.

MCP testing in the Postman CLI

Anything you can do with an MCP request in the Postman app, you can now do from the terminal in headless mode with the Postman CLI. Explore a server, call its tools, prompts and resources, run your MCP scripts and tests, and run MCP requests in a collection run next to your HTTP requests. It works locally, in CI or from your coding agent, on every plan including Consumption Pricing.

Inspect a server

postman mcp inspect connects to a server and reports its name, protocol version, capabilities and everything it exposes. It works with Streamable HTTP servers and with local STDIO servers:

# Remote server over Streamable HTTP
postman mcp inspect --url https://mcp.example.com/mcp

# Local STDIO server
postman mcp inspect --allow-stdio -- node server.js

Call tools, prompts and resources

Each primitive has its own command:

postman mcp tools list --url https://mcp.example.com/mcp
postman mcp tools call create_issue \
  --url https://mcp.example.com/mcp \
  --arg title="Checkout returns 500" \
  --arg priority=high \
  --json

postman mcp prompts list --url https://mcp.example.com/mcp
postman mcp resources list --url https://mcp.example.com/mcp
postman mcp resources templates list --url https://mcp.example.com/mcp

Pass arguments as JSON, or with --arg key=value, which the CLI types from the tool’s input schema. Add --json to get output that scripts and agents can parse.

Reuse saved requests, scripts and tests

If you’ve already built an MCP request in a collection, run it as it is with --request. The CLI uses the saved URL or command, headers, auth and variables. Switch environments with -e or --env-var.

The four script hooks, Before connect, After connect, After response and After disconnect, run in the same order as in the app. Collection and folder mcp:* scripts are inherited too. Here’s an After connect script that checks the server exposes the tool you depend on:

pm.test("Server exposes create_issue", () => {
  const tool = pm.mcp.tools.find((t) => t.name === "create_issue");
  pm.expect(tool).to.exist;
  pm.expect(tool.inputSchema.required).to.include("title");
});

pm.test results print under Tests and appear in the --json output. A failing test exits with code 1, so it fails a CI pipeline without extra wiring.

Run MCP requests in a collection run

postman collection run runs MCP requests with their scripts and tests in the same run as HTTP and other protocols, and values pass between steps. One run can call your API and then check the MCP tool that reads the result.

Sign in and create requests from the CLI

postman mcp login runs the MCP authorization flow in your browser, including discovery, dynamic client registration and PKCE. The CLI then stores and refreshes the tokens. If a server answers 401, the CLI offers to sign you in and retries the command. Over SSH, --no-browser lets you paste the redirect URL back.

To add a request without opening the app, use postman collection request add --type mcp, and attach scripts with --scripts afterResponse:@tests.js.

Non-DCR OAuth for MCP servers in Fabric

Fabric can now connect to OAuth-protected MCP servers that don’t support dynamic client registration, such as Slack and GitHub. You bring your own OAuth app, add it to Fabric and link it to the MCP connection. It’s available on the Free, Solo, Team, Enterprise and Consumption Pricing plans.

To set it up:

  1. Register an OAuth app with the MCP server’s provider, and add the redirect URI that Fabric shows you.
  2. In Admin > OAuth clients, add the app’s client ID, client secret and MCP server URL.
  3. When you create or edit the MCP connection, select that client.

Users then sign in through the provider’s OAuth 2.0 authorization flow. Because the client secret lives in Admin, you set it up once and every user of the connection signs in with their own account.

Try it this week

  • Run postman mcp inspect against an MCP server you use and read what it exposes.
  • If the server declares the events capability, run postman mcp events list, then subscribe to one event type with --limit 5 --json.
  • Add an After connect test for the tools you rely on, save the request in a collection and run it with postman collection run in your pipeline.
  • Register an OAuth app with a provider that doesn’t support dynamic client registration and connect it to Fabric.

Chain these and you can watch an event arrive, check the tool that handles it and gate your pipeline on the result.

Resources

The post What’s new in Postman: MCP Events and CLI testing appeared first on Postman Blog.

Read the whole story
alvinashcraft
52 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

AEO: Showing Up in AI Answers

1 Share
AEO is how your pages get quoted in AI answers and used by agents. Learn how it differs from SEO, what AI crawlers need, and how to measure citations.
Read the whole story
alvinashcraft
59 seconds ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories