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

@conciergeprotocol/agent

v0.2.0

Published

Build a CAP answer function from a model, a website, an llms.txt file, and MCP tools.

Readme

@conciergeprotocol/agent

Build the answer function for a Concierge Agent Protocol front door. Give it a model and the company's sources. Pass the function to @conciergeprotocol/server.

The company's tools, keys, and records stay in this process. The visiting agent receives the reply text.

Install

npm install @conciergeprotocol/agent @conciergeprotocol/server

Node.js 22 or newer.

Answer from your own sources

import { createAnswer } from '@conciergeprotocol/agent'
import { createCapServer } from '@conciergeprotocol/server'

const answer = await createAnswer({
  model: 'anthropic/claude-sonnet-4.5',
  instructions: 'You answer for Harbor Goods. Link to the page.',
  sources: [
    { type: 'site', url: 'https://harborgoods.example' },
    {
      type: 'mcp',
      name: 'docs',
      url: 'https://harborgoods.example/mcp',
      headers: { authorization: `Bearer ${process.env.MCP_KEY}` },
    },
  ],
  tools: {
    inventory: inventoryTool,
  },
  maxSteps: 6,
  dailyTokens: 500_000,
})

const cap = await createCapServer({
  agent: { name: 'Harbor Goods', chat: 'https://harborgoods.example/chat' },
  answer,
})
await cap.listen(8088)

A string model is called through the Vercel AI Gateway. Set AI_GATEWAY_API_KEY, or pass a model object from a provider package to call that provider directly.

sources has three kinds:

  • site reads a public website at startup: the home page, the pages it links to, then the pages in sitemap.xml, up to maxPages (default 50). The model searches those pages and reads one in full, and each result carries the page URL. Pages on other origins are skipped. Use it when the site has no llms.txt.
  • llms fetches an llms.txt file and lets the model read only the pages that file links to.
  • mcp connects to an MCP server over HTTP. Its tools are prefixed with name, so a server tool search is docs_search. The header value stays on this side of the door.

tools are AI SDK tools. A tool that changes something is wrapped so a read-only caller cannot run it:

tools: {
  refund: { write: true, tool: refundTool },
}

Write tools are included when executeWrites is true and the CAP grant's scope is write. Otherwise the model does not see them. Holding a change for a person's approval is done by the server: return { confirm } from your own answer function. This package runs a write tool when you set executeWrites.

maxSteps counts model steps, including tool calls. dailyTokens is counted in this process and resets at UTC midnight. A restart clears the count. The server's dailyLimit is a separate cap on messages.

answer.close() closes MCP clients.

What the reply contains

The function returns { reply } with the model's text, or { error: { code: 'failed', message } } when the model fails or the token cap is reached. A model failure is passed to onError, which defaults to console.error, so the owner sees the cause in the server log. Tool names, tool errors, and these instructions are not added to the reply. The prompt tells the model to leave them out.

The visitor message is treated as untrusted. It does not replace the instructions.

License

Apache 2.0