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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@strands-agents/sdk

v0.1.3

Published

TypeScript SDK for Strands Agents framework

Readme


Overview

Strands Agents is a simple yet powerful SDK that takes a model-driven approach to building and running AI agents. The TypeScript SDK brings key features from the Python Strands framework to Node.js environments, enabling type-safe agent development for everything from simple assistants to complex workflows.

Key Features

  • 🪶 Lightweight & Flexible: Simple agent loop that works seamlessly in Node.js and browser environments
  • 🔒 Type-Safe Tools: Define tools easily using Zod schemas for robust input validation and type inference
  • 🔌 Model Agnostic: First-class support for Amazon Bedrock and OpenAI, with extensible architecture for custom providers
  • 🔗 Built-in MCP: Native support for Model Context Protocol (MCP) clients, enabling access to external tools and servers
  • ⚡ Streaming Support: Real-time response streaming for better user experience
  • 🎣 Extensible Hooks: Lifecycle hooks for monitoring and customizing agent behavior
  • 💬 Conversation Management: Flexible strategies for managing conversation history and context windows

Quick Start

Installation

Ensure you have Node.js 20+ installed, then:

npm install @strands-agents/sdk

Basic Usage

import { Agent } from '@strands-agents/sdk'

// Create agent (uses default Amazon Bedrock provider)
const agent = new Agent()

// Invoke
const result = await agent.invoke('What is the square root of 1764?')
console.log(result)

Note: For the default Amazon Bedrock model provider, you'll need AWS credentials configured and model access enabled for Claude 4.5 Sonnet in your region.


Core Concepts

Agents

The Agent class is the central orchestrator that manages the interaction loop between users, models, and tools.

import { Agent } from '@strands-agents/sdk'

const agent = new Agent({
  systemPrompt: 'You are a helpful assistant.',
})

Model Providers

Switch between model providers easily:

Amazon Bedrock (Default)

import { Agent, BedrockModel } from '@strands-agents/sdk'

const model = new BedrockModel({
  region: 'us-east-1',
  modelId: 'anthropic.claude-3-5-sonnet-20240620-v1:0',
  maxTokens: 4096,
  temperature: 0.7
})

const agent = new Agent({ model })

OpenAI

import { Agent } from '@strands-agents/sdk'
import { OpenAIModel } from '@strands-agents/sdk/openai'

// Automatically uses process.env.OPENAI_API_KEY and defaults to gpt-4o
const model = new OpenAIModel()

const agent = new Agent({ model })

Streaming Responses

Access responses as they are generated:

const agent = new Agent()

console.log('Agent response stream:')
for await (const event of agent.stream('Tell me a story about a brave toaster.')) {
  console.log('[Event]', event.type)
}

Tools

Tools enable agents to interact with external systems and perform actions. Create type-safe tools using Zod schemas:

import { Agent, tool } from '@strands-agents/sdk'
import { z } from 'zod'

const weatherTool = tool({
  name: 'get_weather',
  description: 'Get the current weather for a specific location.',
  inputSchema: z.object({
    location: z.string().describe('The city and state, e.g., San Francisco, CA'),
  }),
  callback: (input) => {
    // input is fully typed based on the Zod schema
    return `The weather in ${input.location} is 72°F and sunny.`
  },
})

const agent = new Agent({
  tools: [weatherTool],
})

await agent.invoke('What is the weather in San Francisco?')

Vended Tools: The SDK includes optional pre-built tools:

  • Notebook Tool: Manage text-based notebooks for persistent note-taking
  • File Editor Tool: Perform file system operations (read, write, edit files)
  • HTTP Request Tool: Make HTTP requests to external APIs

MCP Integration

Seamlessly integrate Model Context Protocol (MCP) servers:

import { Agent, McpClient } from "@strands-agents/sdk";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

// Create a client for a local MCP server
const documentationTools = new McpClient({
  transport: new StdioClientTransport({
    command: "uvx",
    args: ["awslabs.aws-documentation-mcp-server@latest"],
  }),
});

const agent = new Agent({
  systemPrompt: "You are a helpful assistant using MCP tools.",
  tools: [documentationTools], // Pass the MCP client directly as a tool source
});

await agent.invoke("Use a random tool from the MCP server.");

await documentationTools.disconnect();

Documentation

For detailed guidance, tutorials, and concept overviews, please visit:


Contributing ❤️

We welcome contributions! See our Contributing Guide for details on:

  • Development setup and environment
  • Testing and code quality standards
  • Pull request process
  • Code of Conduct
  • Security issue reporting

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Security

See CONTRIBUTING for more information on reporting security issues.


⚠️ Preview Status

Strands Agents is currently in public preview. During this period:

  • APIs may change as we refine the SDK
  • We welcome feedback and contributions