@protogrid/mastra 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 protogrid contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
- # Temporary Holding Version
1
+ # @protogrid/mastra
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Mastra tools from the [protogrid](https://protogrid.dev) MCP registry: find MCP servers by what they do, check them against your rules, and give your agent the tools of the ones that pass.
4
+
5
+ ```bash
6
+ npm install @protogrid/mastra @mastra/core
7
+ ```
8
+
9
+ ```ts
10
+ import { Agent } from "@mastra/core/agent";
11
+ import { loadTools } from "@protogrid/mastra";
12
+
13
+ const mail = await loadTools({
14
+ query: "send an email",
15
+ rules: { min_quality: 70 }, // also refuses hidden text, tool poisoning, known vulnerabilities and paid servers
16
+ secrets: { MAIL_API_KEY: process.env.MAIL_API_KEY },
17
+ });
18
+ const agent = new Agent({ id: "mailer", name: "Mailer", instructions: "You send mail.", model, tools: mail.tools });
19
+ await agent.generate("Mail the report to ops");
20
+ await mail.close();
21
+ ```
22
+
23
+ - `loadTools` tries the best search results (or the `servers` you name) in order. Each goes through protogrid's gate with your rules; one that passes is connected to directly, with no proxy, and its tools come back named `<server key>_<tool>`. `origins` says which server each tool comes from; `close()` (or `await using`) closes the connections.
24
+ - Secrets fill the `${NAME}` placeholders of the server's connection in your process; they are never sent to protogrid. A server needing a secret you did not give is passed over.
25
+ - Rules are yours, not the model's. A rule you leave out keeps its default, which refuses tools that hide text from people, tools holding instructions aimed at the model, and servers with a known vulnerability in their dependencies, and servers that charge per call (x402), which an agent without a wallet cannot use (`paid: null` accepts them). Local packages are never loaded.
26
+ - `pins: { "io.github.owner/server": "<tools_hash>" }` passes over a server whose checked tools changed since you reviewed them; `strictTools: true` also compares the tools the server lists right now with the ones protogrid checked.
27
+ - `searchTool()` and `gateTool({ rules })` let the agent look for servers and check one itself.
28
+
29
+ Mastra 1.83 or later, Node.js 20 or later. Built on [`@protogrid/sdk`](https://www.npmjs.com/package/@protogrid/sdk) and the official MCP client. Full guide: [docs.protogrid.dev/sdk/mastra](https://docs.protogrid.dev/sdk/mastra/).
30
+
31
+ MIT licensed.
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Mastra tools from the protogrid MCP registry: the tools of MCP servers that pass your rules, connected directly (no
3
+ * proxy in between), plus two tools that let the agent search the registry and check a server itself.
4
+ */
5
+ import type { CallToolResult } from "@modelcontextprotocol/client";
6
+ import { createTool } from "@mastra/core/tools";
7
+ import { LoadReport, type LoadOptions, type LoadRules, type ProtogridClient } from "@protogrid/sdk";
8
+ export { LoadReport, NoServerLoaded, type LoadRules, type Skipped } from "@protogrid/sdk";
9
+ export type LoadToolsOptions = Omit<LoadOptions, "clientInfo">;
10
+ type MastraTool = ReturnType<typeof createTool>;
11
+ /** Where a loaded tool comes from. */
12
+ export interface ToolOrigin {
13
+ server: string;
14
+ /** The tool's own name on the server. */
15
+ tool: string;
16
+ /** The hash of the tool set protogrid checked. */
17
+ toolsHash: string | null;
18
+ }
19
+ export interface ProtogridTools {
20
+ /** Pass as an Agent's `tools`. Named `<server key>_<tool>`. */
21
+ tools: Record<string, MastraTool>;
22
+ origins: Record<string, ToolOrigin>;
23
+ report: LoadReport;
24
+ /** Closes the connection to every loaded server. Also runs on `await using`. */
25
+ close(): Promise<void>;
26
+ [Symbol.asyncDispose](): Promise<void>;
27
+ }
28
+ /**
29
+ * The tools of up to `maxServers` MCP servers that pass `rules`. Give a `query` (the best `candidates` search results
30
+ * are tried in order) or `servers` by registry name. Each server goes through protogrid's gate with your rules; one
31
+ * that passes is connected to directly, with the `${NAME}` placeholders of its connection filled from `secrets` (they
32
+ * never leave your process). Throws `NoServerLoaded` when none could be loaded; close the result when you are done.
33
+ */
34
+ export declare function loadTools(opts: LoadToolsOptions): Promise<ProtogridTools>;
35
+ /**
36
+ * An MCP tool result as the agent sees it: the text when the result is only text, the result itself otherwise. A
37
+ * result the server marks as an error throws, so the agent sees a failed tool call.
38
+ */
39
+ export declare function toolOutput(result: CallToolResult): unknown;
40
+ export interface RegistryToolOptions {
41
+ /** The registry client; one is built from `apiKey` (or `PROTOGRID_API_KEY`) and `baseUrl` otherwise. */
42
+ registry?: ProtogridClient;
43
+ apiKey?: string;
44
+ baseUrl?: string;
45
+ }
46
+ /** `protogrid_search`: finds MCP servers by what they do, with what decides the choice for each. */
47
+ export declare function searchTool(opts?: RegistryToolOptions): MastraTool;
48
+ /**
49
+ * `protogrid_gate`: whether one MCP server passes the rules given here. The model names the server; it cannot change
50
+ * the rules. The defaults are those of `loadTools`.
51
+ */
52
+ export declare function gateTool(opts?: RegistryToolOptions & {
53
+ rules?: LoadRules;
54
+ }): MastraTool;
55
+ //# sourceM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AO,CAQ1D;AAED,MAAM,WAAW,mBAAmB;IAClC,wGAAwG;IACxG,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkBD,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,IAAI,GAAE,mBAAwB,GAAG,UAAU,CA6BrE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,GAAE,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAA;CAAO,GAAG,UAAU,CAsC3F"}
package/dist/index.js ADDED
@@ -0,0 +1,140 @@
1
+ import { createTool } from "@mastra/core/tools";
2
+ import { createClient, LoadReport, loadRules, loadServers, prefixedToolName, ProtogridError, } from "@protogrid/sdk";
3
+ export { LoadReport, NoServerLoaded } from "@protogrid/sdk";
4
+ const CLIENT = { name: "protogrid-mastra", version: "0.1.1" };
5
+ /**
6
+ * The tools of up to `maxServers` MCP servers that pass `rules`. Give a `query` (the best `candidates` search results
7
+ * are tried in order) or `servers` by registry name. Each server goes through protogrid's gate with your rules; one
8
+ * that passes is connected to directly, with the `${NAME}` placeholders of its connection filled from `secrets` (they
9
+ * never leave your process). Throws `NoServerLoaded` when none could be loaded; close the result when you are done.
10
+ */
11
+ export async function loadTools(opts) {
12
+ const report = opts.report ?? new LoadReport();
13
+ const servers = await loadServers({ ...opts, report, clientInfo: CLIENT });
14
+ const tools = {};
15
+ const origins = {};
16
+ for (const s of servers) {
17
+ for (const t of s.tools) {
18
+ const id = prefixedToolName(s.key, t.name);
19
+ if (id in tools)
20
+ continue;
21
+ tools[id] = mcpTool(id, s, t);
22
+ origins[id] = { server: s.server, tool: t.name, toolsHash: s.toolsHash };
23
+ }
24
+ }
25
+ const close = async () => {
26
+ await Promise.allSettled(servers.map((s) => s.close()));
27
+ };
28
+ return { tools, origins, report, close, [Symbol.asyncDispose]: close };
29
+ }
30
+ function mcpTool(id, server, t) {
31
+ return createTool({
32
+ id,
33
+ description: t.description ?? t.title ?? "",
34
+ inputSchema: { type: "object", properties: {}, ...t.inputSchema },
35
+ execute: async (input, ctx) => toolOutput(await server.callTool(t.name, (input ?? {}), ctx?.abortSignal ? { signal: ctx.abortSignal } : {})),
36
+ });
37
+ }
38
+ /**
39
+ * An MCP tool result as the agent sees it: the text when the result is only text, the result itself otherwise. A
40
+ * result the server marks as an error throws, so the agent sees a failed tool call.
41
+ */
42
+ export function toolOutput(result) {
43
+ const content = result.content ?? [];
44
+ const text = content.every((c) => c.type === "text")
45
+ ? content.map((c) => c.text).join("\n")
46
+ : null;
47
+ if (result.isError)
48
+ throw new Error(text || "the tool failed");
49
+ if (text !== null && content.length > 0)
50
+ return text;
51
+ return content.length === 0 && result.structuredContent ? result.structuredContent : result;
52
+ }
53
+ const registryOf = (o) => o.registry ?? createClient({ apiKey: o.apiKey, baseUrl: o.baseUrl, userAgent: `${CLIENT.name}/${CLIENT.version}` });
54
+ function summary(r) {
55
+ return {
56
+ name: r.name,
57
+ title: r.title ?? null,
58
+ description: (r.description ?? "").slice(0, 300),
59
+ connection_class: r.connection_class,
60
+ quality_score: r.quality_score ?? null,
61
+ quality_flags: r.quality_flags ?? [],
62
+ owner_verified: r.owner_verified ?? false,
63
+ tools: (r.matched_tools ?? []).map((t) => t.name).slice(0, 5),
64
+ };
65
+ }
66
+ /** `protogrid_search`: finds MCP servers by what they do, with what decides the choice for each. */
67
+ export function searchTool(opts = {}) {
68
+ const reg = registryOf(opts);
69
+ return createTool({
70
+ id: "protogrid_search",
71
+ description: "Find MCP servers by what they do. Returns for each: its registry name, connection class (R0 nothing to set up, R1 needs a key, R2 needs a sign-in, L0 a local package), quality score and flags, whether its owner is verified, and the tools that matched.",
72
+ inputSchema: {
73
+ type: "object",
74
+ properties: {
75
+ query: {
76
+ type: "string",
77
+ description: "What the MCP server should do, in plain words, such as 'send an email' or 'query a postgres database'.",
78
+ },
79
+ limit: { type: "integer", minimum: 1, maximum: 20, default: 5, description: "How many servers to return." },
80
+ },
81
+ required: ["query"],
82
+ additionalProperties: false,
83
+ },
84
+ execute: async (input) => {
85
+ const { query, limit } = input;
86
+ try {
87
+ return (await reg.search({ q: query, limit: limit ?? 5 })).results.map(summary);
88
+ }
89
+ catch (e) {
90
+ if (e instanceof ProtogridError)
91
+ return { error: e.code, status: e.status };
92
+ throw e;
93
+ }
94
+ },
95
+ });
96
+ }
97
+ /**
98
+ * `protogrid_gate`: whether one MCP server passes the rules given here. The model names the server; it cannot change
99
+ * the rules. The defaults are those of `loadTools`.
100
+ */
101
+ export function gateTool(opts = {}) {
102
+ const reg = registryOf(opts);
103
+ const rules = loadRules(opts.rules);
104
+ return createTool({
105
+ id: "protogrid_gate",
106
+ description: "Check whether an MCP server passes the rules its owner set for this agent before using it. Returns pass or fail with every broken rule.",
107
+ inputSchema: {
108
+ type: "object",
109
+ properties: {
110
+ server: {
111
+ type: "string",
112
+ description: "The server's registry name, such as io.github.owner/server, as protogrid_search returns it.",
113
+ },
114
+ },
115
+ required: ["server"],
116
+ additionalProperties: false,
117
+ },
118
+ execute: async (input) => {
119
+ const { server } = input;
120
+ try {
121
+ const g = await reg.gate(server, rules);
122
+ return {
123
+ server: g.server,
124
+ pass: g.pass,
125
+ failed: g.failed.map((f) => f.detail),
126
+ quality_score: g.quality.score,
127
+ connection_class: g.class,
128
+ owner_verified: g.owner_verified,
129
+ tools_hash: g.tools_hash,
130
+ };
131
+ }
132
+ catch (e) {
133
+ if (e instanceof ProtogridError)
134
+ return { server, pass: false, failed: [`registry answered ${e.status} (${e.code})`] };
135
+ throw e;
136
+ }
137
+ },
138
+ });
139
+ }
140
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WA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I,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,6FAA6F;iBAC3G;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,oBAAoB,EAAE,KAAK;SACnB;QACV,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACvB,MAAM,EAAE,MAAM,EAAE,GAAG,KAA2B,CAAC;YAC/C,IAAI,CAAC;gBACH,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;gBACxC,OAAO;oBACL,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;oBACrC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK;oBAC9B,gBAAgB,EAAE,CAAC,CAAC,KAAK;oBACzB,cAAc,EAAE,CAAC,CAAC,cAAc;oBAChC,UAAU,EAAE,CAAC,CAAC,UAAU;iBACzB,CAAC;YACJ,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,YAAY,cAAc;oBAC7B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,qBAAqB,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACxF,MAAM,CAAC,CAAC;YACV,CAAC;QACH,CAAC;KACF,CAAe,CAAC;AACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@protogrid/mastra",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Mastra tools from the protogrid MCP registry: find MCP servers by what they do, check them against your rules, and give your agent the tools of the ones that pass.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "sideEffects": false,
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc -b tsconfig.json",
24
+ "typecheck": "tsc -b tsconfig.json",
25
+ "prepublishOnly": "pnpm run build"
26
+ },
27
+ "dependencies": {
28
+ "@modelcontextprotocol/client": "^2.2.0",
29
+ "@protogrid/sdk": "^0.6.1"
30
+ },
31
+ "peerDependencies": {
32
+ "@mastra/core": ">=1.83.0 <2.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@mastra/core": "^1.85.0",
36
+ "ai": "^7.0.181",
37
+ "@modelcontextprotocol/node": "^2.1.0",
38
+ "@modelcontextprotocol/server": "^2.1.0",
39
+ "typescript": "^5.9.3",
40
+ "zod": "^4.6.7"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/protogrid-dev/sdk.git",
45
+ "directory": "mastra"
46
+ },
47
+ "homepage": "https://docs.protogrid.dev/sdk/mastra/",
48
+ "bugs": {
49
+ "url": "https://github.com/protogrid-dev/sdk/issues"
50
+ },
51
+ "keywords": [
52
+ "mcp",
53
+ "model-context-protocol",
54
+ "mastra",
55
+ "agents",
56
+ "tools",
57
+ "protogrid"
58
+ ],
59
+ "publishConfig": {
60
+ "access": "public"
61
+ }
62
+ }