@uuaid/mcp 0.1.1 → 0.3.0
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 +201 -0
- package/README.md +24 -2
- package/dist/server.js +273 -148
- package/package.json +8 -6
- package/server.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 UUAID Foundation contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -35,9 +35,25 @@ minted in one call.
|
|
|
35
35
|
| `save_memory` / `recall_memory` | Persist + retrieve memories across sessions |
|
|
36
36
|
| `list_memories` / `delete_memory` | Manage the vault |
|
|
37
37
|
| `verify_agent` | Publicly verify any other agent's identity + certifications |
|
|
38
|
-
| `get_badge_url` | Live SVG
|
|
38
|
+
| `get_badge_url` | Live SVG badge URLs for READMEs (agent badge and unified trust badge) |
|
|
39
39
|
| `whoami` | Show configured identity + vault status |
|
|
40
40
|
|
|
41
|
+
### Trust and the directory (read-only, no API key needed)
|
|
42
|
+
|
|
43
|
+
| Tool | Returns | Use it |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `get_trust` | `credentialed`, `state` (`credentialed` / `key-proven` / `unverified`), `reasons`, `as_of`, the key binding, each credential with `verified`, `stale` and its `reason` (`GET /trust/{uuaid}`) | before relying on another agent |
|
|
46
|
+
| `search_directory` | public agents matching `q` or `skill`: uuaid, name, skills, the directory's verification summary, the Pillar transport key; `next_cursor` | to find an agent to work with |
|
|
47
|
+
| `resolve_agent` | an agent's Pillar `public_key` from its `uuaid` or profile `name`, checked to derive the UUAID | to address or verify a message from that agent |
|
|
48
|
+
|
|
49
|
+
`credentialed` is false unless the API's summary is fully consistent. On failure these
|
|
50
|
+
tools return `{"code": "...", "fix": "..."}` with `isError`: for example `not_found` (unknown,
|
|
51
|
+
removed, blocked or hidden), `invalid_uuaid`, `response_invalid`, `rate_limited`,
|
|
52
|
+
`api_unavailable`, `network_error`, `input_invalid`.
|
|
53
|
+
|
|
54
|
+
Messaging tools are not in this package: sending over Pillar needs the agent's private key,
|
|
55
|
+
so they belong with the key-holding Pillar tooling.
|
|
56
|
+
|
|
41
57
|
## How the memory works
|
|
42
58
|
|
|
43
59
|
- Encryption happens **inside this process** with [`@uuaid/vault`](https://www.npmjs.com/package/@uuaid/vault):
|
|
@@ -54,10 +70,16 @@ minted in one call.
|
|
|
54
70
|
A UUAID (`uuaid:foundation:agent:<uuidv7>`) is durable and portable — it is not
|
|
55
71
|
tied to a platform, a framework, or a session. Anyone can resolve it at
|
|
56
72
|
[registry.uuaid.org](https://registry.uuaid.org), verify its certifications
|
|
57
|
-
(examined at
|
|
73
|
+
(examined at AI Agent University (AIAU)), and check the on-chain anchor.
|
|
58
74
|
|
|
59
75
|
```md
|
|
60
76
|
[](https://registry.uuaid.org)
|
|
61
77
|
```
|
|
62
78
|
|
|
63
79
|
Docs: [api.uuaid.org/docs](https://api.uuaid.org/docs) · Spec: `docs/UAP-SPEC.md` · Apache-2.0
|
|
80
|
+
|
|
81
|
+
## Registry listing
|
|
82
|
+
|
|
83
|
+
This server ships **stdio-only**, run via `npx @uuaid/mcp` — there is no hosted
|
|
84
|
+
remote endpoint. `server.json` and `glama.json` intentionally carry no
|
|
85
|
+
`remotes` entry; add one only once a streamable-HTTP endpoint actually exists.
|
package/dist/server.js
CHANGED
|
@@ -1,166 +1,291 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/server.ts
|
|
4
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
|
|
6
|
+
// src/tools.ts
|
|
7
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
8
|
import { z } from "zod";
|
|
7
|
-
import { UuaidClient, generateVaultKey } from "@uuaid/sdk";
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { UuaidClient, UuaidError, generateVaultKey } from "@uuaid/sdk";
|
|
10
|
+
var MCP_SERVER_VERSION = "0.3.0";
|
|
11
|
+
var TOOL_FIXES = Object.freeze({
|
|
12
|
+
input_invalid: "Pass exactly one of uuaid or name.",
|
|
13
|
+
network_error: "Check network access to UUAID_BASE_URL and retry.",
|
|
14
|
+
timeout: "Retry; the UUAID API did not answer in time.",
|
|
15
|
+
internal_error: "Retry once; if it repeats, report the tool name and input to the operator."
|
|
16
|
+
});
|
|
13
17
|
function text(v) {
|
|
14
18
|
return { content: [{ type: "text", text: typeof v === "string" ? v : JSON.stringify(v, null, 2) }] };
|
|
15
19
|
}
|
|
16
20
|
function err(message) {
|
|
17
21
|
return { content: [{ type: "text", text: message }], isError: true };
|
|
18
22
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
23
|
+
function refuse(code, fix) {
|
|
24
|
+
return { content: [{ type: "text", text: JSON.stringify({ code, fix }) }], isError: true };
|
|
25
|
+
}
|
|
26
|
+
function failure(e) {
|
|
27
|
+
if (e instanceof UuaidError) return refuse(e.code ?? `http_${e.status}`, e.fix ?? `The UUAID API answered HTTP ${e.status}.`);
|
|
28
|
+
const name = e instanceof Error ? e.name : "";
|
|
29
|
+
if (name === "TimeoutError" || name === "AbortError") return refuse("timeout", TOOL_FIXES.timeout);
|
|
30
|
+
if (e instanceof TypeError) return refuse("network_error", TOOL_FIXES.network_error);
|
|
31
|
+
return refuse("internal_error", TOOL_FIXES.internal_error);
|
|
21
32
|
}
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
var UUAID_INPUT = z.string().min(1).max(256).describe("A UUAID, e.g. uuaid:foundation:agent:<8-4-4-4-12 hex>");
|
|
34
|
+
function createUuaidMcpServer(opts = {}) {
|
|
35
|
+
const BASE_URL = opts.baseUrl ?? "https://api.uuaid.org";
|
|
36
|
+
const API_KEY = opts.apiKey;
|
|
37
|
+
const VAULT_KEY = opts.vaultKey;
|
|
38
|
+
const DEFAULT_AGENT = opts.defaultAgent;
|
|
39
|
+
const client = new UuaidClient({ baseUrl: BASE_URL, apiKey: API_KEY, ...opts.fetchImpl ? { fetchImpl: opts.fetchImpl } : {} });
|
|
40
|
+
const agentOr = (param) => param ?? DEFAULT_AGENT ?? null;
|
|
41
|
+
const server2 = new McpServer(
|
|
42
|
+
{ name: "uuaid", version: MCP_SERVER_VERSION },
|
|
43
|
+
{
|
|
44
|
+
instructions: "UUAID gives you a permanent, verifiable identity (a UUAID) and encrypted memory that survives across sessions. Typical flow: (1) if no API key is configured, call uuaid_signup once and ask your operator to save the key; (2) call mint_identity once to get YOUR UUAID \u2014 reuse it forever; (3) save_memory / recall_memory to persist what matters beyond this session. Memories are encrypted client-side; the service only ever sees ciphertext. To check another agent: search_directory to find it, resolve_agent for its public key, get_trust before relying on it. These three are read-only and need no API key; on failure they return {code, fix}."
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
server2.registerTool(
|
|
48
|
+
"uuaid_signup",
|
|
49
|
+
{
|
|
50
|
+
description: "One-time self-serve signup: mints a free-tier UUAID API key (10 MB encrypted memory per agent). Returns the key ONCE \u2014 the operator must save it as UUAID_API_KEY (and generate UUAID_VAULT_KEY). Rate-limited.",
|
|
51
|
+
inputSchema: { name: z.string().min(2).max(80).describe("A name for this workspace/operator, e.g. 'Ana's Agent Lab'") }
|
|
52
|
+
},
|
|
53
|
+
async ({ name }) => {
|
|
54
|
+
if (API_KEY) return err("An API key is already configured (UUAID_API_KEY) \u2014 signup is not needed.");
|
|
55
|
+
const res = await UuaidClient.signup(name, { baseUrl: BASE_URL });
|
|
56
|
+
const vaultKey = generateVaultKey();
|
|
57
|
+
return text({
|
|
58
|
+
...res,
|
|
59
|
+
generated_vault_key: vaultKey,
|
|
60
|
+
next_steps: "Save these in the MCP env NOW (shown once): UUAID_API_KEY=<api_key>, UUAID_VAULT_KEY=<generated_vault_key>. Then call mint_identity to create your permanent UUAID."
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
server2.registerTool(
|
|
65
|
+
"mint_identity",
|
|
66
|
+
{
|
|
67
|
+
description: "Mint a PERMANENT UUAID identity for this agent (do this once, then reuse it \u2014 set it as UUAID_AGENT). The identity is publicly resolvable, ledger-recorded, and anchored on Polygon.",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
display_name: z.string().min(1).describe("The agent's name, e.g. 'Aria'"),
|
|
70
|
+
description: z.string().optional().describe("What this agent is/does")
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
async ({ display_name, description }) => {
|
|
74
|
+
if (!API_KEY) return err("No UUAID_API_KEY configured \u2014 call uuaid_signup first.");
|
|
75
|
+
const res = await client.registerAgent({ display_name, description });
|
|
76
|
+
return text({
|
|
77
|
+
...res,
|
|
78
|
+
note: "This UUAID is yours permanently. Ask your operator to set UUAID_AGENT to it so memory tools default to you.",
|
|
79
|
+
profile_url: `https://registry.uuaid.org/uuaid/${res.uuaid.split(":").slice(1).join("/")}`
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
server2.registerTool(
|
|
84
|
+
"whoami",
|
|
85
|
+
{ description: "Show the configured partner, default agent identity, and vault status.", inputSchema: {} },
|
|
86
|
+
async () => {
|
|
87
|
+
const me = API_KEY ? await client.me().catch((e) => ({ error: String(e) })) : { error: "no UUAID_API_KEY configured" };
|
|
88
|
+
return text({
|
|
89
|
+
partner: me,
|
|
90
|
+
default_agent: DEFAULT_AGENT ?? null,
|
|
91
|
+
vault_key_configured: Boolean(VAULT_KEY),
|
|
92
|
+
base_url: BASE_URL
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
server2.registerTool(
|
|
97
|
+
"save_memory",
|
|
98
|
+
{
|
|
99
|
+
description: "Encrypt (client-side, AES-256-GCM) and persist a memory under a key path (e.g. 'core/persona', 'projects/x/notes'). Survives forever across sessions; the service stores only ciphertext; the content hash is ledger-anchored on-chain.",
|
|
100
|
+
inputSchema: {
|
|
101
|
+
key: z.string().min(1).max(512).describe("Slot path, e.g. 'core/persona' or 'memories/2026-07-03'"),
|
|
102
|
+
content: z.string().min(1).describe("The memory text to persist"),
|
|
103
|
+
agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT")
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
async ({ key, content, agent_uuaid }) => {
|
|
107
|
+
if (!API_KEY) return err("No UUAID_API_KEY configured \u2014 call uuaid_signup first.");
|
|
108
|
+
if (!VAULT_KEY) return err("No UUAID_VAULT_KEY configured \u2014 memories must be encrypted. Generate one (uuaid vault keygen) and set it.");
|
|
109
|
+
const agent = agentOr(agent_uuaid);
|
|
110
|
+
if (!agent) return err("No agent identity: pass agent_uuaid or set UUAID_AGENT (mint one with mint_identity).");
|
|
111
|
+
const res = await client.saveMemory(agent, key, content, VAULT_KEY);
|
|
112
|
+
return text(res);
|
|
52
113
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
partner: me,
|
|
71
|
-
default_agent: DEFAULT_AGENT ?? null,
|
|
72
|
-
vault_key_configured: Boolean(VAULT_KEY),
|
|
73
|
-
base_url: BASE_URL
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
server.registerTool(
|
|
78
|
-
"save_memory",
|
|
79
|
-
{
|
|
80
|
-
description: "Encrypt (client-side, AES-256-GCM) and persist a memory under a key path (e.g. 'core/persona', 'projects/x/notes'). Survives forever across sessions; the service stores only ciphertext; the content hash is ledger-anchored on-chain.",
|
|
81
|
-
inputSchema: {
|
|
82
|
-
key: z.string().min(1).max(512).describe("Slot path, e.g. 'core/persona' or 'memories/2026-07-03'"),
|
|
83
|
-
content: z.string().min(1).describe("The memory text to persist"),
|
|
84
|
-
agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT")
|
|
114
|
+
);
|
|
115
|
+
server2.registerTool(
|
|
116
|
+
"recall_memory",
|
|
117
|
+
{
|
|
118
|
+
description: "Fetch and decrypt a memory previously stored with save_memory.",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
key: z.string().min(1).max(512),
|
|
121
|
+
agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT")
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
async ({ key, agent_uuaid }) => {
|
|
125
|
+
if (!API_KEY) return err("No UUAID_API_KEY configured.");
|
|
126
|
+
if (!VAULT_KEY) return err("No UUAID_VAULT_KEY configured \u2014 cannot decrypt.");
|
|
127
|
+
const agent = agentOr(agent_uuaid);
|
|
128
|
+
if (!agent) return err("No agent identity: pass agent_uuaid or set UUAID_AGENT.");
|
|
129
|
+
const content = await client.loadMemory(agent, key, VAULT_KEY);
|
|
130
|
+
return text(content);
|
|
85
131
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
{
|
|
99
|
-
description: "Fetch and decrypt a memory previously stored with save_memory.",
|
|
100
|
-
inputSchema: {
|
|
101
|
-
key: z.string().min(1).max(512),
|
|
102
|
-
agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT")
|
|
132
|
+
);
|
|
133
|
+
server2.registerTool(
|
|
134
|
+
"list_memories",
|
|
135
|
+
{
|
|
136
|
+
description: "List this agent's memory slots (keys, sizes, hashes) and vault usage vs quota. Contents stay encrypted.",
|
|
137
|
+
inputSchema: { agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT") }
|
|
138
|
+
},
|
|
139
|
+
async ({ agent_uuaid }) => {
|
|
140
|
+
if (!API_KEY) return err("No UUAID_API_KEY configured.");
|
|
141
|
+
const agent = agentOr(agent_uuaid);
|
|
142
|
+
if (!agent) return err("No agent identity: pass agent_uuaid or set UUAID_AGENT.");
|
|
143
|
+
return text(await client.listVault(agent));
|
|
103
144
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
async ({ agent_uuaid }) => {
|
|
121
|
-
if (!API_KEY) return err("No UUAID_API_KEY configured.");
|
|
122
|
-
const agent = agentOr(agent_uuaid);
|
|
123
|
-
if (!agent) return err("No agent identity: pass agent_uuaid or set UUAID_AGENT.");
|
|
124
|
-
return text(await client.listVault(agent));
|
|
125
|
-
}
|
|
126
|
-
);
|
|
127
|
-
server.registerTool(
|
|
128
|
-
"delete_memory",
|
|
129
|
-
{
|
|
130
|
-
description: "Delete one memory slot (the deletion is ledger-recorded).",
|
|
131
|
-
inputSchema: {
|
|
132
|
-
key: z.string().min(1).max(512),
|
|
133
|
-
agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT")
|
|
145
|
+
);
|
|
146
|
+
server2.registerTool(
|
|
147
|
+
"delete_memory",
|
|
148
|
+
{
|
|
149
|
+
description: "Delete one memory slot (the deletion is ledger-recorded).",
|
|
150
|
+
inputSchema: {
|
|
151
|
+
key: z.string().min(1).max(512),
|
|
152
|
+
agent_uuaid: z.string().optional().describe("Defaults to UUAID_AGENT")
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
async ({ key, agent_uuaid }) => {
|
|
156
|
+
if (!API_KEY) return err("No UUAID_API_KEY configured.");
|
|
157
|
+
const agent = agentOr(agent_uuaid);
|
|
158
|
+
if (!agent) return err("No agent identity: pass agent_uuaid or set UUAID_AGENT.");
|
|
159
|
+
return text(await client.deleteVaultItem(agent, key));
|
|
134
160
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
);
|
|
162
|
+
server2.registerTool(
|
|
163
|
+
"verify_agent",
|
|
164
|
+
{
|
|
165
|
+
description: "Publicly resolve any UUAID \u2014 profile, versions, credentials (no auth needed). Use to verify other agents.",
|
|
166
|
+
inputSchema: { uuaid: z.string().min(1).describe("uuaid:foundation:agent:\u2026") }
|
|
167
|
+
},
|
|
168
|
+
async ({ uuaid }) => text(await client.resolve(uuaid))
|
|
169
|
+
);
|
|
170
|
+
server2.registerTool(
|
|
171
|
+
"get_badge_url",
|
|
172
|
+
{
|
|
173
|
+
description: "Live SVG trust-badge URLs for an agent \u2014 paste into a README to show verified identity/certification.",
|
|
174
|
+
inputSchema: { uuaid: z.string().min(1) }
|
|
175
|
+
},
|
|
176
|
+
async ({ uuaid }) => {
|
|
177
|
+
const enc = encodeURIComponent(uuaid);
|
|
178
|
+
return text({
|
|
179
|
+
agent_badge_svg: `${BASE_URL}/badge/agent/${enc}.svg`,
|
|
180
|
+
trust_badge_svg: client.trustBadgeUrl(uuaid),
|
|
181
|
+
markdown: `[](https://registry.uuaid.org/uuaid/${uuaid.split(":").slice(1).join("/")})`
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
server2.registerTool(
|
|
186
|
+
"get_trust",
|
|
187
|
+
{
|
|
188
|
+
description: `Returns the trust answer for one UUAID (GET /trust/{uuaid}): credentialed (true/false), state (credentialed, key-proven or unverified), the reasons, as_of, how the key is bound, and each credential with verified, stale and its reason. Use it before relying on another agent. credentialed is false unless the API's summary is fully consistent. An unknown, removed, blocked or hidden UUAID returns {code: "not_found", fix}. Read-only.`,
|
|
189
|
+
inputSchema: { uuaid: UUAID_INPUT },
|
|
190
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
191
|
+
},
|
|
192
|
+
async ({ uuaid }) => {
|
|
193
|
+
try {
|
|
194
|
+
const t = await client.trust(uuaid);
|
|
195
|
+
if (!t.found) return refuse(t.code, t.fix);
|
|
196
|
+
const b = t.body;
|
|
197
|
+
const pub = b.listing.visibility === "public" ? b : null;
|
|
198
|
+
return text({
|
|
199
|
+
uuaid: t.uuaid,
|
|
200
|
+
credentialed: t.credentialed,
|
|
201
|
+
state: t.state,
|
|
202
|
+
reasons: b.summary.reasons,
|
|
203
|
+
as_of: b.as_of,
|
|
204
|
+
identity: b.identity,
|
|
205
|
+
listing: b.listing,
|
|
206
|
+
...pub ? { profile: pub.profile, credentials: pub.credentials, registry_badge: pub.registry_badge } : {},
|
|
207
|
+
badge_url: b.summary.badge_url,
|
|
208
|
+
policy: b.summary.policy
|
|
209
|
+
});
|
|
210
|
+
} catch (e) {
|
|
211
|
+
return failure(e);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
server2.registerTool(
|
|
216
|
+
"search_directory",
|
|
217
|
+
{
|
|
218
|
+
description: "Returns public agents from the UUAID directory (AgentNet) matching text or a skill: uuaid, name, skills, the directory's verification summary, and the Pillar transport (uuaid + publicKey) when one is proven. Use it to find an agent to work with. Page with next_cursor. The verification here is a summary; call get_trust before relying on an agent. Read-only.",
|
|
219
|
+
inputSchema: {
|
|
220
|
+
q: z.string().max(256).optional().describe("Free text: name, description, handle, profile or listed skill"),
|
|
221
|
+
skill: z.string().max(120).optional().describe("One skill, matched exactly (case-insensitive)"),
|
|
222
|
+
status: z.enum(["active", "superseded"]).optional(),
|
|
223
|
+
limit: z.number().int().min(1).max(50).optional().describe("Default 20"),
|
|
224
|
+
cursor: z.string().max(1024).optional().describe("next_cursor from the previous page")
|
|
225
|
+
},
|
|
226
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
227
|
+
},
|
|
228
|
+
async ({ q, skill, status, limit, cursor }) => {
|
|
229
|
+
try {
|
|
230
|
+
const page = await client.searchDirectory({ q, skill, status, limit, cursor });
|
|
231
|
+
return text({
|
|
232
|
+
agents: page.agents.map((a) => ({
|
|
233
|
+
uuaid: a.uuaid,
|
|
234
|
+
display_name: a.displayName,
|
|
235
|
+
handle: a.handle,
|
|
236
|
+
source: a.source,
|
|
237
|
+
status: a.status,
|
|
238
|
+
profile_name: a.profile?.name ?? null,
|
|
239
|
+
bio: a.profile?.bio ?? null,
|
|
240
|
+
skills: a.skillsets.map((s) => s.value),
|
|
241
|
+
verification: { verified: a.verification.verified, state: a.verification.state, status: a.verification.status },
|
|
242
|
+
transport: a.transport ? { uuaid: a.transport.uuaid, public_key: a.transport.publicKey, binding: a.transport.binding } : null,
|
|
243
|
+
last_activity_at: a.lastActivityAt
|
|
244
|
+
})),
|
|
245
|
+
count: page.meta.count,
|
|
246
|
+
next_cursor: page.meta.nextCursor
|
|
247
|
+
});
|
|
248
|
+
} catch (e) {
|
|
249
|
+
return failure(e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
server2.registerTool(
|
|
254
|
+
"resolve_agent",
|
|
255
|
+
{
|
|
256
|
+
description: `Returns an agent's Pillar public key from its UUAID or its AgentNet profile name (GET /directory/resolve): uuaid, public_key, visibility, and for a public agent its profile_name, display_name and source. The key is checked to derive the UUAID. Use it to address or verify a message from that agent. Pass exactly one of uuaid or name. A miss returns {code: "not_found", fix}. Read-only.`,
|
|
257
|
+
inputSchema: {
|
|
258
|
+
uuaid: UUAID_INPUT.optional(),
|
|
259
|
+
name: z.string().min(1).max(256).optional().describe("An AgentNet profile name")
|
|
260
|
+
},
|
|
261
|
+
annotations: { readOnlyHint: true, openWorldHint: true }
|
|
262
|
+
},
|
|
263
|
+
async ({ uuaid, name }) => {
|
|
264
|
+
if (uuaid === void 0 === (name === void 0)) return refuse("input_invalid", TOOL_FIXES.input_invalid);
|
|
265
|
+
try {
|
|
266
|
+
const r = uuaid !== void 0 ? await client.resolveDirectory(uuaid) : await client.resolveDirectoryName(name);
|
|
267
|
+
if (!r.found) return refuse(r.code, r.fix);
|
|
268
|
+
const a = r.body;
|
|
269
|
+
return text({
|
|
270
|
+
uuaid: a.uuaid,
|
|
271
|
+
public_key: a.publicKey,
|
|
272
|
+
visibility: a.visibility,
|
|
273
|
+
...a.visibility === "public" ? { profile_name: a.profileName ?? null, display_name: a.displayName ?? null, source: a.source } : {}
|
|
274
|
+
});
|
|
275
|
+
} catch (e) {
|
|
276
|
+
return failure(e);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
return server2;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// src/server.ts
|
|
284
|
+
var server = createUuaidMcpServer({
|
|
285
|
+
baseUrl: process.env.UUAID_BASE_URL ?? "https://api.uuaid.org",
|
|
286
|
+
apiKey: process.env.UUAID_API_KEY,
|
|
287
|
+
vaultKey: process.env.UUAID_VAULT_KEY,
|
|
288
|
+
defaultAgent: process.env.UUAID_AGENT
|
|
289
|
+
});
|
|
165
290
|
var transport = new StdioServerTransport();
|
|
166
291
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuaid/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"mcpName": "io.github.uuaid/mcp",
|
|
5
|
-
"description": "UUAID MCP server — give any AI agent a permanent identity and encrypted, quantum-ready memory that outlives the session. Mint a UUAID, save/recall memories, embed live trust badges.",
|
|
5
|
+
"description": "UUAID MCP server — give any AI agent a permanent identity and encrypted, quantum-ready memory that outlives the session. Mint a UUAID, save/recall memories, embed live trust badges, look up trust and the agent directory.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"uuaid",
|
|
8
8
|
"mcp",
|
|
@@ -38,19 +38,21 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
41
|
-
"
|
|
42
|
-
"@uuaid/
|
|
43
|
-
"
|
|
41
|
+
"@uuaid/sdk": "0.3.0",
|
|
42
|
+
"@uuaid/vault": "0.2.1",
|
|
43
|
+
"zod": "^3.25.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.10.0",
|
|
47
47
|
"tsup": "^8.3.5",
|
|
48
48
|
"tsx": "^4.19.0",
|
|
49
|
-
"typescript": "^5.7.2"
|
|
49
|
+
"typescript": "^5.7.2",
|
|
50
|
+
"vitest": "^3.2.6"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
53
|
"build": "tsup",
|
|
53
54
|
"dev": "tsx src/server.ts",
|
|
55
|
+
"test": "vitest run",
|
|
54
56
|
"typecheck": "tsc --noEmit"
|
|
55
57
|
}
|
|
56
58
|
}
|
package/server.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
|
|
3
3
|
"name": "io.github.uuaid/mcp",
|
|
4
|
-
"description": "
|
|
5
|
-
"version": "0.
|
|
4
|
+
"description": "Permanent identity, encrypted memory, and read-only trust and directory lookups for any AI agent.",
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/uuaid/uuaid",
|
|
8
8
|
"source": "github",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "@uuaid/mcp",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.3.0",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"transport": { "type": "stdio" },
|
|
19
19
|
"environmentVariables": [
|