Skip to content

About

Authoring SDK & contract for Minder module plugins — the Plugin Protocol, manifest schema, and a worked reference plugin.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

94 Commits

Folders and files

Minder Plugin SDK

The authoring contract for Minder module plugins — the Plugin lifecycle, PluginMetadata, the optional extension points (config, actions, AI tools), the manifest JSON Schema, and a complete worked reference plugin.

Minder is a self-hostable, local-first AI platform (RAG + knowledge graph + local LLMs) extended by plugins. A plugin is either reviewed Python code, merged into the catalog by pull request, or a declarative manifest that runs no plugin code. Both run isolated, out of process, in a plugin-runner, and no user-uploaded code runs. AI tools declare an effect, and write/send/destructive ones pause for user approval. This repo is everything a third party needs to write one; the core platform is documented at minderhq.github.io/docs.

Licensed under Apache-2.0.

Full docs: the plugin authoring guide, the contract reference, and manifest plugins on the docs site.

Install

# Not on PyPI yet. Install from git:
pip install "git+https://github.com/minderhq/plugin-sdk"
# once published to PyPI:
# pip install minder-plugin-sdk

The contract in 30 seconds

A module plugin is a class the registry duck-types by the presence of register(). Inheriting Plugin is optional — it's a runtime_checkable Protocol for editor/mypy checks.

from minder_plugin_sdk import PluginMetadata, Plugin

class MyPlugin:                      # no inheritance required
    async def register(self) -> PluginMetadata:
        return PluginMetadata(
            name="my-plugin", version="1.0.0",
            description="what it does", author="you",
        )
    async def initialize(self) -> None: ...
    async def health_check(self) -> dict:
        return {"healthy": True}     # ← MUST return {"healthy": <bool>}
    async def collect_data(self) -> dict: ...   # hourly, or manual /collect
    async def analyze(self) -> dict: ...        # /analysis
    async def shutdown(self) -> None: ...

The registry drives this lifecycle: register() → initialize() → health_check() (60s loop) → collect_data() (hourly or on demand) → analyze() → shutdown().

Optional extension points (class attributes)

Attribute What it does
CONFIG_SCHEMA Makes the plugin configurable over the API (GET/PUT /v1/plugins/<name>/config) — no container env + restart. The registry resolves default → env → persisted and calls apply_config(effective).
ACTIONS (+ READ_ONLY_ACTIONS) A frozenset of method names invokable via POST /v1/plugins/<name>/actions/<method> (JWT-gated). Only listed names are reachable.
AI_TOOLS Advertise Ollama / OpenAI function-calling tools ({name, description, parameters, action, effect}), aggregated at GET /v1/plugins/ai/tools. Declare each tool's effect; see Tool effects.
DISPLAY Branding for the plugin's card in the client: {label, summary, logo, color, category}. logo is a lucide icon name.
REQUIRES What the plugin needs from the platform: {services, optional_services, bundles}. Lets the platform refuse to enable a plugin whose services are missing, offer to enable the bundles it needs, and show requirements on its card. Names are checked against KNOWN_SERVICES / KNOWN_BUNDLES.

Tool effects: what a tool does

Minder runs a read-only tool straight away and pauses a tool that changes or sends data until the user approves the call. So each AI_TOOLS entry declares what it does:

AI_TOOLS = [
    {
        "name": "send_invoice",
        "description": "Email an invoice to a customer.",
        "parameters": {
            "type": "object",
            "properties": {
                "to": {"type": "string", "sensitivity": "recipient"},
                "amount": {"type": "number", "sensitivity": "amount"},
                "note": {"type": "string", "sensitivity": "free_text"},
            },
            "required": ["to", "amount"],
        },
        "action": "send_invoice",
        "effect": "send",
        "idempotent": False,
        "hosts": ["api.mail.example.com"],
    },
]
Field Values
effect read: no side effects. write: changes data inside the user's own systems. send: data leaves to a third party or a recipient (message, email, webhook, publish). destructive: deletes, or changes something irreversibly (including moving money). Declare the most consequential thing the tool can do.
idempotent Optional bool: calling it twice with the same arguments has the same effect as once.
sensitivity (per argument, in parameters.properties) recipient, url, amount, free_text, or bound:<attr> (the value must equal the current user's attribute, e.g. bound:email). Removed from the schema the model sees. A tool-level sensitivities: {"<arg>": "<value>"} map also works.
hosts Optional list of egress hosts the tool may reach (api.example.com, *.example.com).
minder_scopes The Minder API scopes the tool needs for ctx.minder.call (see below), from context.MINDER_SCOPES: kb.search, kb.read_passage, conversation.read_current, user.profile.basic, ticket.create_internal, kb.documents.ingest. A tool call carries only the declared scopes the organisation approved.

All fields are optional in this release, so existing plugins keep loading. check_plugin fails on an invalid value (an unknown effect, a non-bool idempotent, an unknown sensitivity, a malformed host, a scope outside MINDER_SCOPES). check_plugin_warnings (printed as WARN by minder-plugin validate, which still passes) reports:

  • a tool without effect. Minder then infers one, and treats a tool it cannot classify as write;
  • a declaration that strong evidence contradicts, i.e. evidence for a more consequential class than the one declared: a verb in the tool or action name (send_*, notify_*, delete_*, update_*, ...), a GET or DELETE method, a recipient-like argument (to, recipient, cc, bcc, webhook_url, ...) or a recipient sensitivity. For example a read tool with a to argument, or delete_note declared read. Minder flags the same contradictions and does not trust such a declaration;
  • a tool whose action calls ctx.minder.call without declaring minder_scopes (its calls would be denied). Only the action method's own body is checked, not helpers it calls. This becomes an error in a later release.

mcp_annotations(effect, idempotent) (or tool_annotations(tool)) maps an effect to MCP tool annotations, for plugins that also serve their tools over MCP:

effect Annotations
read readOnlyHint: true, destructiveHint: false
write readOnlyHint: false, destructiveHint: false
send readOnlyHint: false, destructiveHint: false, openWorldHint: true
destructive readOnlyHint: false, destructiveHint: true
undeclared none (MCP clients assume the conservative defaults)

idempotent adds idempotentHint.

Plugin-driven UI (the plugin owns its presentation)

Every plugin's config needs are different — a long value wants a textarea, a city wants autocomplete from a source, a flag wants a toggle. So the plugin self-describes how each field renders, and the trusted client draws it with its own components. Plugins never ship HTML/templates — that would be an injection vector and break the "no user-uploaded code" guarantee; presentation is declarative.

Add these optional keys to any CONFIG_SCHEMA field:

Key Purpose
widget text · textarea · number · toggle · select · multiselect · secret · autocomplete (default: inferred from type)
placeholder, rows input hint; textarea height
options static [{value, label}] for a select
options_action name of a READ_ONLY action returning [{value, label}] → a dynamic autocomplete (e.g. a city search). Reuses ACTIONS.
min / max / step numeric bounds
required, group validation; section grouping

A field with none of these renders as a plain input, so existing schemas keep working. See examples/weather_plugin.py: a textarea for locations, a toggle for the sink, and a WEATHER_DEFAULT_CITY autocomplete backed by a search_cities read-only action — plus a DISPLAY logo. (Client + registry wiring is tracked in Minder core.)

Gotchas (read these)

  • health_check() must return {"healthy": <bool>, ...}. Monitoring reads health["healthy"]; anything else marks the plugin unhealthy.

  • The loader picks the class by __all__ if present, else the first class that defines register. Export exactly the plugin class via __all__.

  • Only ACTIONS names are reachable over HTTP — nothing else on the instance. Reads go through /collect + /analysis; ACTIONS is for state changes.

  • Backend config is injected by the registry into self.config. The only backend handle is the per-plugin scoped database, and only when available. There is no postgres, qdrant, redis or influxdb key. Time series, secrets and calls to other plugins go through the platform context (self.ctx, below), and don't hard-wire hosts. Don't read POSTGRES_* (or other platform credentials) from the environment either.

  • config["database"] is a least-privilege Postgres handle, not the platform's database credentials:

    {"host": ..., "port": ..., "user": "minder_plugins_<plugin>", "password": ...,
     "database": ..., "schema": "plugin_<plugin>"}
    • The role only has its plugin's own schema (plugin_<plugin>) and has no access to platform tables.
    • Its search_path is pinned to that schema, so an unqualified CREATE TABLE lands there, owned by the plugin. schema is passed explicitly too, so you can schema-qualify your own DDL.
    • The key may be missing. If the operator hasn't configured the plugin database role, no database key is injected at all. Use self.config.get("database") and degrade gracefully (disable the feature or report it in health_check()) instead of raising KeyError.

Platform context (contract v2)

Plugins run in a separate process from the platform (a plugin-runner). That process holds no platform credentials and cannot reach platform services directly, so a plugin asks the platform for what it needs through self.ctx, the platform context. The platform checks every call against a grant for the current invocation: this plugin, the invoking tenant/owner, and the capabilities the plugin declared. The same plugin code works whether it is hosted in a runner or run directly (for example in tests).

Contract v2 is opt-in and additive. A plugin that declares none of the attributes below is a contract-v1 plugin and keeps working unchanged.

from minder_plugin_sdk import (
    CapabilityDenied, CapabilityUnavailable, PluginBase, PluginMetadata,
)
from minder_plugin_sdk.safe_http import safe_request


class CrawlerPlugin(PluginBase):
    CONTRACT_VERSION = 2                 # "I use self.ctx"
    EGRESS = "public"                    # or "lan", or ["api.example.com", "*.example.org"]
    REQUIRES = {"bundles": ["rag"]}      # documents.index needs the rag bundle
    ACTIONS = frozenset({"ingest"})

    async def register(self) -> PluginMetadata:
        return PluginMetadata(name="crawler", version="1.0.0",
                              description="Index a web page", author="you")

    async def ingest(self, url: str, kb_id: str) -> dict:
        page = await safe_request("GET", url)          # SSRF-guarded fetch
        return await self.ctx.documents.index(
            kb_id, "page.html", page.content, "text/html")

    async def health_check(self) -> dict:
        # Optional features: switch on what is granted, degrade otherwise.
        return {"healthy": self.status == "ready",
                "indexing": self.ctx.has("documents.index")}

What self.ctx offers (every call is async):

Call Capability Notes
await ctx.secrets.get(key) secrets.read This plugin's own secret for the invoking tenant, or None if unset.
await ctx.plugins.invoke(plugin, action, **kw) plugins.invoke Only along a declared PluginMetadata.dependencies edge.
await ctx.documents.index(kb_id, filename, content, content_type) documents.index Uploads on behalf of the invoking user.
await ctx.telegraf.set_managed_region(toml) / clear_managed_region() / reload(force=False) telegraf.* Only for plugins with MANAGES = ["telegraf"]. The platform validates the TOML (allowlisted inputs, size caps) and writes it atomically.
await ctx.timeseries.write(lines, precision="s") / latest(measurement, tag_key, tag_value, fields=None) timeseries.* Only for plugins that declare TIMESERIES, and only for the declared measurements. The platform sets the owner and plugin tags. latest returns the newest timestamp (or None), or {"time", "fields"} when fields is given. The write_history / latest_influx_date helpers use it when you pass ctx=self.ctx.
await ctx.minder.call(route, *, method="GET", query=None, json=None) minder.api Calls a plugin-callable Minder route (e.g. /v1/knowledge-bases/<kb>/documents/<doc>/chunks) as the invoking user and returns its parsed JSON. Granted only while serving an AI tool call, for the tool's approved minder_scopes. json is the request body (not on GET).
ctx.has(capability) — Whether a capability is granted ("telegraf" matches any telegraf.*).

Errors (all subclasses of PluginError; messages name the capability and a reason, never the secret or payload):

  • CapabilityDenied: not granted for this invocation (undeclared, wrong owner/tenant, expired, undeclared plugin edge). Retrying won't help. For ctx.minder.call the reason says which: not an AI tool call, not a plugin-callable route, the token lacks the route's scope, the deadline has passed, or the route refused the call.
  • CapabilityUnavailable: cannot be served right now. This is also what an unbound context raises (a contract-v1 host, or a test without a fake), so catch it to degrade cleanly.
  • CapabilityInvalid: the platform rejected the arguments.

Binding. The host calls plugin.bind_context(ctx) when it loads the plugin. PluginBase implements it; a plain duck-typed class can define its own bind_context(self, ctx) and store self.ctx. Before binding, PluginBase.ctx is UNBOUND_CONTEXT.

Declarations (optional class attributes, checked by check_plugin):

Attribute Shape Meaning
CONTRACT_VERSION int (default 1) 2 = uses self.ctx. A host refuses a plugin that declares a newer version than it supports, and check_plugin flags versions above SUPPORTED_CONTRACT_VERSION.
MANAGES list[str] Platform-managed sidecars the plugin configures through ctx.<name>.* (currently "telegraf"). Requires CONTRACT_VERSION = 2.
EGRESS "public", "lan", or a list of host patterns Where the plugin connects. Patterns are hostnames ("api.example.com") or one-level wildcards ("*.example.com"); no scheme, port, path or IP.
TIMESERIES {"measurements": [...]} The time-series measurements the plugin writes and reads through ctx.timeseries (grants timeseries.*).

Rules for plugin code (enforced by check_plugin / minder-plugin validate):

  • Don't read platform secrets from the environment. os.environ[...], os.environ.get(...) and os.getenv(...) of platform-credential names are flagged: JWT_SECRET, NEO4J_AUTH, POSTGRES_PASSWORD, DB_*, REDIS_*, anything ending in _TOKEN, _SECRET or _PASSWORD, and so on. Keys declared in your own CONFIG_SCHEMA are your configuration and are allowed; use "secret": True there, or ctx.secrets.get(...).
  • Don't import platform internals (core.*). Talk to the platform only through this SDK.
  • Return JSON-serialisable results from actions and lifecycle methods; they may cross a process boundary.
  • Don't share memory between plugins. Use ctx.plugins.invoke(...) along a declared dependency instead of reaching into another plugin's instance.

These checks are a lint, not a security boundary. The scan is syntactic and best-effort (names built at runtime aren't seen), so the rules still apply where the checker can't look. The actual protection comes from the platform: plugin code runs isolated, with no platform credentials and no route to platform services, and every self.ctx call is checked against the invocation's grant.

safe_http: outbound HTTP for URLs you don't control

minder_plugin_sdk.safe_http.safe_request(method, url, ...) applies the platform's egress rules in the plugin. Use it for any configured or user-supplied URL. It needs httpx; the rest of the SDK stays dependency-free.

  • Allows http/https only, and refuses URLs with embedded credentials.
  • Resolves the host and refuses it if any address is non-public. That covers loopback, private, link-local and cloud metadata, CGNAT, multicast, reserved ranges, and IPv4 embedded in IPv6.
  • Pins the connection to the checked address. TLS is still verified against the hostname.
  • Follows redirects only for GET/HEAD and re-checks every hop. A redirect to another origin (scheme, host or port) drops all your headers, and an https → http downgrade is refused.
  • Opens a fresh connection per hop, so a pinned connection is never reused for another host.
  • Caps the body (max_bytes, default 10 MiB) and the number of redirects (default 5). timeout (default 30 s) bounds the whole call; past it, TimeoutError is raised.
  • The client= parameter exists for tests (mock transports); leave it unset in plugin code.
  • Takes allowed_hosts= (e.g. your EGRESS list) to also restrict which hosts may be contacted.
  • check_url(url) gives you the check alone.

Testing with FakePlatformContext

import asyncio
from minder_plugin_sdk import CapabilityDenied, FakePlatformContext, run_lifecycle

def test_ingest_indexes_the_page():
    ctx = FakePlatformContext(grants={"documents.index"})
    plugin = CrawlerPlugin()
    plugin.bind_context(ctx)
    ...
    assert ctx.indexed[0]["kb_id"] == "kb1"

def test_secret_denied():
    ctx = FakePlatformContext(secrets={"API_TOKEN": "t"}, grants=set())
    # ctx.secrets.get(...) now raises CapabilityDenied
    out = asyncio.run(run_lifecycle(MyPlugin(), ctx=ctx))   # binds ctx after register()

FakePlatformContext takes these options:

  • secrets: the secret values.
  • grants: the granted capabilities. None, the default, grants everything, which is more than the platform would. FakePlatformContext.for_plugin(plugin, dependencies=[...]) starts from what the plugin's declarations would be granted instead (secrets.read; plugins.invoke with dependencies; documents.index with the rag bundle; telegraf.* with MANAGES = ["telegraf"]).
  • denied / unavailable: capabilities that always raise.
  • invoke_results: {(plugin, action): value or callable}.
  • telegraf_validator: a callable that raises CapabilityInvalid to simulate a rejected region.
  • timeseries_latest: {(measurement, tag_key, tag_value): point} answers for ctx.timeseries.latest (an ISO timestamp, or {"time", "fields"}).
  • minder_results: {(method, route): value or callable} answers for ctx.minder.call (a callable gets query= and json=). Other routes raise CapabilityDenied. The fake does not check scopes; for_plugin grants minder.api when a tool declares minder_scopes.

It records every call in ctx.calls with identifying arguments only (secret keys, never values; kwarg names for invokes; see ctx.called("secrets.read")), and keeps side effects in ctx.indexed, ctx.telegraf_region, ctx.telegraf_reloads and ctx.timeseries_lines.

Declarative (T0) plugins: minder-plugin try

A declarative plugin is a manifest, not code: HTTP requests on declared hosts, engine-injected auth, JMESPath / XML mapping, pagination and chaining. Minder's declarative runner executes it with the minder_t0_engine package, which ships with this SDK. minder-plugin try uses the same engine and the same egress rules, so what you see locally is what the runner produces.

pip install 'minder-plugin-sdk[t0]'

# live: real DNS and upstream calls, under the manifest's egress rules
minder-plugin try manifest.yml convert --args '{"amount": 10, "from_currency": "EUR", "to_currency": "TRY"}'

# record upstream responses, then iterate offline
minder-plugin try manifest.yml convert --args '...' --record fixtures/
minder-plugin try manifest.yml convert --args '...' --replay fixtures/
  • --config '{...}' sets config values; --secret KEY=VALUE (repeatable) provides an auth secret the manifest injects.
  • Replay never touches the network: a request that was not recorded fails. Host, scheme, path and redirect rules still apply offline. Address checks (private / metadata IPs) need DNS, so they run in live and record mode only.
  • Recordings keep response headers except cookies and hop-by-hop headers; review them before you commit them.

A tool may also call Minder's own API with a minder_api step instead of a request. The tool must declare minder_scopes, and the step runs through ctx.minder.call (capability minder.api) as the invoking user. It is not egress, so no egress rule applies to it. Its parsed answer is the step's result, as with an HTTP step, so select, when, foreach and later steps work the same way. Actions and the schedule can't use it. minder-plugin try binds no ctx.minder, so a minder_api step is denied there.

A minder_api result can feed a later request step, so the data it reads can reach the plugin's egress hosts. Minder therefore treats a tool whose plugin declares any egress as egressing when it decides about local-only content.

tools:
  passages:
    description: Search the knowledge base.
    minder_scopes: [kb.search]
    parameters: {type: object, properties: {kb: {type: string}, q: {type: string}}}
    steps:
      - name: hits
        minder_api:
          route: "/v1/knowledge-bases/{params.kb}/search"  # starts with /v1/
          method: POST                                     # GET (default) or POST
          query: {limit: 5}
          body: {query: "{params.q}"}                      # POST only
        select: results

Worked example

examples/weather_plugin.py is a complete, self-contained plugin that uses every part of the contract: the full lifecycle, CONFIG_SCHEMA + apply_config, ACTIONS + READ_ONLY_ACTIONS, and an AI_TOOLS function-calling tool. Depends only on httpx + this SDK.

Remote plugins (T4): minder-plugin serve

A remote (T4) plugin runs on your infrastructure, and Minder calls it over HTTPS. The plugin code is the same PluginBase code: minder-plugin serve wraps it as an ASGI app that verifies every call and turns self.ctx into signed callbacks to Minder.

pip install 'minder-plugin-sdk[serve]'
export MINDER_PLUGIN_INSTALLATION_KEY=...   # base64 of the installation's 32-byte Ed25519 seed
minder-plugin serve my_plugin.py --minder-url https://minder.example \
    --public-authority plugin.example --installation-id <installation id> --port 8080

--public-authority (your endpoint's host) and --installation-id are required, and the server refuses to start without them. --insecure-host-authority lifts that requirement for local development only. The server then checks the request's Host header instead, which lets requests signed for other plugins be replayed, and logs an error at startup.

What the server does:

  • Inbound. It serves POST /minder/v1/invoke. Each request must carry Minder's RFC 9421 Ed25519 signature over @method, @authority, @path, @query and content-digest.
    • The signing keys come from <minder>/.well-known/minder/plugin-jwks.json. They are cached, and refetched when an unknown keyid appears.
    • --public-authority is your endpoint's host. A request Minder signed for another plugin fails there. An envelope for another installation_id gets a 403 with the reason installation_mismatch.
    • @path is checked as the route the server serves (--path-prefix plus /minder/v1/invoke), not the raw path received. This is stricter than a raw request target.
    • A signature older than 300 s, a replayed nonce or a body that doesn't match its digest gets a 401 with a stable error.reason.
  • Dispatch. The envelope's kind (tool or action), target and kwargs run the matching AI_TOOLS entry or declared ACTIONS method, bounded by deadline_ms. A synchronous target runs in a worker thread. The deadline still answers 504 and the event loop stays free, but a thread can't be killed, so a timed-out sync call keeps running in the background. Prefer async targets. Answers are JSON. Errors map to stable codes (unknown_target, invalid_arguments, capability_denied, deadline_exceeded, ...) and never include a traceback.
  • Callbacks. While a call runs, self.ctx is a t4_callbacks.CallbackPlatformContext. Each ctx call becomes POST <callback_base>/v1/plugin-callbacks/<capability>, sent with Authorization: Bearer <grant> and signed with the installation key. Minder takes the tenant and owner from the grant. ctx.telegraf.* is not available to remote plugins.

The server also has these settings:

  • current_invocation() gives the pseudonymous tenant_ref and owner_ref.
  • --path-prefix is for a reverse proxy that mounts the app below /.
  • Several replicas need a shared t4.NonceCache.
  • Terminate TLS in front of the server.

Run the examples/remote_echo example to try it. Authors in other languages should follow Verifying Minder's signature, which covers the exact signature base, an openssl and a Python walk-through, and the shared test vectors.

Manifest plugins (data-ingestion)

A separate, declarative mechanism for ingestion — a YAML manifest that supplies parameters only (no code): one trigger (webhook, schedule, poll) and one action (store-vector, http-request, plugin-action). Its JSON Schema (draft-07) is src/minder_plugin_sdk/schemas/manifest.schema.json, published at https://minderhq.github.io/docs/schemas/manifest.v1alpha1.json. A declarative connector (spec.runtime.kind: declarative: HTTP tools, actions, a schedule and a signed webhook, run by Minder's connector engine) has its own schema, src/minder_plugin_sdk/schemas/declarative-manifest.schema.json, published at https://minderhq.github.io/docs/schemas/declarative-manifest.v1alpha1.json. validate_manifest / minder-plugin validate pick the schema from spec.runtime.kind. These schemas are the single source of the manifest contract: Minder validates against the same files. This is the installable, runtime shape most third-party integrations should use rather than a code plugin — see docs/plugins/webhook-vs-code-plugin.md for which shape to pick. Reach for a manifest when you just need to pipe a webhook into the vector store; add a small handle_webhook handler (examples/webhook_plugin.py) only when a payload needs reshaping first.

Scaling to any plugin (RFC 0001)

Thousands of plugin types can't fit a fixed lifecycle + a closed widget enum — and the answer is not plugin-supplied code (that breaks the no-arbitrary-code guarantee). Instead variety comes from data + trusted primitives:

  • Config is JSON Schema + UI Schema. resolve_config_schema(plugin) returns a standard JSON Schema (nested objects, arrays, enums, formats, conditionals, validation) plus UI hints. The simple CONFIG_SCHEMA list is compiled to this, so simple plugins stay one-liners while the platform always speaks JSON Schema.
  • Widgets are a client-side registry, resolved by name with a default fallback — a plugin can ask for a widget that doesn't exist yet and degrade gracefully; new rich widgets are added to the trusted client, never shipped as plugin code.
  • Capabilities, not one lifecycle. capabilities(plugin) reports what a plugin implements (data-source, ai-tools, actions, webhook-ingest, scheduler, connection, ui-panel…) — an open vocabulary; unknown capabilities are ignored.
  • Versioned (api_version / API_VERSION) so the contract evolves without breaking older plugins.

Full design: docs/rfc/0001-extensible-plugin-contract.md.

SDK toolkit

The SDK is more than the contract — it ships the batteries a plugin author needs:

Import What
PluginBase Optional base class — sensible defaults for the whole lifecycle + the standard config flow, so a data-source plugin is just register + collect_data.
check_plugin(p) / check_plugin_warnings(p) / run_lifecycle(p, ctx=None) Test helpers: contract violations as a list; non-fatal findings (e.g. a tool without effect); drive the full lifecycle in a test (optionally with a bound context).
FakePlatformContext In-memory platform context (contract v2) for unit tests: secrets, grants/denials, recorded calls.
safe_http.safe_request / check_url SSRF-guarded outbound HTTP (needs httpx).
t4 / t4_server / t4_callbacks Remote (T4) plugins: verify Minder's RFC 9421 signatures, minder-plugin serve, the signed grant-callback ctx (the serve extra).
resolve_config_schema / resolve_effective_config / validate_config Compile config to JSON Schema, resolve default→env→persisted, validate values.
build_tool_definitions / ai_tool_errors / ai_tool_warnings Turn AI_TOOLS into OpenAI/Ollama tool defs; validate they map to actions and their effect declarations.
EFFECTS / Effect / AIToolSpec / mcp_annotations / tool_annotations Tool effect classes (read/write/send/destructive), the typed tool entry, and the effect-to-MCP-annotation mapping.
load_manifest / validate_manifest Parse + validate a manifest plugin or a declarative connector manifest (bundled JSON Schemas).
manifest_schema / declarative_manifest_schema / is_declarative_manifest The bundled schemas, and which one a manifest is checked against.
capabilities(p) + DataSource / Scheduler / WebhookHandler / … Introspect + type-check per-capability interfaces.

CLI

minder-plugin scaffold my-plugin        # generate a working skeleton
minder-plugin validate my_plugin.py     # (or a manifest.yaml) → contract check
minder-plugin inspect  my_plugin.py     # capabilities + compiled config/UI schema + tools
minder-plugin serve    my_plugin.py --minder-url https://...   # run as a remote (T4) plugin

Examples

Develop

pip install -e ".[dev,examples]"   # dev includes the serve extra's packages
pytest && black --check src tests examples && flake8 src tests examples && mypy src

Contributing a plugin

Community plugins are catalogued at minderhq/plugins. Scaffold a new one from minderhq/plugin-template (compiles against this SDK). Design and roadmap discussion lives in Discussions.

About

Authoring SDK & contract for Minder module plugins — the Plugin Protocol, manifest schema, and a worked reference plugin.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages