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

@background-agents/mcp

v0.1.0

Published

MCP provider abstractions for GitHub and Smithery

Readme

@background-agents/mcp

TypeScript library for connecting to MCP servers via GitHub and Smithery.

GitHub

Mints short-lived installation tokens for GitHub's hosted MCP server.

import { createGitHubMcpProvider, GITHUB_MCP_URL } from "@background-agents/mcp"

const github = createGitHubMcpProvider({
  appId: process.env.GITHUB_APP_ID!,
  appSlug: process.env.GITHUB_APP_SLUG!,
  privateKey: process.env.GITHUB_APP_PRIVATE_KEY!,
})

const token = await github.getToken(installationId)
const installUrl = github.getInstallUrl()
github.invalidateToken(installationId)

GitHub App Setup

1. Create the App

Open one of:

Fill in:

  • Homepage URL — anything.
  • Callback URLhttp://localhost:4000/api/mcp/connect/github/callback
  • Request user authorization (OAuth) during installation — ✅
  • Setup URL — leave blank.
  • Redirect on update — ✅
  • Webhook → Active — uncheck.
  • Where can this GitHub App be installed?Any account.

Permissions (Repository):

| Permission | Access | |---------------|--------------| | Contents | Read & write | | Issues | Read & write | | Pull requests | Read & write | | Metadata | Read |

2. Make the App public

Open the Advanced tab and click Make public:

  • Personal: https://github.com/settings/apps/<APP_NAME>/advanced
  • Org: https://github.com/organizations/<YOUR_ORG>/settings/apps/<APP_NAME>/advanced

3. Set credentials

  1. App ID (top of settings page) → GITHUB_APP_ID.

  2. Slug (from github.com/apps/<slug>) → GITHUB_APP_SLUG.

  3. Private key — click "Generate a private key", then convert the .pem to a single line:

    awk 'NF {sub(/\r/, ""); printf "%s\\n", $0}' your-key.pem

    Paste the output into GITHUB_APP_PRIVATE_KEY="...".

Smithery

Manages connection lifecycles with per-server OAuth flows.

import {
  createSmitheryProvider,
  getSmitheryConnectionId,
} from "@background-agents/mcp"

const smithery = createSmitheryProvider({
  apiKey: process.env.SMITHERY_API_KEY!,
  namespace: process.env.SMITHERY_NAMESPACE, // optional
})

// The third argument is the owner-kind prefix, e.g. "chat" or "job".
const connectionId = getSmitheryConnectionId(chatId, "exa/exa", "chat")

const result = await smithery.createConnection(
  "https://server.smithery.ai/exa/exa/mcp",
  connectionId,
  "Exa Search"
)

if (result.status === "auth_required") {
  // Redirect user to result.authorizationUrl
}

if (result.status === "connected") {
  // Use result.mcpEndpoint with the Smithery API key as bearer token
}

await smithery.getConnectionStatus(connectionId)
await smithery.deleteConnection(connectionId)

Smithery Setup

  1. Sign in at smithery.ai.
  2. Create an API key at smithery.ai/console/api-keysSMITHERY_API_KEY.
  3. (Optional) Pin a namespace at smithery.ai/settings/namespacesSMITHERY_NAMESPACE.

Types

import type {
  McpServerConfig,
  ITokenMintingProvider,
  IConnectionProvider,
  ConnectionResult,
  ConnectionStatus,
} from "@background-agents/mcp"

Utilities

Helper functions for working with MCP servers.

import { safeServerName } from "@background-agents/mcp"

// Convert qualified server names (e.g. "github/github") to safe identifiers
// for use in file names, IDs, etc.
safeServerName("github/github")  // "github-github"

Constants

Pre-defined URLs and identifiers for known MCP servers. Use these instead of hardcoding values to ensure consistency across your application.

import {
  GITHUB_MCP_URL,           // "https://api.githubcopilot.com/mcp/"
  GITHUB_MCP_QUALIFIED_NAME, // "github/github"
  SMITHERY_API_BASE,        // "https://api.smithery.ai"
} from "@background-agents/mcp"