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

@nexus-mindgarden/plugin-mcp-foundation

v0.6.0

Published

Plugin-MCP Foundation — Tool-Registry + mcp_tools Extended Form + Scope-Validation + Tool-Naming-Convention

Readme

@nexus-mindgarden/plugin-mcp-foundation

Plugin-MCP Foundation — Tool-Registry mit mcp_tools Extended-Form-Support, Scope-Validation, Tool-Naming-Convention für Cross-Repo-Konsistenz.

Quick Use

Tool-Registry aus Manifest

import { ToolRegistry, checkScopes } from '@nexus-mindgarden/plugin-mcp-foundation'
import { loadManifest } from '@nexus-mindgarden/plugin-bridge-foundation'

const manifest = await loadManifest('./manifest.yaml')
const registry = new ToolRegistry()
registry.registerFromManifest(manifest.provides.mcp_tools)

// Mixed-Form OK:
//   ['documents.list', { name: 'documents.create', scopes_required: ['...'] }]

Pre-Execute Scope-Check

const tool = registry.get('documents.create')
if (!tool) return error('tool_not_found')

const scopeResult = checkScopes({
  pluginWideScopes: manifest.provides.scopes_required,
  callerScopes: claims.scopes, // aus JWT
  tool,
})

if (!scopeResult.ok) {
  return error('forbidden', `missing scopes: ${scopeResult.missing.join(', ')}`)
}

// proceed with tool-call

Naming-Convention (Host-Side)

import { synthesizeNamespacedName, parseNamespacedName }
  from '@nexus-mindgarden/plugin-mcp-foundation'

// Plugin manifest hat bare-name 'documents.create'
// Host (V8/Theseus) synthesizes:
const namespaced = synthesizeNamespacedName('markview', 'documents.create')
// → 'markview.documents.create'

// Inverse (host-side routing):
const parsed = parseNamespacedName('markview.documents.create')
// → { pluginId: 'markview', bareName: 'documents.create' }

Architecture

src/
├── tools/
│   ├── types.ts        # ExtendedMcpToolSchema + McpToolEntrySchema +
│   │                     normalizeMcpToolEntry (string/object → Normalized)
│   ├── registry.ts     # ToolRegistry — registerFromManifest + get/has/
│   │                     list/clear, dedup + validate
│   ├── naming.ts       # isValidBareName + synthesizeNamespacedName +
│   │                     parseNamespacedName (Cross-Repo-Convention)
│   └── index.ts
├── scopes/
│   ├── scope-check.ts  # checkScopes — union-with plugin-wide ∪ tool-
│   │                     specific, wildcard-support (`mcp.plugin.*`)
│   └── index.ts
└── index.ts

mcp_tools Extended Form (Phase-3 Spec)

Foundation accept'd beide Formen aus manifest.provides.mcp_tools:

provides:
  mcp_tools:
    - documents.list                        # string-form (Phase-1)
    - name: documents.create                # Extended-Form (Phase-3)
      description: Create a new document
      input_schema:
        type: object
        required: [title]
        properties:
          title: { type: string }
      output_schema:
        type: object
        required: [id]
      scopes_required:
        - mcp.write.documents

normalizeMcpToolEntry() upgrade'd string-form zu { name, undefineds, [] }. Registry behält normalized form.

Per-Tool Scope-Semantics

checkScopes() implementiert Phase-3 §4 Per-Tool Semantics: plugin-wide scopes_required ist Union-Floor — JEDER Tool-Call braucht ALL plugin-wide scopes. Tool-specific scopes_required extends statt replace.

// plugin-wide: ['mcp.read.documents']
// tool 'create': ['mcp.write.documents']
// →  required = ['mcp.read.documents', 'mcp.write.documents'] (union)

Wildcard-Convention: mcp.plugin.* matched alle scopes mit prefix mcp.plugin. (V8s admin-cookie-Convention).

Tool-Naming

| Form | Where | Example | |---|---|---| | bare-name | Plugin manifest | documents.create | | namespaced-name | Host MCP-Pipeline | markview.documents.create |

isValidBareName(name) enforced snake_case + dot-namespace. synthesizeNamespacedName(pluginId, bareName) is host-side helper. parseNamespacedName() ist die Inverse für tool-routing zurück zum Plugin.

Testing

pnpm test       # vitest run
pnpm typecheck  # tsc --noEmit

Tests cover:

  • registry.test.ts — normalizeMcpToolEntry both-forms, ToolRegistry mixed-form ingestion, dedup-throws, invalid-name-throws, basic ops, clear, single register
  • naming.test.ts — isValidBareName accept/reject (uppercase/dashes/leading-dot/leading-digit), synthesizeNamespacedName + parseNamespacedName roundtrip, error-paths
  • scopes.test.ts — Phase-3 union-semantics (plugin-wide reicht / extends / missing both directions / dedup), Wildcard-Convention (concrete-match, prefix-match, no-cross-prefix), empty cases

License

MIT