Skip to content
PluginStats

@lushly-dev/afd-client weekly downloads statistics

By lushly-dev (4 listings) · npm · MCP servers

MCP client library for Agent-First Development

View on npm Stale · Dec 2, 2026

@lushly-dev/afd-client has 6,927 recorded weekly downloads on npm, a decrease of 72.9% over the past 30 days, ranking #1408 of 3,247 tracked listings.

Weekly downloads
6,927
Official API · Dec 5, 2026
7-day growth
-28.2%
-2.7K weekly downloads
30-day growth
-72.9%
-18.7K weekly downloads
90-day growth
-53.3%
-7.9K weekly downloads
Rank
#1408
▼ 160 in 7 days

About @lushly-dev/afd-client

@lushly-dev/afd-client

MCP client library for Agent-First Development.

Installation

npm install @lushly-dev/afd-client
# or
pnpm add @lushly-dev/afd-client

Overview

This package provides clients for AFD command servers. It supports:

  • SSE Transport: Real-time streaming with Server-Sent Events
  • HTTP Transport: Simple request/response communication
  • Direct Transport: Zero-overhead in-process execution for co-located agents
  • Auto-reconnection: Exponential backoff with jitter and a cap
  • Type-safe API: Full TypeScript support with CommandResult integration
Supported servers

The default streamable-http transport is built on the official MCP TypeScript SDK client (@modelcontextprotocol/client). It talks to an AFD server's /mcp endpoint, to the Python and Rust AFD servers, and to any server built on an official MCP SDK. It negotiates the protocol revision with protocolMode:

protocolModeBehavior
'auto' (default)Probe server/discover; use MCP 2026-07-28 (stateless, per-request _meta) when offered, else the 2025 initialize handshake
'legacy'Always use the 2025 initialize handshake
'modern'Require MCP 2026-07-28; connect() fails otherwise

connect() resolves with the negotiated protocolVersion, the server's capabilities and identity. The transport is chosen from the URL unless transport is set: sse for a URL ending in /sse, streamable-http otherwise.

RouteUsed for
POST <base>/mcpMCP requests of the streamable-http transport
POST <base>/stream/<command>stream() (a /mcp URL streams from the sibling /stream path)
GET <base>/sse, POST <base>/messageThe deprecated sse and http transports (AFD servers' 2024-11-05 lane)
GET <base>/healthReachability check on connect (http transport)

Usage

Basic Connection
import { createClient } from '@lushly-dev/afd-client';

// Create client
const client = createClient({
  url: 'http://localhost:3100/mcp', // streamable-http, MCP 2026-07-28 when offered
});

// Connect
await client.connect();

// List available tools
const tools = await client.listTools();
console.log('Available tools:', tools.map(t => t.name));

// Disconnect when done
await client.disconnect();
Calling Commands
import { createClient, type CommandResult } from '@lushly-dev/afd-client';
import { isSuccess, isFailure } from '@lushly-dev/afd-core';

const client = createClient({ url: 'http://localhost:3100/mcp' });
await client.connect();

// Call a command - returns CommandResult
const result = await client.call<Document>('document-create', {
  title: 'My Document',
  content: 'Hello, world!'
});

if (isSuccess(result)) {
  console.log('Created document:', result.data);
  console.log('Confidence:', result.confidence);
  console.log('Reasoning:', result.reasoning);
} else {
  console.error('Error:', result.error.message);
  console.error('Suggestion:', result.error.suggestion);
}

Pass per-request deadlines and cancellation to call(), callTool(), or request():

const result = await client.call('item-get', { id: '123' }, {
  timeout: 5_000,
  signal: controller.signal,
});

With the direct transport, deadlines and cancellation settle the request even when a handler ignores its abort signal. Disconnecting also aborts active execution. A handler that has already started may still complete its side effects; check a mutation's effect before retrying. Direct discovery preserves the registry's input schema and planning metadata. HTTP and SSE session renewal requires a successful JSON-RPC initialize result and a replacement session ID before replaying a rejected request. Concurrent requests share renewal work.

Event Handling
const client = createClient({
  url: 'http://localhost:3100/mcp',
  autoReconnect: true,
  maxReconnectAttempts: 5,
});

// Subscribe to events
client.on('connected', (info) => {
  console.log('Connected to:', info.serverInfo.name);
});

client.on('disconnected', (reason) => {
  console.log('Disconnected:', reason);
});

client.on('reconnecting', (attempt, max) => {
  console.log(`Reconnecting... (${attempt}/${max})`);
});

client.on('error', (error) => {
  console.error('Client error:', error);
});

client.on('toolsChanged', (tools) => {
  console.log('Tools updated:', tools.length);
});

await client.connect();
  • connected fires once the server is initialized and the tools list is loaded, so client.getTools() is ready inside the handler. A failed tools refresh does not fail the connection; the list stays empty.
  • While reconnecting, each attempt emits reconnecting; failed attempts emit nothing else. If every attempt fails, the client emits one error ("Max reconnection attempts reached", with the last failure as cause) and moves to the error state.
  • The delay before attempt n is reconnectDelay * 2^(n-1) plus up to 100 ms of jitter, capped at maxReconnectDelay.
  • The sse transport notices a closed event stream. The http transport has no persistent connection, so it reports the connection as lost after 3 consecutive requests get no HTTP response at all; autoReconnect then applies to it too.
Client Status
const status = client.getStatus();

console.log('State:', status.state);
console.log('Server:', status.serverInfo?.name);
console.log('Connected at:', status.connectedAt);
console.log('Pending requests:', status.pendingRequests);
Raw Tool Calls

For low-level access, use callTool which returns the raw MCP response:

// Raw MCP response
const rawResult = await client.callTool('document-create', {
  title: 'Test'
});

console.log('Content:', rawResult.content);
console.log('Is error:', rawResult.isError);
```…

Description from the npm listing.

  • afd
  • mcp
  • ai-agents
  • sse
  • client

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@lushly-dev/afd-client weekly downloads on npm, last 90 days: 6,927 weekly downloads as of Dec 5, 2026, -53.3% over 90 days.@lushly-dev/afd-clientWeekly downloads on npm · Last 90 days6,927downloads / week-53.3% over 90 days05K10K15K20K25K30KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@lushly-dev/afd-client weekly downloads on npm, last 90 days: 6,927 weekly downloads as of Dec 5, 2026, -53.3% over 90 days.

7/30/90-day growth

@lushly-dev/afd-client weekly downloads growth on npm: -28.2% over 7 days, -72.9% over 30 days, -53.3% over 90 days.@lushly-dev/afd-clientWeekly downloads growth on npm6,927downloads / week now7-day growth-2,726 weekly downloads-28.2%30-day growth-18,655 weekly downloads-72.9%90-day growth-7,900 weekly downloads-53.3%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@lushly-dev/afd-client weekly downloads growth on npm: -28.2% over 7 days, -72.9% over 30 days, -53.3% over 90 days.

Ranking history

@lushly-dev/afd-client npm ranking history: currently #1408 (by weekly downloads).@lushly-dev/afd-clientnpm ranking · by weekly downloads · Last 90 days#1408current rank#200#400#600#800#1000#1200#1400#1600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 40 observations · Updated Dec 5, 2026pluginstats.com
@lushly-dev/afd-client npm ranking history: currently #1408 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 71, #8 (overall #1,408)
All npm: every listing in weekly downloads order

Listing placement

MCP servers468 listings · 24 pages · page 17, #6 (overall #326)
MCP servers: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for @lushly-dev/afd-client
Date (UTC)Weekly downloadsChange vs. previous
6,927-324
7,251+775
6,476-106
6,582+580
6,002+2K
4,036-220
4,256-5.4K
9,653-1.3K
10,937-1K
11,947-812
12,759-341
13,100-663
13,763+750
13,013—

Similar npm MCP servers plugins

All 20 @lushly-dev/afd-client alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@lushly-dev/afd-client. First seen Oct 16, 2026; last successful collection Dec 2, 2026. See the methodology.