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

@openontology/opencode-palantir

v0.1.6

Published

collection of tools, agents, hooks to supercharge development in foundry

Readme

opencode-palantir

npm downloads CI bun @opencode-ai/plugin palantir-mcp hyparquet

OpenCode plugin that provides:

  • Palantir public documentation tools backed by a local Parquet database
  • Foundry MCP bootstrapping helpers (commands, agents, and optional auto-bootstrap)

NPM package: https://www.npmjs.com/package/@openontology/opencode-palantir

Supported OS

  • Supported: macOS, Linux
  • Windows: not supported (WSL2 might work, but we don’t debug Windows-specific issues)

Install (OpenCode)

Add the plugin in your OpenCode config (opencode.jsonc):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@openontology/opencode-palantir@^0.1.4"]
}

Restart OpenCode.

After enabling the plugin, OpenCode will automatically register:

  • Tools: get_doc_page, list_all_docs
  • Commands: /refresh-docs, /refresh-docs-rescrape, /setup-palantir-mcp, /rescan-palantir-mcp-tools
  • Agents: foundry-librarian, foundry

Versions: how to get the latest

Prefer pinned or semver range installs (like @^0.1.4), and update intentionally.

Avoid using @latest in config:

  • it can make startup slower (npm resolution/install on startup)
  • it makes behavior less deterministic
  • depending on caching, you may not get the upgrade behavior you expect

To find the newest version and changelog:

  • NPM versions: https://www.npmjs.com/package/@openontology/opencode-palantir
  • GitHub releases: https://github.com/anand-testcompare/opencode-palantir/releases
  • Repo changelog: CHANGELOG.md

(Optional) Install per-project

In your project repo, add the plugin as a dependency inside .opencode/ (keeps plugin deps separate from your app deps):

mkdir -p .opencode

cat > .opencode/package.json <<'EOF'
{
  "dependencies": {
    "@openontology/opencode-palantir": "^0.1.4"
  }
}
EOF

(cd .opencode && bun install)

Then create a tiny wrapper file in .opencode/plugins/:

mkdir -p .opencode/plugins

cat > .opencode/plugins/opencode-palantir.js <<'EOF'
import plugin from '@openontology/opencode-palantir';

export default plugin;
EOF

OpenCode automatically loads .js/.ts files from .opencode/plugins/ at startup.

Environment variables (Foundry MCP)

This plugin never writes secrets to disk. In opencode.jsonc, the token is always referenced as {env:FOUNDRY_TOKEN}.

Variables

  • FOUNDRY_URL
    • Foundry base URL (used for auto-bootstrap and can be used as a default for /setup-palantir-mcp)
    • Example: https://YOUR-STACK.palantirfoundry.com
  • FOUNDRY_TOKEN
    • Foundry token used by palantir-mcp for tool discovery
    • Must be exported (not just set in a shell)

Recommended setup (zsh, macOS/Linux)

Use your existing shell secrets file. For example, if you already source ~/.shell_secrets from ~/.zshrc, add:

export FOUNDRY_URL='https://YOUR-STACK.palantirfoundry.com'
export FOUNDRY_TOKEN='YOUR_TOKEN'

Lock it down:

chmod 600 ~/.shell_secrets

Ensure ~/.zshrc sources it:

if [ -f "$HOME/.shell_secrets" ]; then
  source "$HOME/.shell_secrets"
fi

If you still see “token not exported” errors, verify echo $FOUNDRY_TOKEN prints a value and that it’s exported in the environment where OpenCode is launched.

Docs tools (Palantir public docs)

The docs DB is a local file:

  • data/docs.parquet (in your repo root)

First-run behavior

On startup and tool usage, the plugin automatically ensures data/docs.parquet exists by using a prebuilt snapshot (download/copy). In most repos, docs tools should work without any manual setup.

Refresh commands

  • /refresh-docs (recommended)
    • Force refresh from a prebuilt snapshot (no live rescrape)
  • /refresh-docs-rescrape (unsafe/experimental fallback)
    • Live-rescrapes palantir.com docs and rebuilds data/docs.parquet
    • Use only when snapshot download/copy is blocked

Tools

  • get_doc_page
    • Retrieve a doc page by URL, or fuzzy match by query
  • list_all_docs
    • List docs with pagination and optional query/scope filtering

Foundry MCP helpers

This plugin registers Foundry commands and agents automatically at startup (config-driven).

Auto-bootstrap (no command required)

If you set both FOUNDRY_TOKEN and FOUNDRY_URL, the plugin will automatically and idempotently patch repo-root opencode.jsonc to initialize:

  • mcp.palantir-mcp local server config
  • global tool deny: tools.palantir-mcp_* = false
  • per-agent allow/deny toggles under foundry-librarian and foundry

Guided setup and maintenance

  • /setup-palantir-mcp <foundry_api_url>
    • Creates/patches repo-root opencode.jsonc
    • Adds mcp.palantir-mcp (if missing) as a local npx palantir-mcp --foundry-api-url ... server
    • Enforces global deny: tools.palantir-mcp_* = false
    • Creates foundry-librarian and foundry agents
    • Discovers palantir-mcp tools and writes explicit true/false toggles under each agent
  • /rescan-palantir-mcp-tools
    • Re-discovers the palantir-mcp tool list and adds missing explicit toggles
    • Never overwrites existing palantir-mcp_* toggles

About palantir-mcp versions (important)

The generated MCP server uses npx -y palantir-mcp ... by default.

Notes:

  • First run can be slow (npx may need to download/install).
  • @latest / unpinned installs are less deterministic.

Recommendation: once you’re set up, pin the version in opencode.jsonc:

{
  "mcp": {
    "palantir-mcp": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "palantir-mcp@<version>",
        "--foundry-api-url",
        "https://YOUR-STACK.palantirfoundry.com"
      ]
    }
  }
}

Development (this repo)

Setup

mise run setup

Common tasks

  • Build: mise run build
  • Test: mise run test
  • Lint: mise run lint
  • Typecheck: mise run typecheck
  • Format: mise run format

Smoke test the built artifact

mise run smoke

Fetch docs parquet (local dev)

Fetch all Palantir docs into data/docs.parquet (~2 minutes, ~17MB file):

bun run src/docs/fetch-cli.ts

Parquet schema (local dev)

The Parquet file contains a single row group with the following columns:

| Column | Type | Description | | ------------ | ------- | ----------------------------------- | | url | string | Page URL path (e.g. /foundry/...) | | title | string | Page title | | content | string | Full page content (Markdown) | | word_count | integer | Word count of content | | meta | string | JSON-encoded metadata | | fetched_at | string | ISO 8601 timestamp of when fetched |

Example (Bun):

import { parquetReadObjects } from 'hyparquet';

const file = await Bun.file('data/docs.parquet').arrayBuffer();

// List all pages (url + title only)
const pages = await parquetReadObjects({ file, columns: ['url', 'title'] });
console.log(`${pages.length} pages`);

Release notes

For maintainers, see RELEASING.md.

Author

Anand Pant [email protected]