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

@majkapp/majk-chat-claude-code

v1.0.31

Published

Claude Code SDK integration for majk-chat

Readme

@majkapp/majk-chat-claude-code

Claude Code SDK integration for majk-chat. This package wraps the official @anthropic-ai/claude-agent-sdk to provide seamless integration with majk-chat's executor pattern.

Features

  • Official SDK Integration - Uses @anthropic-ai/claude-agent-sdk under the hood
  • Dual Authentication - Supports both Anthropic API keys and AWS Bedrock
  • Streaming Support - Real-time streaming with proper message handling
  • Tool Execution - Full access to Claude Code's built-in tools
  • MCP Support - Configure and use Model Context Protocol servers
  • Type Safety - Full TypeScript support with comprehensive types

Installation

npm install @majkapp/majk-chat-claude-code

Usage

Basic Usage

import { ClaudeCodeExecutor } from '@majkapp/majk-chat-claude-code';

const executor = new ClaudeCodeExecutor();

const response = await executor.execute({
  messages: [
    { role: 'user', content: 'List files in current directory' }
  ],
  anthropicApiKey: process.env.ANTHROPIC_API_KEY,
  enableCoreTools: true
});

console.log(response.response.choices[0].message.content);

With AWS Bedrock (Bearer Token)

const response = await executor.execute({
  messages: [
    { role: 'user', content: 'Analyze this codebase' }
  ],
  provider: 'bedrock',
  bedrockApiKey: process.env.AWS_BEARER_TOKEN_BEDROCK,
  awsRegion: 'us-east-1',
  enableCoreTools: true
});

With AWS Bedrock (IAM Credentials)

const response = await executor.execute({
  messages: [
    { role: 'user', content: 'Refactor this module' }
  ],
  provider: 'bedrock',
  awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID,
  awsSecretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  awsRegion: 'us-west-2',
  enableCoreTools: true
});

Streaming Output

const response = await executor.execute({
  messages: [
    { role: 'user', content: 'Explain this code' }
  ],
  anthropicApiKey: process.env.ANTHROPIC_API_KEY,
  outputFormat: 'stream-json',
  onToolCall: (toolCall) => {
    console.log('Tool called:', toolCall.function.name);
  },
  onToolResult: (toolCall, result) => {
    console.log('Tool result:', result);
  }
});

With MCP Servers

const response = await executor.execute({
  messages: [
    { role: 'user', content: 'Search the documentation' }
  ],
  anthropicApiKey: process.env.ANTHROPIC_API_KEY,
  mcpServers: [
    {
      type: 'stdio',
      command: 'node',
      args: ['mcp-server.js']
    }
  ]
});

API Reference

ClaudeCodeExecutor

Methods

execute(options: ClaudeCodeExecutorOptions): Promise<ExecutorResponse>

Execute a query using Claude Code SDK.

getName(): string

Returns 'claude-code'.

supportsStreaming(): boolean

Returns true.

ClaudeCodeExecutorOptions

interface ClaudeCodeExecutorOptions {
  // Core
  messages: Message[];
  provider?: string;
  model?: string;
  temperature?: number;
  maxTokens?: number;
  maxSteps?: number;
  systemPrompt?: string;
  outputFormat?: 'text' | 'stream-json';

  // Authentication - Anthropic
  anthropicApiKey?: string;

  // Authentication - Bedrock
  bedrockApiKey?: string;
  awsAccessKeyId?: string;
  awsSecretAccessKey?: string;
  awsSessionToken?: string;
  awsRegion?: string;

  // Tools
  enableCoreTools?: boolean;
  disableTools?: boolean;
  allowedTools?: string;
  disallowedTools?: string;

  // MCP
  mcpConfig?: string;
  mcpServers?: any[];

  // Context
  cwd?: string;
  sessionId?: string;

  // Callbacks
  onToolCall?: (toolCall: any) => void;
  onToolResult?: (toolCall: any, result: any) => void;
}

Authentication

Anthropic API

Set your API key via:

  • Option: anthropicApiKey: 'sk-ant-...'
  • Environment: ANTHROPIC_API_KEY

AWS Bedrock (Bearer Token)

Preferred method for Claude Code:

  • Option: bedrockApiKey: 'bedrock-api-key-...'
  • Environment: AWS_BEARER_TOKEN_BEDROCK

AWS Bedrock (IAM Credentials)

Alternative method using AWS credentials:

  • Options: awsAccessKeyId, awsSecretAccessKey, awsSessionToken
  • Environment: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN

Integration with majk-chat CLI

This package is designed to be used by @majkapp/majk-chat-cli:

majk-chat chat --agent claude-code -M "Help me with this code"

License

MIT