Project Moonglade publisher docs

Publisher docs

Connectors

A connector puts another company's service on Moonglade: tool records that describe the vendor's own API, so that people's agents find the tools here and call the API with the person's own account. Anyone can publish one, and labels tell agents whose it is.

Three kinds

KindWho publishes itLabel
The vendor's ownThe vendor: its own MCP server, which Moonglade may list before the vendor claims it, or its own Moonglade site.unclaimed until the vendor claims the listing; none on the vendor's own site.
Meta-connectorAn automation service that gives each person a server address of their own and reaches many services for them. Its entry here has no tools: people connect their own address in their agent app.via-intermediary, which Moonglade signs: the tools reach each service through a third party; and unclaimed until the provider claims its listing.
Community connectorAnyone, from the connector template: tools generated from the vendor's own OpenAPI document.unofficial, while its tools call hosts that its verified website does not vouch for.

The labels say whose a connector is, and unofficial and via-intermediary never change its ranking. A listing Moonglade made for a server whose owner has not claimed it carries unclaimed, a meta-connector's entry among them, and it ranks lower until it is claimed: its quality stays below 0.8, where a claimed entity's ranges up to 1.5. It is ordered by its server's health and never ranks above its owner's own entity for the same server.

An agent that wants the vendors' own tools alone passes excludeLabels: ["unofficial", "via-intermediary"] to search.

Build one

You need the moonglade command (The CLI and site folder) and, to publish, an API key with the publish scope in the environment variable MOONGLADE_API_KEY, never on a command line. Scaffold a project from the connector template, whose sample tools describe the API of a made-up invoicing service, Ledgerly:

moonglade create connector ledgerly-connector
cd ledgerly-connector

The tools are records in .moonglade/tools/, each with execution: client and an openapi upstream: the vendor's public OpenAPI document, the operation's operationId and how a client signs in, as public metadata only. Replace the samples with the vendor's: the importer drafts a tool file for each operation of the vendor's OpenAPI document, and never overwrites one.

moonglade import api <OpenAPI URL>

Review each file it wrote and delete the samples you do not keep. A tool's class follows its HTTP method: GET is read; POST, PUT, PATCH and DELETE are write, or commit for one that cannot be undone and pay for one that moves money (Tools and conformance). Give each tool an example whose output the API really answers, which the importer does not draft and lint requires, and a description that says the agent calls the vendor itself.

Try the tools on your machine. moonglade dev serves them at http://127.0.0.1:7477/mcp until you stop it: add that address to your agent as an MCP server, and a call answers the upstream to call.

moonglade dev

Then check them. Lint must report no error; test skips client tools, whose API runs elsewhere.

moonglade lint
moonglade test

Register the connector's entity, public, under the handle in .moonglade/moonglade.toml, with keys of its own in ~/.moonglade/keys (keep the rotation key offline), and publish it. moonglade create -register prints the connector's DID, which the commands below name <connector DID>.

moonglade create -register
moonglade deploy

Agents now find the connector in search, labeled unofficial. Publish every later change with moonglade deploy; in CI, give it MOONGLADE_SIGNING_KEY, the signing key file's contents, and MOONGLADE_API_KEY, both as secrets.

How agents call it

Moonglade never runs a connector's tools. An agent that calls one with call_tool gets its upstream back and calls the vendor's API itself: its agent app is the vendor's OAuth client, and the person signs in to the vendor there.

An agent that cannot call the API itself asks the network to relay the call, with call_tool and via: "gateway". Where the network allows anonymous calls, an agent that has not identified itself may relay a call to a tool that only reads and that anyone may call, when the tool's upstream is on https port 443 and within the network's budgets; any other relay, and every relay that sends a token in Moonglade-Upstream-Authorization, needs an identified caller. When the vendor wants the person's authorization, the call answers so, with the vendor's sign-in details. The agent completes the vendor's OAuth itself and sends the vendor's token with each call in the Moonglade-Upstream-Authorization header, with the origin (https:// and the host) of the API server the call goes to in the Moonglade-Upstream-Origin header: the server the operation is called on, which the vendor's sign-in details name as upstream.url, not the OpenAPI document. The gateway passes the token on as the call's authorization to that origin alone, and refuses a relay that sends a token naming no origin.

Moonglade stores no token

Moonglade stores no token, and neither do you. The tool records hold none: a build refuses a folder that holds a private key, a credential or the address of a server. The gateway keeps a relayed token for the one call it came with, never logs it, never stores it and never takes it as authorization for anything at Moonglade; refreshing it is the agent's job. And you, the connector's publisher, never see a person's token or data: calls go from the agent, or from the gateway, straight to the vendor.

Losing the unofficial label

A community connector carries unofficial because nothing on the vendor's side says it is the vendor's. The label goes once the connector's verified website vouches for every host its tools call. A website vouches for its own host, for every host on its registrable domain (ledgerly.example vouches for api.ledgerly.example), and for each origin its /.well-known/moonglade.json lists in hosts that names the same entity from its own side. Only the vendor controls its website, so the vendor is who removes the label: on a connector it publishes itself, on one handed over to it (below), or by vouching for yours.

The connector's .moonglade/moonglade.toml names the vendor's website and, for an API on another domain, its hosts:

website = "https://ledgerly.example"
hosts   = ["https://api.ledgerly-cloud.example"]

Deploy with -out naming the website's build output: besides publishing the manifest, which now names the website, it writes the website's /.well-known/moonglade.json, naming the connector and listing its hosts. Publish the website. Each host serves its own /.well-known/moonglade.json naming the same entity, {"entity": "<connector DID>"}, or holds the TXT record _moonglade.<host> with entity=<connector DID>.

moonglade deploy -out <website build output>

Then link the website and have Moonglade check it:

moonglade website link -origin https://ledgerly.example <connector DID>
moonglade website check -wait 90s <connector DID>
moonglade website status <connector DID>

The status shows the link verified, and each host confirmed, refused or unreachable. Once every host the tools call is vouched for, search shows the connector without unofficial. Moonglade checks the link and its hosts again about daily, and a link that lapses brings the label back (Self-hosting has the link's rules).

Hand it over to the vendor

A connector you built can become the vendor's, and only you can hand it over: its keys are yours alone, so neither Moonglade nor the vendor can take it from you. The vendor needs an entity of its own on Moonglade, the recipient, and you an API key with the custody scope and a publish scope that covers the connector. Offer the connector to the vendor's entity:

moonglade entity handover <connector DID> <vendor DID>

The offer is open for 14 days. The vendor's owner finds it among the handovers offered to them in the dashboard, or by its ID, and accepts it with keys of their own and an API key of theirs with the custody scope:

moonglade entity accept-handover <handover ID>

Then you complete it, signing with the connector's rotation key the move to the vendor's keys:

moonglade entity handover -complete <handover ID>

From then on the vendor's keys sign the connector, and yours are refused. Its DID, records, tools and history stay, so every reference to it keeps working; your operator link, website link, private tool settings, secrets, team, drafts and open requests go. The vendor then links its website as above, and unofficial goes. The entity's Hand over tab in the dashboard and POST /v0/entities/{ref}/handovers make the same offer, and POST /v0/handovers/{id}/accept accepts it.

Not yet: a hosted function

A third way to run a connector would have a function of the connector's, hosted by Moonglade, act as the vendor's OAuth client only to obtain a person's token, and hand the token back to their agent without keeping it. It needs hosted functions, which Moonglade does not run yet, so the template has no such variant today. The two ways above need none.

The vendors' reviews

Whoever registers the OAuth app that asks a person for a vendor's scopes, the agent app's maker or you, passes that vendor's reviews, accepts its terms and chooses the scopes, as for any app that calls the vendor's API. For mail and documents, two reviews stand out:

The vendors' own pages decide, and they change: read them before you publish.