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

@credninja/mcp

v0.1.0

Published

MCP server for Cred — OAuth2 credential delegation for AI agents

Readme

@credninja/mcp

Model Context Protocol (MCP) server for Cred — OAuth2 credential delegation for AI agents.

Overview

This MCP server enables AI agents running in Claude Desktop (or any MCP-compatible runtime) to request delegated OAuth2 access tokens through Cred. Zero infrastructure — runs locally on the developer's machine, calls the hosted Cred API.

Installation

Run directly with npx (recommended):

npx @credninja/mcp

Or install globally:

npm install -g @credninja/mcp
cred-mcp

Claude Desktop Setup

Add to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "cred": {
      "command": "npx",
      "args": ["@credninja/mcp"],
      "env": {
        "CRED_AGENT_TOKEN": "your_agent_token",
        "CRED_APP_CLIENT_ID": "your_app_client_id"
      }
    }
  }
}

Get your CRED_AGENT_TOKEN and CRED_APP_CLIENT_ID from the Cred Dashboard.

Environment Variables

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | CRED_AGENT_TOKEN | Yes | — | Agent token from Cred dashboard | | CRED_APP_CLIENT_ID | Yes | — | App client ID from Cred dashboard | | CRED_BASE_URL | No | https://api.cred.ninja | Cred API base URL |

What the Agent Can Do

Once connected, Claude (or any MCP-compatible agent) has access to three tools:

cred_delegate

Get an OAuth access token for a user's connected service.

Input:

  • user_id (string, required): The user to delegate for
  • service (string, required): Service name — google, github, slack, notion, salesforce
  • scopes (string[], optional): OAuth scopes to request

Returns: Access token and expiry, or a consent URL if the user hasn't authorized yet.

cred_status

List a user's connected services and granted scopes.

Input:

  • user_id (string, required): User identifier to check connections for

Returns: List of connected services with their granted scopes.

cred_revoke

Revoke a user's connection to a service.

Input:

  • user_id (string, required): User identifier whose connection to revoke
  • service (string, required): Service slug to revoke

Returns: Confirmation message.

Example Conversation

Here's what it looks like when Claude Desktop uses the Cred MCP server:

User: Check my Google Calendar for tomorrow's meetings

Claude: I'll get access to your Google Calendar and check tomorrow's meetings.

        [Calling cred_delegate with service="google", user_id="user_123",
         scopes=["calendar.readonly"]]

        ✓ Got access token (expires in 3600s)

        [Calling Google Calendar API with the delegated token...]

        Here are your meetings for tomorrow:
        • 9:00 AM - Team standup (30 min)
        • 2:00 PM - Product review (1 hour)
        • 4:30 PM - 1:1 with Sarah (30 min)

If the user hasn't connected their Google account yet:

User: Check my Google Calendar for tomorrow

Claude: I'll need access to your Google Calendar.

        [Calling cred_delegate with service="google", user_id="user_123"]

        It looks like you haven't connected your Google account yet.
        Please visit this link to authorize:

        https://cred.ninja/connect/google?app_client_id=...

        Once you've authorized, let me know and I'll check your calendar.

How It Works

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Claude Desktop │────▶│  @credninja/mcp │────▶│   Cred API      │
│                 │     │  (local server) │     │ (api.cred.ninja)│
└─────────────────┘     └─────────────────┘     └─────────────────┘
                               │
                               ▼
                        ┌─────────────────┐
                        │  Google/GitHub/ │
                        │  Slack/etc API  │
                        └─────────────────┘
  1. Claude Desktop starts the MCP server locally via npx
  2. When the agent needs a credential, it calls cred_delegate
  3. The MCP server calls the Cred API with your agent token
  4. Cred returns a delegated access token (or consent URL)
  5. The agent uses the token to call the service API

Programmatic Usage

import { createCredMcpServer, loadConfig } from '@credninja/mcp';

const config = loadConfig();
const server = createCredMcpServer(config);

Security

  • Agent tokens are scoped to your app and can only access users who have consented
  • Access tokens are short-lived and scoped to the requested permissions
  • The MCP server runs locally — credentials never leave your machine except to call APIs
  • Refresh tokens are never exposed to agents

License

MIT