🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@pleri/pylon

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pleri/pylon

Runtime SDK for MCP servers that enrol into Pylon — token verification, capability resolution, schema push, MCP middleware. The library half of the @pleri/pylon-cli admin tool.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@pleri/pylon

Runtime SDK for MCP servers that enrol into Pylon — token verification, capability resolution, schema push, request-guard middleware.

This is the library half of the Pylon product. It's what an MCP runtime imports to verify the JWTs its users carry.

Install

pnpm add @pleri/pylon

Requires Node ≥ 22 (or any runtime with WHATWG fetch + Web Crypto — Cloudflare Workers supported).

Quick start

// Workers and Node ≥ 22: import the slim verify-only entry to keep
// your bundle under ~8 KB gz.
import { pylonClient, pylonGuard } from '@pleri/pylon/verify';

const client = pylonClient({
  orgUrl:        process.env.PYLON_ORG_URL!,
  appId:         'olam',
  expectedOrgId: process.env.PYLON_ORG_ID!,
  // sessionToken omitted → reads Authorization: Bearer <jwt>
  // from the Request passed to resolve().
});

const guard = pylonGuard(client, { requiredCapability: 'olam:world.read' });

export default {
  async fetch(request: Request): Promise<Response> {
    const { actor, errorResponse } = await guard(request);
    if (errorResponse) {
      return new Response(JSON.stringify(errorResponse.body), {
        status: errorResponse.status,
        headers: { 'content-type': 'application/json' },
      });
    }
    // actor.email / actor.capabilities / actor.capabilities.has(cap)
    return handle(request, actor);
  },
};

Need schema push? Import from @pleri/pylon/schema:

import { pylonSchemaClient } from '@pleri/pylon/schema';

const schema = pylonSchemaClient({
  orgUrl:        process.env.PYLON_ORG_URL!,
  appId:         'olam',
  appToken:      process.env.PYLON_APP_TOKEN!,
  expectedOrgId: process.env.PYLON_ORG_ID!,
});

const result = await schema.push(/* your SchemaDeclaration */);

Full contract

See docs/PYLON_SDK_CONTRACT.md in the repo for the complete public API, HTTP contract, schema model, error shapes, and integration recipes.

Versioning

Pre-1.0 minor bumps (0.1 → 0.2) may be breaking; changelog in CHANGELOG.md. The package version tracks the service's token + schema shapes — the SDK and service ship in lockstep for those surfaces.

License

MIT — see LICENSE.

Keywords

pylon

FAQs

Package last updated on 23 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts