These examples show how to use ProDisco as a library-agnostic MCP server: you configure libraries, search their APIs, and execute code in the sandbox.
This directory includes runnable library config files:
prodisco.postgres.yaml(usespg-mem)prodisco.kubernetes.yaml(uses@kubernetes/client-node)prodisco.javascript.yaml(usesmy-esm-js-lib, an ESM-only JavaScript example)
Note: ProDisco indexes APIs from TypeScript declaration files (
.d.ts) when available. If a library ships no.d.ts, ProDisco can fall back to indexing ESM JavaScript source (best-effort; types default toany). CommonJS-only packages without typings are not supported.
This example is intentionally easy to run locally: it uses an in-memory Postgres implementation, so you don’t need Docker or a real database.
Use: examples/prodisco.postgres.yaml (this repo ships it).
Run ProDisco (missing packages are auto-installed):
node dist/server.js --config examples/prodisco.postgres.yamlOr build images with the library baked in:
npm run docker:build:config -- --config examples/prodisco.postgres.yamlCall prodisco.searchTools with:
methodName: "newDb"library: "pg-mem"
Run with prodisco.runSandbox:
const { newDb } = require("pg-mem");
const db = newDb();
db.public.none("create table users(id int primary key, name text);");
db.public.none("insert into users values (1, 'ada'), (2, 'grace');");
const rows = db.public.many("select * from users order by id;");
console.log(JSON.stringify(rows));Expected output:
[{"id":1,"name":"ada"},{"id":2,"name":"grace"}]This example shows how to configure ProDisco to work with a Kubernetes cluster by indexing and allowing the Kubernetes client library.
Use: examples/prodisco.kubernetes.yaml (this repo ships it).
Run ProDisco (missing packages are auto-installed):
node dist/server.js --config examples/prodisco.kubernetes.yamlOr build images with the library baked in:
npm run docker:build:config -- --config examples/prodisco.kubernetes.yaml- Local subprocess:
@kubernetes/client-nodewill load credentials fromKUBECONFIGor~/.kube/config. - Containers/pods: mount a kubeconfig into the sandbox container (and set
KUBECONFIG) or run with in-cluster credentials.
Call prodisco.searchTools with:
methodName: "listNamespace"(ormethodName: "listPod")library: "@kubernetes/client-node"
Run with prodisco.runSandbox:
const k8s = require("@kubernetes/client-node");
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const coreApi = kc.makeApiClient(k8s.CoreV1Api);
const res = await coreApi.listNamespace();
const names = (res.body.items || [])
.map((ns: any) => ns.metadata?.name)
.filter(Boolean);
console.log(JSON.stringify(names, null, 2));This example demonstrates indexing a JavaScript-only ESM library that ships no .d.ts. The library is a tiny local fixture shipped in this repo at examples/my-esm-js-lib/.
Install the local package into your project node_modules (do this once):
npm install ./examples/my-esm-js-libUse: examples/prodisco.javascript.yaml (this repo ships it).
Run ProDisco (this example library is local, so auto-install will skip it):
node dist/server.js --config examples/prodisco.javascript.yamlCall prodisco.searchTools with:
methodName: "publicFn"(ormethodName: "MyClass")library: "my-esm-js-lib"
You should not see internal/non-exported symbols (e.g. nonExportedFn, Internal).
Run with prodisco.runSandbox:
const lib = require("my-esm-js-lib");
console.log(lib.foo());
console.log(lib.publicFn());
const c = new lib.MyClass();
console.log(c.greet("ada"));Expected output:
1
2
hi ada