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

@neuralsea/petri-mcp-knowledge-server

v0.2.1

Published

Configurable MCP Knowledge Server with crawler+cache+local index (Petri Workspace Indexer).

Downloads

4

Readme

Petri MCP Knowledge Server (crawler + cache + local index)

A configurable Model Context Protocol (MCP) server that exposes knowledge tools to AI agents.

It can:

  • Index local workspace folders using @neuralsea/workspace-indexer (Petri indexer)
  • Crawl and index documentation websites (given a home/start URI) with:
    • configurable depth / page limits
    • optional robots.txt compliance
    • no external links (stay within allowed hosts/prefixes)
    • HTML → clean text extraction (Readability)
    • heading/section chunking
    • cache to disk, then index via Petri (SQLite FTS + embeddings)
  • Index Confluence via REST API pagination (CQL)
  • Index SharePoint / other systems via a configurable JSON pagination mode (you supply endpoints/paths)
  • Index GitHub Enterprise wiki either by crawling the wiki website OR (recommended) by cloning the .wiki.git repository.

Important: You must have permission to crawl/index the sites you configure. For public sites, keep depth/page limits low and respect robots.txt unless you have explicit permission.

Install

npm install
npm run build

Run

cp knowledge-server.config.example.json knowledge-server.config.json
# edit paths/domains/URLs

# set any required tokens
export INTERNAL_DOCS_TOKEN="..."
export CONFLUENCE_TOKEN="..."
export SHAREPOINT_TOKEN="..."
export GHE_TOKEN="..."

node build/index.js --config ./knowledge-server.config.json

This server uses stdio transport. Do not write logs to stdout; it will break MCP. Logs go to stderr.

MCP Tools

  • knowledge_list_sources
  • knowledge_health
  • knowledge_search (cross-source)
  • knowledge_read (read a URL/id, returns cached clean text where available)
  • knowledge_sync (crawl/index refresh per source or all)
  • local_read_file (restricted to allow-listed roots)

Crawler behaviour

The http-crawl-index source supports multiple discovery modes:

  • crawl: BFS crawl from start URLs, following internal links only
  • sitemap: consume sitemap.xml (and optional sitemap indexes)
  • confluence: enumerate pages via Confluence REST API search (CQL)
  • json-api: generic JSON pagination enumerator (useful for SharePoint via Microsoft Graph, or custom systems)
  • github-wiki-git: clone/pull a .wiki.git repository, then index it as files

After caching pages/chunks to disk, the server indexes the cache folder using the Petri indexer.

Notes for StackOverflow / Kubernetes docs

You can configure public sites (e.g. https://kubernetes.io/) as http-crawl-index sources. For very large sites, set:

  • maxDepth low (e.g. 2–4)
  • maxPages low
  • restrict to a allowedUrlPrefixes like https://kubernetes.io/docs/

StackOverflow is enormous and rate-limited; use strict limits and keep respectRobotsTxt: true.

Embeddings

This server indexes content using Petri's hybrid retrieval (SQLite FTS + embeddings). Configure the embeddings provider per source:

  • ollama (local): requires Ollama running and the embedding model pulled (default nomic-embed-text).
  • openai (hosted): requires an API key via apiKeyEnv (default OPENAI_API_KEY).
  • hash: deterministic baseline with no external dependencies (lower quality).

See knowledge-server.config.example.json for examples.