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

pim-mcp-server

v1.0.0

Published

MCP server for PIM Gateway — email, calendar, and tasks management via typed MCP tools

Readme

PIM MCP Server

MCP server (stdio transport) that wraps the PIM Gateway REST API into typed MCP tools. Provides email, calendar, and task management capabilities to AI agents.

Prerequisites

  • Node.js 20+
  • PIM Gateway running behind Kong
  • Authentik OAuth2 credentials

Installation

From npm

npm install -g pim-mcp-server

Or run directly with npx:

npx pim-mcp-server

From source

cd pim-mcp-server
npm install
npm run build

Environment Variables

| Variable | Required | Default | Description | |---|---|---|---| | PIM_AUTHENTIK_URL | Yes | — | Authentik URL (e.g. https://argus:9443) | | PIM_KONG_URL | Yes | — | Kong proxy URL (e.g. https://argus:8443) | | PIM_CLIENT_ID | No | pim-gateway | OAuth2 client ID | | PIM_CLIENT_SECRET | Yes | — | OAuth2 client secret |

Available Tools (24)

Email (9)

| Tool | Description | |---|---| | pim_list_emails | List emails from a Gmail label | | pim_search_emails | Search emails using Gmail query syntax | | pim_get_email | Get full email content | | pim_send_email | Send a new email | | pim_reply_email | Reply to an email | | pim_list_attachments | List email attachments | | pim_download_attachment | Download an attachment | | pim_trash_email | Trash an email (admin) | | pim_delete_email | Permanently delete (admin) |

Calendar (5)

| Tool | Description | |---|---| | pim_list_events | List events in a time range | | pim_get_event | Get event details | | pim_create_event | Create a new event | | pim_update_event | Update an event | | pim_delete_event | Delete an event (admin) |

Tasks (7)

| Tool | Description | |---|---| | pim_list_task_lists | List all task lists | | pim_list_tasks | List tasks in a list | | pim_get_task | Get task details | | pim_create_task | Create a new task | | pim_update_task | Update a task | | pim_complete_task | Mark task complete | | pim_delete_task | Delete a task (admin) |

Health & Admin (3)

| Tool | Description | |---|---| | pim_health | Liveness check | | pim_health_ready | Readiness check (DB + Google API) | | pim_audit_log | Query audit log (admin) |

Client Configuration

Claude Code

Add to .claude/settings.json or project settings.json:

{
  "mcpServers": {
    "pim": {
      "command": "npx",
      "args": ["pim-mcp-server"],
      "env": {
        "PIM_AUTHENTIK_URL": "https://argus:9443",
        "PIM_KONG_URL": "https://argus:8443",
        "PIM_CLIENT_SECRET": "<your-secret>"
      }
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "pim": {
      "command": "npx",
      "args": ["pim-mcp-server"],
      "env": {
        "PIM_AUTHENTIK_URL": "https://argus:9443",
        "PIM_KONG_URL": "https://argus:8443",
        "PIM_CLIENT_SECRET": "<your-secret>"
      }
    }
  }
}

OpenClaw (on Jarvis)

export PIM_AUTHENTIK_URL=https://argus:9443
export PIM_KONG_URL=https://argus:8443
export PIM_CLIENT_SECRET=<your-secret>
npx pim-mcp-server

Testing

Run the smoke test to verify connectivity:

PIM_AUTHENTIK_URL=https://argus:9443 \
PIM_KONG_URL=https://argus:8443 \
PIM_CLIENT_SECRET=<your-secret> \
npm test

Building & Publishing

Build

npm run build    # compiles TypeScript to dist/

Publish to npm

Requires npm login with 2FA:

npm login
npm publish --otp=<2fa-code>

To publish a new version:

npm version patch   # or minor, major
npm publish --otp=<2fa-code>

Design

  • Role-agnostic: All endpoints are exposed. RBAC is enforced by the PIM Gateway, not this server. The same binary serves OpenClaw (agent role) and Claude Desktop (admin role) — only the credentials differ.
  • Auth caching: JWT tokens are cached in memory and auto-refreshed 30 seconds before expiry. On 401, the token is force-refreshed and the request retried once.
  • Full envelope: Tool responses return the complete PIM Gateway response envelope (status, data, error, meta) for debugging and traceability.
  • Logging: Token refreshes and API calls (method, path, status, duration) are logged to stderr.