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

mcp-logging

v1.2.0

Published

A Model Context Protocol (MCP) server for querying Loki and Prometheus endpoints.

Readme

loki-mcp

A Model Context Protocol (MCP) server for querying Loki and Prometheus endpoints.

Environment Variables

Set these in your .env file (see .env.example):

  • LOKI_TOKEN: Bearer token for Loki API authentication
  • PROMETHEUS_TOKEN: Bearer token for Prometheus API authentication
  • LOKI_ENDPOINT: Base URL for Loki API (e.g., https://your-loki-endpoint/)
  • PROM_ENDPOINT: Base URL for Prometheus API (e.g., https://your-prometheus-endpoint/)
  • DEBUG: Set to true to enable verbose debug logging (logs request/response/error details for all tools)

Usage

Install dependencies and run the server:

npm install
npm run build
node build/index.js

Tools Provided

1. query-loki

Query a Loki endpoint with a given query string.

Parameters:

  • query (string, required): Loki query string
  • limit (number, optional): Max entries to return (default: 100)
  • startrfc (string, optional): RFC3339 start time
  • endrfc (string, optional): RFC3339 end time

2. loki-labels

Query a Loki endpoint for available labels.

Parameters: None

3. query-prometheus

Query a Prometheus endpoint with a given query string.

Parameters:

  • query (string, required): Prometheus query string
  • time (string, optional): Evaluation timestamp (RFC3339 or Unix)
  • timeout (string, optional): Query timeout (e.g., 30s, 1m)

4. prometheus-stats

List available Prometheus stats from the endpoint.

Parameters: None

Notes

  • The server runs over stdio and is intended to be used as an MCP tool provider.
  • All API requests use Bearer authentication and expect JSON responses.
  • For Prometheus stats, the server requests uncompressed responses to avoid decompression errors.