@provenonce/mcp 1.0.0 → 1.0.2
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 +216 -0
- package/README.md +153 -126
- package/dist/{chunk-CD2A6ZEQ.js → chunk-COVXPAEW.js} +9 -4
- package/dist/chunk-COVXPAEW.js.map +1 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/tools.d.ts +8 -3
- package/dist/tools.js +1 -1
- package/package.json +3 -2
- package/dist/chunk-CD2A6ZEQ.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
|
|
2
|
+
|
|
3
|
+
Contributions for which relicensing consent has been obtained are licensed under Apache-2.0. Contributions made by authors who originally licensed their work under the MIT License and who have not yet granted explicit permission to relicense remain licensed under the MIT License.
|
|
4
|
+
|
|
5
|
+
No rights beyond those granted by the applicable original license are conveyed for such contributions.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Apache License
|
|
10
|
+
Version 2.0, January 2004
|
|
11
|
+
http://www.apache.org/licenses/
|
|
12
|
+
|
|
13
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
14
|
+
|
|
15
|
+
1. Definitions.
|
|
16
|
+
|
|
17
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
18
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
19
|
+
|
|
20
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
21
|
+
the copyright owner that is granting the License.
|
|
22
|
+
|
|
23
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
24
|
+
other entities that control, are controlled by, or are under common
|
|
25
|
+
control with that entity. For the purposes of this definition,
|
|
26
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
27
|
+
direction or management of such entity, whether by contract or
|
|
28
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
29
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
30
|
+
|
|
31
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
32
|
+
exercising permissions granted by this License.
|
|
33
|
+
|
|
34
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
35
|
+
including but not limited to software source code, documentation
|
|
36
|
+
source, and configuration files.
|
|
37
|
+
|
|
38
|
+
"Object" form shall mean any form resulting from mechanical
|
|
39
|
+
transformation or translation of a Source form, including but
|
|
40
|
+
not limited to compiled object code, generated documentation,
|
|
41
|
+
and conversions to other media types.
|
|
42
|
+
|
|
43
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
44
|
+
Object form, made available under the License, as indicated by a
|
|
45
|
+
copyright notice that is included in or attached to the work
|
|
46
|
+
(an example is provided in the Appendix below).
|
|
47
|
+
|
|
48
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
49
|
+
form, that is based on (or derived from) the Work and for which the
|
|
50
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
51
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
52
|
+
of this License, Derivative Works shall not include works that remain
|
|
53
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
54
|
+
the Work and Derivative Works thereof.
|
|
55
|
+
|
|
56
|
+
"Contribution" shall mean any work of authorship, including
|
|
57
|
+
the original version of the Work and any modifications or additions
|
|
58
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
59
|
+
submitted to the Licensor for inclusion in the Work by the copyright
|
|
60
|
+
owner or by an individual or Legal Entity authorized to submit on behalf
|
|
61
|
+
of the copyright owner. For the purposes of this definition, "submitted"
|
|
62
|
+
means any form of electronic, verbal, or written communication sent
|
|
63
|
+
to the Licensor or its representatives, including but not limited to
|
|
64
|
+
communication on electronic mailing lists, source code control systems,
|
|
65
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
66
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
67
|
+
excluding communication that is conspicuously marked or otherwise
|
|
68
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
69
|
+
|
|
70
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
71
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
72
|
+
subsequently incorporated within the Work.
|
|
73
|
+
|
|
74
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
78
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
79
|
+
Work and such Derivative Works in Source or Object form.
|
|
80
|
+
|
|
81
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
82
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
83
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
84
|
+
(except as stated in this section) patent license to make, have made,
|
|
85
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
86
|
+
where such license applies only to those patent claims licensable
|
|
87
|
+
by such Contributor that are necessarily infringed by their
|
|
88
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
89
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
90
|
+
institute patent litigation against any entity (including a
|
|
91
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
92
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
93
|
+
or contributory patent infringement, then any patent licenses
|
|
94
|
+
granted to You under this License for that Work shall terminate
|
|
95
|
+
as of the date such litigation is filed.
|
|
96
|
+
|
|
97
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
98
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
99
|
+
modifications, and in Source or Object form, provided that You
|
|
100
|
+
meet the following conditions:
|
|
101
|
+
|
|
102
|
+
(a) You must give any other recipients of the Work or
|
|
103
|
+
Derivative Works a copy of this License; and
|
|
104
|
+
|
|
105
|
+
(b) You must cause any modified files to carry prominent notices
|
|
106
|
+
stating that You changed the files; and
|
|
107
|
+
|
|
108
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
109
|
+
that You distribute, all copyright, patent, trademark, and
|
|
110
|
+
attribution notices from the Source form of the Work,
|
|
111
|
+
excluding those notices that do not pertain to any part of
|
|
112
|
+
the Derivative Works; and
|
|
113
|
+
|
|
114
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
115
|
+
distribution, then any Derivative Works that You distribute must
|
|
116
|
+
include a readable copy of the attribution notices contained
|
|
117
|
+
within such NOTICE file, excluding those notices that do not
|
|
118
|
+
pertain to any part of the Derivative Works, in at least one
|
|
119
|
+
of the following places: within a NOTICE text file distributed
|
|
120
|
+
as part of the Derivative Works; within the Source form or
|
|
121
|
+
documentation, if provided along with the Derivative Works; or,
|
|
122
|
+
within a display generated by the Derivative Works, if and
|
|
123
|
+
wherever such third-party notices normally appear. The contents
|
|
124
|
+
of the NOTICE file are for informational purposes only and
|
|
125
|
+
do not modify the License. You may add Your own attribution
|
|
126
|
+
notices within Derivative Works that You distribute, alongside
|
|
127
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
128
|
+
that such additional attribution notices cannot be construed
|
|
129
|
+
as modifying the License.
|
|
130
|
+
|
|
131
|
+
You may add Your own copyright statement to Your modifications and
|
|
132
|
+
may provide additional or different license terms and conditions
|
|
133
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
134
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
135
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
136
|
+
the conditions stated in this License.
|
|
137
|
+
|
|
138
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
139
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
140
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
141
|
+
this License, without any additional terms or conditions.
|
|
142
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
143
|
+
the terms of any separate license agreement you may have executed
|
|
144
|
+
with Licensor regarding such Contributions.
|
|
145
|
+
|
|
146
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
147
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
148
|
+
except as required for reasonable and customary use in describing the
|
|
149
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
150
|
+
|
|
151
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
152
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
153
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
154
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
155
|
+
implied, including, without limitation, any warranties or conditions
|
|
156
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
157
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
158
|
+
appropriateness of using or redistributing the Work and assume any
|
|
159
|
+
risks associated with Your exercise of permissions under this License.
|
|
160
|
+
|
|
161
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
162
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
163
|
+
unless required by applicable law (such as deliberate and grossly
|
|
164
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
165
|
+
liable to You for damages, including any direct, indirect, special,
|
|
166
|
+
incidental, or consequential damages of any character arising as a
|
|
167
|
+
result of this License or out of the use or inability to use the
|
|
168
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
169
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
170
|
+
other commercial damages or losses), even if such Contributor
|
|
171
|
+
has been advised of the possibility of such damages.
|
|
172
|
+
|
|
173
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
174
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
175
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
176
|
+
or other liability obligations and/or rights consistent with this
|
|
177
|
+
License. However, in accepting such obligations, You may act only
|
|
178
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
179
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
180
|
+
defend, and hold each Contributor harmless for any liability
|
|
181
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
182
|
+
of your accepting any such warranty or additional liability.
|
|
183
|
+
|
|
184
|
+
END OF TERMS AND CONDITIONS
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
MIT License
|
|
189
|
+
|
|
190
|
+
Copyright (c) 2024-2025 Model Context Protocol a Series of LF Projects, LLC.
|
|
191
|
+
|
|
192
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
193
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
194
|
+
in the Software without restriction, including without limitation the rights
|
|
195
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
196
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
197
|
+
furnished to do so, subject to the following conditions:
|
|
198
|
+
|
|
199
|
+
The above copyright notice and this permission notice shall be included in all
|
|
200
|
+
copies or substantial portions of the Software.
|
|
201
|
+
|
|
202
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
203
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
204
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
205
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
206
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
207
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
208
|
+
SOFTWARE.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
Creative Commons Attribution 4.0 International (CC-BY-4.0)
|
|
213
|
+
|
|
214
|
+
Documentation in this project (excluding specifications) is licensed under
|
|
215
|
+
CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
|
|
216
|
+
the full license text.
|
package/README.md
CHANGED
|
@@ -1,126 +1,153 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
1
|
+
# MCP Registry
|
|
2
|
+
|
|
3
|
+
The MCP registry provides MCP clients with a list of MCP servers, like an app store for MCP servers.
|
|
4
|
+
|
|
5
|
+
[**📤 Publish my MCP server**](docs/modelcontextprotocol-io/quickstart.mdx) | [**⚡️ Live API docs**](https://registry.modelcontextprotocol.io/docs) | [**👀 Ecosystem vision**](docs/design/ecosystem-vision.md) | 📖 **[Full documentation](./docs)**
|
|
6
|
+
|
|
7
|
+
## Development Status
|
|
8
|
+
|
|
9
|
+
**2025-10-24 update**: The Registry API has entered an **API freeze (v0.1)** 🎉. For the next month or more, the API will remain stable with no breaking changes, allowing integrators to confidently implement support. This freeze applies to v0.1 while development continues on v0. We'll use this period to validate the API in real-world integrations and gather feedback to shape v1 for general availability. Thank you to everyone for your contributions and patience—your involvement has been key to getting us here!
|
|
10
|
+
|
|
11
|
+
**2025-09-08 update**: The registry has launched in preview 🎉 ([announcement blog post](https://blog.modelcontextprotocol.io/posts/2025-09-08-mcp-registry-preview/)). While the system is now more stable, this is still a preview release and breaking changes or data resets may occur. A general availability (GA) release will follow later. We'd love your feedback in [GitHub discussions](https://github.com/modelcontextprotocol/registry/discussions/new?category=ideas) or in the [#registry-dev Discord](https://discord.com/channels/1358869848138059966/1369487942862504016) ([joining details here](https://modelcontextprotocol.io/community/communication)).
|
|
12
|
+
|
|
13
|
+
Current key maintainers:
|
|
14
|
+
- **Adam Jones** (Anthropic) [@domdomegg](https://github.com/domdomegg)
|
|
15
|
+
- **Tadas Antanavicius** (PulseMCP) [@tadasant](https://github.com/tadasant)
|
|
16
|
+
- **Toby Padilla** (GitHub) [@toby](https://github.com/toby)
|
|
17
|
+
- **Radoslav (Rado) Dimitrov** (Stacklok) [@rdimitrov](https://github.com/rdimitrov)
|
|
18
|
+
|
|
19
|
+
## Contributing
|
|
20
|
+
|
|
21
|
+
We use multiple channels for collaboration - see [modelcontextprotocol.io/community/communication](https://modelcontextprotocol.io/community/communication).
|
|
22
|
+
|
|
23
|
+
Often (but not always) ideas flow through this pipeline:
|
|
24
|
+
|
|
25
|
+
- **[Discord](https://modelcontextprotocol.io/community/communication)** - Real-time community discussions
|
|
26
|
+
- **[Discussions](https://github.com/modelcontextprotocol/registry/discussions)** - Propose and discuss product/technical requirements
|
|
27
|
+
- **[Issues](https://github.com/modelcontextprotocol/registry/issues)** - Track well-scoped technical work
|
|
28
|
+
- **[Pull Requests](https://github.com/modelcontextprotocol/registry/pulls)** - Contribute work towards issues
|
|
29
|
+
|
|
30
|
+
### Quick start:
|
|
31
|
+
|
|
32
|
+
#### Pre-requisites
|
|
33
|
+
|
|
34
|
+
- **Docker**
|
|
35
|
+
- **Go 1.24.x**
|
|
36
|
+
- **ko** - Container image builder for Go ([installation instructions](https://ko.build/install/))
|
|
37
|
+
- **golangci-lint v2.4.0**
|
|
38
|
+
|
|
39
|
+
#### Running the server
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Start full development environment
|
|
43
|
+
make dev-compose
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This starts the registry at [`localhost:8080`](http://localhost:8080) with PostgreSQL. The database uses ephemeral storage and is reset each time you restart the containers, ensuring a clean state for development and testing.
|
|
47
|
+
|
|
48
|
+
**Note:** The registry uses [ko](https://ko.build) to build container images. The `make dev-compose` command automatically builds the registry image with ko and loads it into your local Docker daemon before starting the services.
|
|
49
|
+
|
|
50
|
+
By default, the registry seeds from the production API with a filtered subset of servers (to keep startup fast). This ensures your local environment mirrors production behavior and all seed data passes validation. For offline development you can seed from a file without validation with `MCP_REGISTRY_SEED_FROM=data/seed.json MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=false make dev-compose`.
|
|
51
|
+
|
|
52
|
+
The setup can be configured with environment variables in [docker-compose.yml](./docker-compose.yml) - see [.env.example](./.env.example) for a reference.
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary>Alternative: Running a pre-built Docker image</summary>
|
|
56
|
+
|
|
57
|
+
Pre-built Docker images are automatically published to GitHub Container Registry:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Run latest stable release
|
|
61
|
+
docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:latest
|
|
62
|
+
|
|
63
|
+
# Run latest from main branch (continuous deployment)
|
|
64
|
+
docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main
|
|
65
|
+
|
|
66
|
+
# Run specific release version
|
|
67
|
+
docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:v1.0.0
|
|
68
|
+
|
|
69
|
+
# Run development build from main branch
|
|
70
|
+
docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main-20250906-abc123d
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Available tags:**
|
|
74
|
+
- **Releases**: `latest`, `v1.0.0`, `v1.1.0`, etc.
|
|
75
|
+
- **Continuous**: `main` (latest main branch build)
|
|
76
|
+
- **Development**: `main-<date>-<sha>` (specific commit builds)
|
|
77
|
+
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
#### Publishing a server
|
|
81
|
+
|
|
82
|
+
To publish a server, we've built a simple CLI. You can use it with:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Build the latest CLI
|
|
86
|
+
make publisher
|
|
87
|
+
|
|
88
|
+
# Use it!
|
|
89
|
+
./bin/mcp-publisher --help
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See [the publisher guide](./docs/modelcontextprotocol-io/quickstart.mdx) for more details.
|
|
93
|
+
|
|
94
|
+
#### Other commands
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Run lint, unit tests and integration tests
|
|
98
|
+
make check
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
There are also a few more helpful commands for development. Run `make help` to learn more, or look in [Makefile](./Makefile).
|
|
102
|
+
|
|
103
|
+
<!--
|
|
104
|
+
For Claude and other AI tools: Always prefer make targets over custom commands where possible.
|
|
105
|
+
-->
|
|
106
|
+
|
|
107
|
+
## Architecture
|
|
108
|
+
|
|
109
|
+
### Project Structure
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
├── cmd/ # Application entry points
|
|
113
|
+
│ └── publisher/ # Server publishing tool
|
|
114
|
+
├── data/ # Seed data
|
|
115
|
+
├── deploy/ # Deployment configuration (Pulumi)
|
|
116
|
+
├── docs/ # Documentation
|
|
117
|
+
├── internal/ # Private application code
|
|
118
|
+
│ ├── api/ # HTTP handlers and routing
|
|
119
|
+
│ ├── auth/ # Authentication (GitHub OAuth, JWT, namespace blocking)
|
|
120
|
+
│ ├── config/ # Configuration management
|
|
121
|
+
│ ├── database/ # Data persistence (PostgreSQL)
|
|
122
|
+
│ ├── service/ # Business logic
|
|
123
|
+
│ ├── telemetry/ # Metrics and monitoring
|
|
124
|
+
│ └── validators/ # Input validation
|
|
125
|
+
├── pkg/ # Public packages
|
|
126
|
+
│ ├── api/ # API types and structures
|
|
127
|
+
│ │ └── v0/ # Version 0 API types
|
|
128
|
+
│ └── model/ # Data models for server.json
|
|
129
|
+
├── scripts/ # Development and testing scripts
|
|
130
|
+
├── tests/ # Integration tests
|
|
131
|
+
└── tools/ # CLI tools and utilities
|
|
132
|
+
└── validate-*.sh # Schema validation tools
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Authentication
|
|
136
|
+
|
|
137
|
+
Publishing supports multiple authentication methods:
|
|
138
|
+
- **GitHub OAuth** - For publishing by logging into GitHub
|
|
139
|
+
- **GitHub OIDC** - For publishing from GitHub Actions
|
|
140
|
+
- **DNS verification** - For proving ownership of a domain and its subdomains
|
|
141
|
+
- **HTTP verification** - For proving ownership of a domain
|
|
142
|
+
|
|
143
|
+
The registry validates namespace ownership when publishing. E.g. to publish...:
|
|
144
|
+
- `io.github.domdomegg/my-cool-mcp` you must login to GitHub as `domdomegg`, or be in a GitHub Action on domdomegg's repos
|
|
145
|
+
- `me.adamjones/my-cool-mcp` you must prove ownership of `adamjones.me` via DNS or HTTP challenge
|
|
146
|
+
|
|
147
|
+
## Community Projects
|
|
148
|
+
|
|
149
|
+
Check out [community projects](docs/community-projects.md) to explore notable registry-related work created by the community.
|
|
150
|
+
|
|
151
|
+
## More documentation
|
|
152
|
+
|
|
153
|
+
See the [documentation](./docs) for more details if your question has not been answered here!
|
|
@@ -45,15 +45,20 @@ var PROVENONCE_TOOLS = [
|
|
|
45
45
|
},
|
|
46
46
|
identity_class: {
|
|
47
47
|
type: "string",
|
|
48
|
-
enum: ["
|
|
49
|
-
description: "
|
|
48
|
+
enum: ["narrow_task", "autonomous", "orchestrator"],
|
|
49
|
+
description: "Agent identity class (pricing axis): narrow_task=single-purpose, autonomous=independent decision-maker, orchestrator=coordinates other agents"
|
|
50
|
+
},
|
|
51
|
+
tier: {
|
|
52
|
+
type: "string",
|
|
53
|
+
enum: ["sov", "org", "ind", "eph", "sbx"],
|
|
54
|
+
description: "Trust governance tier: sov=sovereign/root, org=organisation, ind=individual, eph=ephemeral, sbx=sandbox"
|
|
50
55
|
},
|
|
51
56
|
payment_tx: {
|
|
52
57
|
type: "string",
|
|
53
58
|
description: "Solana transaction signature for the SIGIL fee payment"
|
|
54
59
|
}
|
|
55
60
|
},
|
|
56
|
-
required: ["name", "principal", "identity_class", "payment_tx"]
|
|
61
|
+
required: ["name", "principal", "identity_class", "tier", "payment_tx"]
|
|
57
62
|
}
|
|
58
63
|
},
|
|
59
64
|
{
|
|
@@ -148,4 +153,4 @@ var PROVENONCE_TOOLS = [
|
|
|
148
153
|
export {
|
|
149
154
|
PROVENONCE_TOOLS
|
|
150
155
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
156
|
+
//# sourceMappingURL=chunk-COVXPAEW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools.ts"],"sourcesContent":["/** Provenonce Skill — 9 MCP tool definitions (JSON Schema) */\r\nexport const PROVENONCE_TOOLS = [\r\n {\r\n name: 'provenonce_register',\r\n description:\r\n 'Register this agent with Provenonce to get a cryptographic identity (hash + API key). ' +\r\n 'Safe to call multiple times — returns existing identity if already registered. ' +\r\n 'No wallet required. Free.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'Human-readable name for this agent (optional, max 64 chars)',\r\n maxLength: 64,\r\n },\r\n skill_ref: {\r\n type: 'string',\r\n description:\r\n '16-character hex ref token of the skill that deployed you — for rev-share attribution (optional)',\r\n pattern: '^[0-9a-f]{16}$',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_status',\r\n description:\r\n 'Get this agent\\'s current Provenonce status: identity, SIGIL, beats balance, and next steps. ' +\r\n 'Requires prior provenonce_register call.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {},\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_purchase_sigil',\r\n description:\r\n 'Purchase a Provenonce SIGIL to unlock full provenance: heartbeat access, signed passport, ' +\r\n 'and a permanent identity record. Requires a Solana payment transaction. ' +\r\n 'SIGIL format: name*principal*tier (e.g. my-agent*acme*ind).',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'SIGIL name segment — identifies this specific agent (e.g. \"my-agent\")',\r\n },\r\n principal: {\r\n type: 'string',\r\n description: 'Principal segment — identifies the operator or organisation (e.g. \"acme\")',\r\n },\r\n identity_class: {\r\n type: 'string',\r\n enum: ['narrow_task', 'autonomous', 'orchestrator'],\r\n description:\r\n 'Agent identity class (pricing axis): narrow_task=single-purpose, autonomous=independent decision-maker, orchestrator=coordinates other agents',\r\n },\r\n tier: {\r\n type: 'string',\r\n enum: ['sov', 'org', 'ind', 'eph', 'sbx'],\r\n description:\r\n 'Trust governance tier: sov=sovereign/root, org=organisation, ind=individual, eph=ephemeral, sbx=sandbox',\r\n },\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the SIGIL fee payment',\r\n },\r\n },\r\n required: ['name', 'principal', 'identity_class', 'tier', 'payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_heartbeat',\r\n description:\r\n 'Submit a heartbeat to prove this agent is alive. Requires a SIGIL (call provenonce_purchase_sigil first). ' +\r\n 'Requires a Solana payment transaction for the heartbeat fee.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the heartbeat fee payment',\r\n },\r\n },\r\n required: ['payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_passport',\r\n description:\r\n 'Get this agent\\'s cryptographically signed Passport — a verifiable identity document ' +\r\n 'any third party can verify offline using the Provenonce authority public key. ' +\r\n 'Requires an active SIGIL and at least one heartbeat.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the passport reissue fee (if applicable)',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_beats_proof',\r\n description:\r\n 'Compute a local Beats work-proof — cryptographic evidence of computational effort by this agent. ' +\r\n 'Returns a hash chain proof that can be shared as evidence of work. No network call required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n count: {\r\n type: 'integer',\r\n description: 'Number of beats to compute (min 10, max 1000)',\r\n minimum: 10,\r\n maximum: 1000,\r\n },\r\n },\r\n required: ['count'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_verify_agent',\r\n description:\r\n 'Verify another agent\\'s Provenonce identity. Returns their SIGIL, identity class, and registration status. ' +\r\n 'Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description: 'The agent hash to verify (0x + 64 hex chars)',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n required: ['hash'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_spawn',\r\n description:\r\n 'Spawn a child agent under this agent\\'s identity. The child inherits lineage from the parent. ' +\r\n 'Returns the child\\'s hash and API key. Requires sufficient beats balance or a work-proof receipt.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n child_name: {\r\n type: 'string',\r\n description: 'Name for the child agent (max 64 chars)',\r\n maxLength: 64,\r\n },\r\n },\r\n required: ['child_name'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_lineage',\r\n description:\r\n 'Get the full lineage chain for an agent — all events in its provenance history ' +\r\n '(registration, SIGIL issuance, heartbeats, spawns). Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description:\r\n 'The agent hash to get lineage for (0x + 64 hex chars). Defaults to this agent if omitted.',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n },\r\n },\r\n] as const;\r\n\r\nexport type ToolName = (typeof PROVENONCE_TOOLS)[number]['name'];\r\n"],"mappings":";;;AACO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aA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,QACf;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,OAAO;AAAA,UACL,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,UACT,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,UAAU,CAAC,OAAO;AAAA,IACpB;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,UAAU,CAAC,MAAM;AAAA,IACnB;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,UACb,WAAW;AAAA,QACb;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,IACzB;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aACE;AAAA,UACF,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @provenonce/mcp — Provenonce Skill for AI agents
|
|
2
2
|
import {
|
|
3
3
|
PROVENONCE_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-COVXPAEW.js";
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
7
7
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
@@ -119,6 +119,7 @@ async function purchaseSigil(apiKey, opts) {
|
|
|
119
119
|
name: opts.name,
|
|
120
120
|
principal: opts.principal,
|
|
121
121
|
identity_class: opts.identity_class,
|
|
122
|
+
tier: opts.tier,
|
|
122
123
|
payment_tx: opts.payment_tx,
|
|
123
124
|
...opts.skillRef ? { ref: opts.skillRef } : {}
|
|
124
125
|
}
|
|
@@ -234,6 +235,7 @@ async function handlePurchaseSigil(args) {
|
|
|
234
235
|
name: args.name,
|
|
235
236
|
principal: args.principal,
|
|
236
237
|
identity_class: args.identity_class,
|
|
238
|
+
tier: args.tier,
|
|
237
239
|
payment_tx: args.payment_tx,
|
|
238
240
|
skillRef
|
|
239
241
|
});
|
|
@@ -343,6 +345,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
343
345
|
name: a.name,
|
|
344
346
|
principal: a.principal,
|
|
345
347
|
identity_class: a.identity_class,
|
|
348
|
+
tier: a.tier,
|
|
346
349
|
payment_tx: a.payment_tx
|
|
347
350
|
});
|
|
348
351
|
case "provenonce_heartbeat":
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/handlers.ts","../src/credentials.ts","../src/client.ts"],"sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\r\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\r\nimport {\r\n CallToolRequestSchema,\r\n ListToolsRequestSchema,\r\n} from '@modelcontextprotocol/sdk/types.js';\r\n\r\nimport { PROVENONCE_TOOLS } from './tools.js';\r\nimport {\r\n handleRegister,\r\n handleStatus,\r\n handlePurchaseSigil,\r\n handleHeartbeat,\r\n handleGetPassport,\r\n handleBeatsProof,\r\n handleVerifyAgent,\r\n handleSpawn,\r\n handleGetLineage,\r\n} from './handlers.js';\r\n\r\nconst server = new Server(\r\n { name: 'provenonce', version: '1.0.0' },\r\n { capabilities: { tools: {} } },\r\n);\r\n\r\n// List available tools\r\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({\r\n tools: PROVENONCE_TOOLS.map((t) => ({\r\n name: t.name,\r\n description: t.description,\r\n inputSchema: t.inputSchema,\r\n })),\r\n}));\r\n\r\n// Handle tool calls\r\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\r\n const { name, arguments: args = {} } = request.params;\r\n const a = args as Record<string, unknown>;\r\n\r\n switch (name) {\r\n case 'provenonce_register':\r\n return handleRegister({\r\n name: a.name as string | undefined,\r\n skill_ref: a.skill_ref as string | undefined,\r\n });\r\n\r\n case 'provenonce_status':\r\n return handleStatus();\r\n\r\n case 'provenonce_purchase_sigil':\r\n return handlePurchaseSigil({\r\n name: a.name as string,\r\n principal: a.principal as string,\r\n identity_class: a.identity_class as string,\r\n payment_tx: a.payment_tx as string,\r\n });\r\n\r\n case 'provenonce_heartbeat':\r\n return handleHeartbeat({ payment_tx: a.payment_tx as string });\r\n\r\n case 'provenonce_get_passport':\r\n return handleGetPassport({ payment_tx: a.payment_tx as string | undefined });\r\n\r\n case 'provenonce_beats_proof':\r\n return handleBeatsProof({ count: a.count as number });\r\n\r\n case 'provenonce_verify_agent':\r\n return handleVerifyAgent({ hash: a.hash as string });\r\n\r\n case 'provenonce_spawn':\r\n return handleSpawn({ child_name: a.child_name as string });\r\n\r\n case 'provenonce_get_lineage':\r\n return handleGetLineage({ hash: a.hash as string | undefined });\r\n\r\n default:\r\n return {\r\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\r\n isError: true,\r\n };\r\n }\r\n});\r\n\r\n// Start stdio transport\r\nasync function main() {\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n}\r\n\r\nmain().catch((err) => {\r\n process.stderr.write(`Fatal: ${(err as Error).message}\\n`);\r\n process.exit(1);\r\n});\r\n","import { createHash } from 'crypto';\r\nimport { loadCredentials, saveCredentials } from './credentials.js';\r\nimport * as api from './client.js';\r\n\r\nfunction requireCredentials() {\r\n const creds = loadCredentials();\r\n if (!creds) {\r\n throw new Error(\r\n 'Not registered. Call provenonce_register first.',\r\n );\r\n }\r\n return creds;\r\n}\r\n\r\nfunction ok(data: unknown): { content: [{ type: 'text'; text: string }] } {\r\n return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };\r\n}\r\n\r\nfunction err(message: string): { content: [{ type: 'text'; text: string }]; isError: true } {\r\n return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };\r\n}\r\n\r\n// ── provenonce_register ───────────────────────────────────────────────────────\r\n\r\nexport async function handleRegister(args: { name?: string; skill_ref?: string }) {\r\n // Return existing identity if already registered\r\n const existing = loadCredentials();\r\n if (existing) {\r\n const { data, error } = await api.getStatus(existing.api_key);\r\n if (data) {\r\n return ok({\r\n registered: false,\r\n message: 'Already registered — returning existing identity.',\r\n hash: existing.agent_hash,\r\n sigil: data.sigil,\r\n identity_class: data.identity_class,\r\n _hint: data._hint,\r\n });\r\n }\r\n if (error) {\r\n // Credentials stale or invalid — fall through to re-register\r\n }\r\n }\r\n\r\n const { data, error } = await api.registerAgent({\r\n name: args.name,\r\n skillRef: args.skill_ref,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Registration failed');\r\n\r\n saveCredentials({ api_key: data.api_key, agent_hash: data.hash });\r\n\r\n return ok({\r\n registered: true,\r\n hash: data.hash,\r\n api_key: data.api_key,\r\n depth: data.depth,\r\n message: 'Agent registered. Credentials saved. Call provenonce_status to see your full state.',\r\n _warning: 'Save your api_key securely. It will not be shown again after this session.',\r\n });\r\n}\r\n\r\n// ── provenonce_status ─────────────────────────────────────────────────────────\r\n\r\nexport async function handleStatus() {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getStatus(creds.api_key);\r\n if (error || !data) return err(error ?? 'Failed to get status');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_purchase_sigil ─────────────────────────────────────────────────\r\n\r\nexport async function handlePurchaseSigil(args: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n payment_tx: string;\r\n}) {\r\n const creds = requireCredentials();\r\n const skillRef = process.env.PROVENONCE_SKILL_REF;\r\n\r\n const { data, error } = await api.purchaseSigil(creds.api_key, {\r\n name: args.name,\r\n principal: args.principal,\r\n identity_class: args.identity_class,\r\n payment_tx: args.payment_tx,\r\n skillRef,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'SIGIL purchase failed');\r\n\r\n return ok({\r\n ...data,\r\n heartbeat_unlocked: true,\r\n message: `SIGIL issued: ${data.sigil}. You can now call provenonce_heartbeat and provenonce_get_passport.`,\r\n });\r\n}\r\n\r\n// ── provenonce_heartbeat ──────────────────────────────────────────────────────\r\n\r\nexport async function handleHeartbeat(args: { payment_tx: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.heartbeat(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Heartbeat failed');\r\n\r\n if (!data.ok && data.sigil_required) {\r\n return err('SIGIL required. Call provenonce_purchase_sigil first.');\r\n }\r\n\r\n return ok({\r\n ok: data.ok,\r\n message: data.ok ? 'Heartbeat recorded. Agent liveness confirmed.' : 'Heartbeat failed.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_passport ───────────────────────────────────────────────────\r\n\r\nexport async function handleGetPassport(args: { payment_tx?: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getPassport(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Passport retrieval failed');\r\n\r\n return ok({\r\n passport: data.lineage_proof,\r\n message:\r\n 'Passport issued. Share this signed document with any third party to prove your identity offline.',\r\n _verify:\r\n 'Verify at: GET https://provenonce.io/.well-known/provenonce-authority.json for the authority public key.',\r\n });\r\n}\r\n\r\n// ── provenonce_beats_proof ────────────────────────────────────────────────────\r\n\r\nexport async function handleBeatsProof(args: { count: number }) {\r\n const count = Math.max(10, Math.min(1000, args.count));\r\n const creds = loadCredentials();\r\n const seed = creds?.agent_hash ?? `provenonce:beats:${Date.now()}`;\r\n\r\n const start = Date.now();\r\n let hash = createHash('sha256').update(seed).digest('hex');\r\n const fromHash = `0x${hash}`;\r\n\r\n for (let i = 1; i < count; i++) {\r\n hash = createHash('sha256').update(hash).digest('hex');\r\n }\r\n\r\n const toHash = `0x${hash}`;\r\n const duration = Date.now() - start;\r\n\r\n return ok({\r\n from_hash: fromHash,\r\n to_hash: toHash,\r\n beats_computed: count,\r\n duration_ms: duration,\r\n message: `Computed ${count} beats in ${duration}ms. This is cryptographic proof of computational work.`,\r\n });\r\n}\r\n\r\n// ── provenonce_verify_agent ───────────────────────────────────────────────────\r\n\r\nexport async function handleVerifyAgent(args: { hash: string }) {\r\n const { data, error } = await api.verifyAgent(args.hash);\r\n if (error || !data) return err(error ?? 'Verification failed');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_spawn ──────────────────────────────────────────────────────────\r\n\r\nexport async function handleSpawn(args: { child_name: string }) {\r\n const creds = requireCredentials();\r\n\r\n const { data, error } = await api.spawnChild(creds.api_key, {\r\n childName: args.child_name,\r\n parentHash: creds.agent_hash,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Spawn failed');\r\n\r\n return ok({\r\n ...data,\r\n message: `Child agent spawned: ${data.child_hash}. Save the child_api_key — it will not be shown again.`,\r\n _warning: 'The child agent has its own identity. Configure it with PROVENONCE_API_KEY + PROVENONCE_AGENT_HASH.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_lineage ────────────────────────────────────────────────────\r\n\r\nexport async function handleGetLineage(args: { hash?: string }) {\r\n const creds = loadCredentials();\r\n const targetHash = args.hash ?? creds?.agent_hash;\r\n\r\n if (!targetHash) {\r\n return err('No hash provided and agent is not registered. Call provenonce_register first or provide a hash.');\r\n }\r\n\r\n const { data, error } = await api.getLineage(targetHash);\r\n if (error || !data) return err(error ?? 'Lineage retrieval failed');\r\n return ok(data);\r\n}\r\n","import { readFileSync, writeFileSync, mkdirSync, chmodSync, existsSync } from 'fs';\r\nimport { join } from 'path';\r\nimport { homedir } from 'os';\r\nimport type { StoredCredentials } from './types.js';\r\n\r\nfunction getConfigDir(): string {\r\n return join(homedir(), '.provenonce');\r\n}\r\n\r\nfunction getConfigPath(): string {\r\n return join(getConfigDir(), 'config.json');\r\n}\r\n\r\n/** Load credentials — env vars take priority over config file */\r\nexport function loadCredentials(): StoredCredentials | null {\r\n const apiKey = process.env.PROVENONCE_API_KEY;\r\n const agentHash = process.env.PROVENONCE_AGENT_HASH;\r\n\r\n if (apiKey && agentHash) {\r\n return { api_key: apiKey, agent_hash: agentHash };\r\n }\r\n\r\n const configPath = getConfigPath();\r\n if (!existsSync(configPath)) return null;\r\n\r\n try {\r\n const raw = readFileSync(configPath, 'utf-8');\r\n const parsed = JSON.parse(raw) as Partial<StoredCredentials>;\r\n if (parsed.api_key && parsed.agent_hash) {\r\n return { api_key: parsed.api_key, agent_hash: parsed.agent_hash };\r\n }\r\n } catch {\r\n // Corrupt config — treat as missing\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/** Persist credentials to ~/.provenonce/config.json (chmod 600) */\r\nexport function saveCredentials(creds: StoredCredentials): void {\r\n const dir = getConfigDir();\r\n if (!existsSync(dir)) {\r\n mkdirSync(dir, { recursive: true });\r\n }\r\n\r\n const configPath = getConfigPath();\r\n const data: StoredCredentials = {\r\n api_key: creds.api_key,\r\n agent_hash: creds.agent_hash,\r\n };\r\n\r\n writeFileSync(configPath, JSON.stringify(data, null, 2), 'utf-8');\r\n\r\n // chmod 600 — owner read/write only (Unix only; no-op on Windows)\r\n try {\r\n chmodSync(configPath, 0o600);\r\n } catch {\r\n // Windows — chmod not supported; recommend env var instead\r\n }\r\n}\r\n\r\n/** Clear stored credentials */\r\nexport function clearCredentials(): void {\r\n const configPath = getConfigPath();\r\n if (existsSync(configPath)) {\r\n writeFileSync(configPath, '{}', 'utf-8');\r\n }\r\n}\r\n","import type {\r\n RegisterResult,\r\n AgentStatus,\r\n HeartbeatResult,\r\n PassportResult,\r\n SigilResult,\r\n VerifyAgentResult,\r\n LineageResult,\r\n SpawnResult,\r\n} from './types.js';\r\n\r\nconst REGISTRY_URL = process.env.PROVENONCE_REGISTRY_URL || 'https://provenonce.io';\r\n\r\nasync function apiFetch<T>(\r\n path: string,\r\n opts: { method?: string; body?: unknown; apiKey?: string; isPublic?: boolean } = {},\r\n): Promise<{ data: T | null; error: string | null }> {\r\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\r\n if (opts.apiKey) headers['Authorization'] = `Bearer ${opts.apiKey}`;\r\n\r\n try {\r\n const res = await fetch(`${REGISTRY_URL}${path}`, {\r\n method: opts.method ?? 'GET',\r\n headers,\r\n body: opts.body ? JSON.stringify(opts.body) : undefined,\r\n });\r\n\r\n const json = await res.json() as Record<string, unknown>;\r\n\r\n if (!res.ok) {\r\n const msg = (json.error as string) ?? `HTTP ${res.status}`;\r\n return { data: null, error: msg };\r\n }\r\n\r\n return { data: json as T, error: null };\r\n } catch (err) {\r\n return { data: null, error: (err as Error).message };\r\n }\r\n}\r\n\r\n/** Register a new agent (no-wallet path) */\r\nexport async function registerAgent(opts: {\r\n name?: string;\r\n skillRef?: string;\r\n}): Promise<{ data: RegisterResult | null; error: string | null }> {\r\n return apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n body: {\r\n name: opts.name,\r\n wallet: 'none',\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Get full agent status */\r\nexport async function getStatus(apiKey: string): Promise<{ data: AgentStatus | null; error: string | null }> {\r\n return apiFetch<AgentStatus>('/api/v1/skill/bootstrap', {\r\n method: 'POST',\r\n apiKey,\r\n body: {},\r\n });\r\n}\r\n\r\n/** Submit heartbeat */\r\nexport async function heartbeat(apiKey: string, paymentTx?: string): Promise<{ data: HeartbeatResult | null; error: string | null }> {\r\n return apiFetch<HeartbeatResult>('/api/v1/agent/heartbeat', {\r\n method: 'POST',\r\n apiKey,\r\n body: { payment_tx: paymentTx },\r\n });\r\n}\r\n\r\n/** Reissue passport / lineage proof */\r\nexport async function getPassport(apiKey: string, paymentTx?: string): Promise<{ data: { lineage_proof: PassportResult } | null; error: string | null }> {\r\n return apiFetch<{ lineage_proof: PassportResult }>('/api/v1/agent/reissue-proof', {\r\n method: 'POST',\r\n apiKey,\r\n body: paymentTx ? { payment_tx: paymentTx } : {},\r\n });\r\n}\r\n\r\n/** Purchase a SIGIL */\r\nexport async function purchaseSigil(apiKey: string, opts: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n payment_tx: string;\r\n skillRef?: string;\r\n}): Promise<{ data: SigilResult | null; error: string | null }> {\r\n return apiFetch<SigilResult>('/api/v1/sigil', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.name,\r\n principal: opts.principal,\r\n identity_class: opts.identity_class,\r\n payment_tx: opts.payment_tx,\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Verify another agent's identity (public) */\r\nexport async function verifyAgent(hash: string): Promise<{ data: VerifyAgentResult | null; error: string | null }> {\r\n return apiFetch<VerifyAgentResult>(`/api/v1/verify/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Get agent lineage chain (public) */\r\nexport async function getLineage(hash: string): Promise<{ data: LineageResult | null; error: string | null }> {\r\n return apiFetch<LineageResult>(`/api/v1/agent/lineage/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Spawn a child agent — handles full 3-step flow internally */\r\nexport async function spawnChild(apiKey: string, opts: {\r\n childName: string;\r\n parentHash: string;\r\n}): Promise<{ data: SpawnResult | null; error: string | null }> {\r\n // Step 1: Get spawn authorization\r\n const step1 = await apiFetch<{\r\n spawn_authorization: string;\r\n child_name?: string;\r\n }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_name: opts.childName },\r\n });\r\n\r\n if (step1.error || !step1.data?.spawn_authorization) {\r\n return { data: null, error: step1.error ?? 'Spawn step 1 failed: no authorization returned' };\r\n }\r\n\r\n const spawnAuth = step1.data.spawn_authorization;\r\n\r\n // Step 2: Register the child with the spawn_authorization\r\n const reg = await apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.childName,\r\n wallet: 'none',\r\n spawn_authorization: spawnAuth,\r\n },\r\n });\r\n\r\n if (reg.error || !reg.data?.hash) {\r\n return { data: null, error: reg.error ?? 'Spawn step 2 (child registration) failed' };\r\n }\r\n\r\n const childHash = reg.data.hash;\r\n const childApiKey = reg.data.api_key;\r\n\r\n // Step 3: Finalize the spawn\r\n const step3 = await apiFetch<{ ok: boolean }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_hash: childHash },\r\n });\r\n\r\n if (step3.error) {\r\n return { data: null, error: step3.error };\r\n }\r\n\r\n return {\r\n data: {\r\n child_hash: childHash,\r\n child_api_key: childApiKey,\r\n child_depth: reg.data.depth,\r\n parent_hash: opts.parentHash,\r\n },\r\n error: null,\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,kBAAkB;;;ACA3B,SAAS,cAAc,eAAe,WAAW,WAAW,kBAAkB;AAC9E,SAAS,YAAY;AACrB,SAAS,eAAe;AAGxB,SAAS,eAAuB;AAC9B,SAAO,KAAK,QAAQ,GAAG,aAAa;AACtC;AAEA,SAAS,gBAAwB;AAC/B,SAAO,KAAK,aAAa,GAAG,aAAa;AAC3C;AAGO,SAAS,kBAA4C;AAC1D,QAAM,SAAS,QAAQ,IAAI;AAC3B,QAAM,YAAY,QAAQ,IAAI;AAE9B,MAAI,UAAU,WAAW;AACvB,WAAO,EAAE,SAAS,QAAQ,YAAY,UAAU;AAAA,EAClD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO;AAEpC,MAAI;AACF,UAAM,MAAM,aAAa,YAAY,OAAO;AAC5C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EAAE,MAAM,QAAQ,MAAM,iBAAiB,IAAI,GAAG,CAAC;AAAA,QACzD,SAAS;AAAA,MACX;AAAA,EACJ;AACF,CAAC;AAGD,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,CAACC,SAAQ;AACpB,UAAQ,OAAO,MAAM,UAAWA,KAAc,OAAO;AAAA,CAAI;AACzD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["err","data","error","err"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/handlers.ts","../src/credentials.ts","../src/client.ts"],"sourcesContent":["import { Server } from '@modelcontextprotocol/sdk/server/index.js';\r\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\r\nimport {\r\n CallToolRequestSchema,\r\n ListToolsRequestSchema,\r\n} from '@modelcontextprotocol/sdk/types.js';\r\n\r\nimport { PROVENONCE_TOOLS } from './tools.js';\r\nimport {\r\n handleRegister,\r\n handleStatus,\r\n handlePurchaseSigil,\r\n handleHeartbeat,\r\n handleGetPassport,\r\n handleBeatsProof,\r\n handleVerifyAgent,\r\n handleSpawn,\r\n handleGetLineage,\r\n} from './handlers.js';\r\n\r\nconst server = new Server(\r\n { name: 'provenonce', version: '1.0.0' },\r\n { capabilities: { tools: {} } },\r\n);\r\n\r\n// List available tools\r\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({\r\n tools: PROVENONCE_TOOLS.map((t) => ({\r\n name: t.name,\r\n description: t.description,\r\n inputSchema: t.inputSchema,\r\n })),\r\n}));\r\n\r\n// Handle tool calls\r\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\r\n const { name, arguments: args = {} } = request.params;\r\n const a = args as Record<string, unknown>;\r\n\r\n switch (name) {\r\n case 'provenonce_register':\r\n return handleRegister({\r\n name: a.name as string | undefined,\r\n skill_ref: a.skill_ref as string | undefined,\r\n });\r\n\r\n case 'provenonce_status':\r\n return handleStatus();\r\n\r\n case 'provenonce_purchase_sigil':\r\n return handlePurchaseSigil({\r\n name: a.name as string,\r\n principal: a.principal as string,\r\n identity_class: a.identity_class as string,\r\n tier: a.tier as string,\r\n payment_tx: a.payment_tx as string,\r\n });\r\n\r\n case 'provenonce_heartbeat':\r\n return handleHeartbeat({ payment_tx: a.payment_tx as string });\r\n\r\n case 'provenonce_get_passport':\r\n return handleGetPassport({ payment_tx: a.payment_tx as string | undefined });\r\n\r\n case 'provenonce_beats_proof':\r\n return handleBeatsProof({ count: a.count as number });\r\n\r\n case 'provenonce_verify_agent':\r\n return handleVerifyAgent({ hash: a.hash as string });\r\n\r\n case 'provenonce_spawn':\r\n return handleSpawn({ child_name: a.child_name as string });\r\n\r\n case 'provenonce_get_lineage':\r\n return handleGetLineage({ hash: a.hash as string | undefined });\r\n\r\n default:\r\n return {\r\n content: [{ type: 'text', text: `Unknown tool: ${name}` }],\r\n isError: true,\r\n };\r\n }\r\n});\r\n\r\n// Start stdio transport\r\nasync function main() {\r\n const transport = new StdioServerTransport();\r\n await server.connect(transport);\r\n}\r\n\r\nmain().catch((err) => {\r\n process.stderr.write(`Fatal: ${(err as Error).message}\\n`);\r\n process.exit(1);\r\n});\r\n","import { createHash } from 'crypto';\r\nimport { loadCredentials, saveCredentials } from './credentials.js';\r\nimport * as api from './client.js';\r\n\r\nfunction requireCredentials() {\r\n const creds = loadCredentials();\r\n if (!creds) {\r\n throw new Error(\r\n 'Not registered. Call provenonce_register first.',\r\n );\r\n }\r\n return creds;\r\n}\r\n\r\nfunction ok(data: unknown): { content: [{ type: 'text'; text: string }] } {\r\n return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };\r\n}\r\n\r\nfunction err(message: string): { content: [{ type: 'text'; text: string }]; isError: true } {\r\n return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };\r\n}\r\n\r\n// ── provenonce_register ───────────────────────────────────────────────────────\r\n\r\nexport async function handleRegister(args: { name?: string; skill_ref?: string }) {\r\n // Return existing identity if already registered\r\n const existing = loadCredentials();\r\n if (existing) {\r\n const { data, error } = await api.getStatus(existing.api_key);\r\n if (data) {\r\n return ok({\r\n registered: false,\r\n message: 'Already registered — returning existing identity.',\r\n hash: existing.agent_hash,\r\n sigil: data.sigil,\r\n identity_class: data.identity_class,\r\n _hint: data._hint,\r\n });\r\n }\r\n if (error) {\r\n // Credentials stale or invalid — fall through to re-register\r\n }\r\n }\r\n\r\n const { data, error } = await api.registerAgent({\r\n name: args.name,\r\n skillRef: args.skill_ref,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Registration failed');\r\n\r\n saveCredentials({ api_key: data.api_key, agent_hash: data.hash });\r\n\r\n return ok({\r\n registered: true,\r\n hash: data.hash,\r\n api_key: data.api_key,\r\n depth: data.depth,\r\n message: 'Agent registered. Credentials saved. Call provenonce_status to see your full state.',\r\n _warning: 'Save your api_key securely. It will not be shown again after this session.',\r\n });\r\n}\r\n\r\n// ── provenonce_status ─────────────────────────────────────────────────────────\r\n\r\nexport async function handleStatus() {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getStatus(creds.api_key);\r\n if (error || !data) return err(error ?? 'Failed to get status');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_purchase_sigil ─────────────────────────────────────────────────\r\n\r\nexport async function handlePurchaseSigil(args: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n tier: string;\r\n payment_tx: string;\r\n}) {\r\n const creds = requireCredentials();\r\n const skillRef = process.env.PROVENONCE_SKILL_REF;\r\n\r\n const { data, error } = await api.purchaseSigil(creds.api_key, {\r\n name: args.name,\r\n principal: args.principal,\r\n identity_class: args.identity_class,\r\n tier: args.tier,\r\n payment_tx: args.payment_tx,\r\n skillRef,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'SIGIL purchase failed');\r\n\r\n return ok({\r\n ...data,\r\n heartbeat_unlocked: true,\r\n message: `SIGIL issued: ${data.sigil}. You can now call provenonce_heartbeat and provenonce_get_passport.`,\r\n });\r\n}\r\n\r\n// ── provenonce_heartbeat ──────────────────────────────────────────────────────\r\n\r\nexport async function handleHeartbeat(args: { payment_tx: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.heartbeat(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Heartbeat failed');\r\n\r\n if (!data.ok && data.sigil_required) {\r\n return err('SIGIL required. Call provenonce_purchase_sigil first.');\r\n }\r\n\r\n return ok({\r\n ok: data.ok,\r\n message: data.ok ? 'Heartbeat recorded. Agent liveness confirmed.' : 'Heartbeat failed.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_passport ───────────────────────────────────────────────────\r\n\r\nexport async function handleGetPassport(args: { payment_tx?: string }) {\r\n const creds = requireCredentials();\r\n const { data, error } = await api.getPassport(creds.api_key, args.payment_tx);\r\n if (error || !data) return err(error ?? 'Passport retrieval failed');\r\n\r\n return ok({\r\n passport: data.lineage_proof,\r\n message:\r\n 'Passport issued. Share this signed document with any third party to prove your identity offline.',\r\n _verify:\r\n 'Verify at: GET https://provenonce.io/.well-known/provenonce-authority.json for the authority public key.',\r\n });\r\n}\r\n\r\n// ── provenonce_beats_proof ────────────────────────────────────────────────────\r\n\r\nexport async function handleBeatsProof(args: { count: number }) {\r\n const count = Math.max(10, Math.min(1000, args.count));\r\n const creds = loadCredentials();\r\n const seed = creds?.agent_hash ?? `provenonce:beats:${Date.now()}`;\r\n\r\n const start = Date.now();\r\n let hash = createHash('sha256').update(seed).digest('hex');\r\n const fromHash = `0x${hash}`;\r\n\r\n for (let i = 1; i < count; i++) {\r\n hash = createHash('sha256').update(hash).digest('hex');\r\n }\r\n\r\n const toHash = `0x${hash}`;\r\n const duration = Date.now() - start;\r\n\r\n return ok({\r\n from_hash: fromHash,\r\n to_hash: toHash,\r\n beats_computed: count,\r\n duration_ms: duration,\r\n message: `Computed ${count} beats in ${duration}ms. This is cryptographic proof of computational work.`,\r\n });\r\n}\r\n\r\n// ── provenonce_verify_agent ───────────────────────────────────────────────────\r\n\r\nexport async function handleVerifyAgent(args: { hash: string }) {\r\n const { data, error } = await api.verifyAgent(args.hash);\r\n if (error || !data) return err(error ?? 'Verification failed');\r\n return ok(data);\r\n}\r\n\r\n// ── provenonce_spawn ──────────────────────────────────────────────────────────\r\n\r\nexport async function handleSpawn(args: { child_name: string }) {\r\n const creds = requireCredentials();\r\n\r\n const { data, error } = await api.spawnChild(creds.api_key, {\r\n childName: args.child_name,\r\n parentHash: creds.agent_hash,\r\n });\r\n\r\n if (error || !data) return err(error ?? 'Spawn failed');\r\n\r\n return ok({\r\n ...data,\r\n message: `Child agent spawned: ${data.child_hash}. Save the child_api_key — it will not be shown again.`,\r\n _warning: 'The child agent has its own identity. Configure it with PROVENONCE_API_KEY + PROVENONCE_AGENT_HASH.',\r\n });\r\n}\r\n\r\n// ── provenonce_get_lineage ────────────────────────────────────────────────────\r\n\r\nexport async function handleGetLineage(args: { hash?: string }) {\r\n const creds = loadCredentials();\r\n const targetHash = args.hash ?? creds?.agent_hash;\r\n\r\n if (!targetHash) {\r\n return err('No hash provided and agent is not registered. Call provenonce_register first or provide a hash.');\r\n }\r\n\r\n const { data, error } = await api.getLineage(targetHash);\r\n if (error || !data) return err(error ?? 'Lineage retrieval failed');\r\n return ok(data);\r\n}\r\n","import { readFileSync, writeFileSync, mkdirSync, chmodSync, existsSync } from 'fs';\r\nimport { join } from 'path';\r\nimport { homedir } from 'os';\r\nimport type { StoredCredentials } from './types.js';\r\n\r\nfunction getConfigDir(): string {\r\n return join(homedir(), '.provenonce');\r\n}\r\n\r\nfunction getConfigPath(): string {\r\n return join(getConfigDir(), 'config.json');\r\n}\r\n\r\n/** Load credentials — env vars take priority over config file */\r\nexport function loadCredentials(): StoredCredentials | null {\r\n const apiKey = process.env.PROVENONCE_API_KEY;\r\n const agentHash = process.env.PROVENONCE_AGENT_HASH;\r\n\r\n if (apiKey && agentHash) {\r\n return { api_key: apiKey, agent_hash: agentHash };\r\n }\r\n\r\n const configPath = getConfigPath();\r\n if (!existsSync(configPath)) return null;\r\n\r\n try {\r\n const raw = readFileSync(configPath, 'utf-8');\r\n const parsed = JSON.parse(raw) as Partial<StoredCredentials>;\r\n if (parsed.api_key && parsed.agent_hash) {\r\n return { api_key: parsed.api_key, agent_hash: parsed.agent_hash };\r\n }\r\n } catch {\r\n // Corrupt config — treat as missing\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/** Persist credentials to ~/.provenonce/config.json (chmod 600) */\r\nexport function saveCredentials(creds: StoredCredentials): void {\r\n const dir = getConfigDir();\r\n if (!existsSync(dir)) {\r\n mkdirSync(dir, { recursive: true });\r\n }\r\n\r\n const configPath = getConfigPath();\r\n const data: StoredCredentials = {\r\n api_key: creds.api_key,\r\n agent_hash: creds.agent_hash,\r\n };\r\n\r\n writeFileSync(configPath, JSON.stringify(data, null, 2), 'utf-8');\r\n\r\n // chmod 600 — owner read/write only (Unix only; no-op on Windows)\r\n try {\r\n chmodSync(configPath, 0o600);\r\n } catch {\r\n // Windows — chmod not supported; recommend env var instead\r\n }\r\n}\r\n\r\n/** Clear stored credentials */\r\nexport function clearCredentials(): void {\r\n const configPath = getConfigPath();\r\n if (existsSync(configPath)) {\r\n writeFileSync(configPath, '{}', 'utf-8');\r\n }\r\n}\r\n","import type {\r\n RegisterResult,\r\n AgentStatus,\r\n HeartbeatResult,\r\n PassportResult,\r\n SigilResult,\r\n VerifyAgentResult,\r\n LineageResult,\r\n SpawnResult,\r\n} from './types.js';\r\n\r\nconst REGISTRY_URL = process.env.PROVENONCE_REGISTRY_URL || 'https://provenonce.io';\r\n\r\nasync function apiFetch<T>(\r\n path: string,\r\n opts: { method?: string; body?: unknown; apiKey?: string; isPublic?: boolean } = {},\r\n): Promise<{ data: T | null; error: string | null }> {\r\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\r\n if (opts.apiKey) headers['Authorization'] = `Bearer ${opts.apiKey}`;\r\n\r\n try {\r\n const res = await fetch(`${REGISTRY_URL}${path}`, {\r\n method: opts.method ?? 'GET',\r\n headers,\r\n body: opts.body ? JSON.stringify(opts.body) : undefined,\r\n });\r\n\r\n const json = await res.json() as Record<string, unknown>;\r\n\r\n if (!res.ok) {\r\n const msg = (json.error as string) ?? `HTTP ${res.status}`;\r\n return { data: null, error: msg };\r\n }\r\n\r\n return { data: json as T, error: null };\r\n } catch (err) {\r\n return { data: null, error: (err as Error).message };\r\n }\r\n}\r\n\r\n/** Register a new agent (no-wallet path) */\r\nexport async function registerAgent(opts: {\r\n name?: string;\r\n skillRef?: string;\r\n}): Promise<{ data: RegisterResult | null; error: string | null }> {\r\n return apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n body: {\r\n name: opts.name,\r\n wallet: 'none',\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Get full agent status */\r\nexport async function getStatus(apiKey: string): Promise<{ data: AgentStatus | null; error: string | null }> {\r\n return apiFetch<AgentStatus>('/api/v1/skill/bootstrap', {\r\n method: 'POST',\r\n apiKey,\r\n body: {},\r\n });\r\n}\r\n\r\n/** Submit heartbeat */\r\nexport async function heartbeat(apiKey: string, paymentTx?: string): Promise<{ data: HeartbeatResult | null; error: string | null }> {\r\n return apiFetch<HeartbeatResult>('/api/v1/agent/heartbeat', {\r\n method: 'POST',\r\n apiKey,\r\n body: { payment_tx: paymentTx },\r\n });\r\n}\r\n\r\n/** Reissue passport / lineage proof */\r\nexport async function getPassport(apiKey: string, paymentTx?: string): Promise<{ data: { lineage_proof: PassportResult } | null; error: string | null }> {\r\n return apiFetch<{ lineage_proof: PassportResult }>('/api/v1/agent/reissue-proof', {\r\n method: 'POST',\r\n apiKey,\r\n body: paymentTx ? { payment_tx: paymentTx } : {},\r\n });\r\n}\r\n\r\n/** Purchase a SIGIL */\r\nexport async function purchaseSigil(apiKey: string, opts: {\r\n name: string;\r\n principal: string;\r\n identity_class: string;\r\n tier: string;\r\n payment_tx: string;\r\n skillRef?: string;\r\n}): Promise<{ data: SigilResult | null; error: string | null }> {\r\n return apiFetch<SigilResult>('/api/v1/sigil', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.name,\r\n principal: opts.principal,\r\n identity_class: opts.identity_class,\r\n tier: opts.tier,\r\n payment_tx: opts.payment_tx,\r\n ...(opts.skillRef ? { ref: opts.skillRef } : {}),\r\n },\r\n });\r\n}\r\n\r\n/** Verify another agent's identity (public) */\r\nexport async function verifyAgent(hash: string): Promise<{ data: VerifyAgentResult | null; error: string | null }> {\r\n return apiFetch<VerifyAgentResult>(`/api/v1/verify/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Get agent lineage chain (public) */\r\nexport async function getLineage(hash: string): Promise<{ data: LineageResult | null; error: string | null }> {\r\n return apiFetch<LineageResult>(`/api/v1/agent/lineage/${encodeURIComponent(hash)}`);\r\n}\r\n\r\n/** Spawn a child agent — handles full 3-step flow internally */\r\nexport async function spawnChild(apiKey: string, opts: {\r\n childName: string;\r\n parentHash: string;\r\n}): Promise<{ data: SpawnResult | null; error: string | null }> {\r\n // Step 1: Get spawn authorization\r\n const step1 = await apiFetch<{\r\n spawn_authorization: string;\r\n child_name?: string;\r\n }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_name: opts.childName },\r\n });\r\n\r\n if (step1.error || !step1.data?.spawn_authorization) {\r\n return { data: null, error: step1.error ?? 'Spawn step 1 failed: no authorization returned' };\r\n }\r\n\r\n const spawnAuth = step1.data.spawn_authorization;\r\n\r\n // Step 2: Register the child with the spawn_authorization\r\n const reg = await apiFetch<RegisterResult>('/api/v1/register', {\r\n method: 'POST',\r\n apiKey,\r\n body: {\r\n name: opts.childName,\r\n wallet: 'none',\r\n spawn_authorization: spawnAuth,\r\n },\r\n });\r\n\r\n if (reg.error || !reg.data?.hash) {\r\n return { data: null, error: reg.error ?? 'Spawn step 2 (child registration) failed' };\r\n }\r\n\r\n const childHash = reg.data.hash;\r\n const childApiKey = reg.data.api_key;\r\n\r\n // Step 3: Finalize the spawn\r\n const step3 = await apiFetch<{ ok: boolean }>('/api/v1/agent/spawn', {\r\n method: 'POST',\r\n apiKey,\r\n body: { child_hash: childHash },\r\n });\r\n\r\n if (step3.error) {\r\n return { data: null, error: step3.error };\r\n }\r\n\r\n return {\r\n data: {\r\n child_hash: childHash,\r\n child_api_key: childApiKey,\r\n child_depth: reg.data.depth,\r\n parent_hash: opts.parentHash,\r\n },\r\n error: null,\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,kBAAkB;;;ACA3B,SAAS,cAAc,eAAe,WAAW,WAAW,kBAAkB;AAC9E,SAAS,YAAY;AACrB,SAAS,eAAe;AAGxB,SAAS,eAAuB;AAC9B,SAAO,KAAK,QAAQ,GAAG,aAAa;AACtC;AAEA,SAAS,gBAAwB;AAC/B,SAAO,KAAK,aAAa,GAAG,aAAa;AAC3C;AAGO,SAAS,kBAA4C;AAC1D,QAAM,SAAS,QAAQ,IAAI;AAC3B,QAAM,YAAY,QAAQ,IAAI;AAE9B,MAAI,UAAU,WAAW;AACvB,WAAO,EAAE,SAAS,QAAQ,YAAY,UAAU;AAAA,EAClD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO;AAEpC,MAAI;AACF,UAAM,MAAM,aAAa,YAAY,OAAO;AAC5C,UAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,QAAI,OAAO,WAAW,OAAO,YAAY;AACvC,aAAO,EAAE,SAAS,OAAO,SAAS,YAAY,OAAO,WAAW;AAAA,IAClE;AAAA,EACF,QAAQ;AAAA,EAER;AAEA,SAAO;AACT;AAGO,SAAS,gBAAgB,OAAgC;AAC9D,QAAM,MAAM,aAAa;AACzB,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,cAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AAAA,EACpC;A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AAWA,KAAc,OAAO;AAAA,CAAI;AACzD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["err","data","error","err"]}
|
package/dist/tools.d.ts
CHANGED
|
@@ -40,15 +40,20 @@ declare const PROVENONCE_TOOLS: readonly [{
|
|
|
40
40
|
};
|
|
41
41
|
readonly identity_class: {
|
|
42
42
|
readonly type: "string";
|
|
43
|
-
readonly enum: readonly ["
|
|
44
|
-
readonly description: "
|
|
43
|
+
readonly enum: readonly ["narrow_task", "autonomous", "orchestrator"];
|
|
44
|
+
readonly description: "Agent identity class (pricing axis): narrow_task=single-purpose, autonomous=independent decision-maker, orchestrator=coordinates other agents";
|
|
45
|
+
};
|
|
46
|
+
readonly tier: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly enum: readonly ["sov", "org", "ind", "eph", "sbx"];
|
|
49
|
+
readonly description: "Trust governance tier: sov=sovereign/root, org=organisation, ind=individual, eph=ephemeral, sbx=sandbox";
|
|
45
50
|
};
|
|
46
51
|
readonly payment_tx: {
|
|
47
52
|
readonly type: "string";
|
|
48
53
|
readonly description: "Solana transaction signature for the SIGIL fee payment";
|
|
49
54
|
};
|
|
50
55
|
};
|
|
51
|
-
readonly required: readonly ["name", "principal", "identity_class", "payment_tx"];
|
|
56
|
+
readonly required: readonly ["name", "principal", "identity_class", "tier", "payment_tx"];
|
|
52
57
|
};
|
|
53
58
|
}, {
|
|
54
59
|
readonly name: "provenonce_heartbeat";
|
package/dist/tools.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@provenonce/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Provenonce Skill — MCP server giving any AI agent cryptographic identity, SIGIL, heartbeat, passport, and beats proofs.",
|
|
5
5
|
"keywords": ["provenonce", "mcp", "ai-agent", "identity", "provenance", "sigil"],
|
|
6
6
|
"homepage": "https://provenonce.io",
|
|
@@ -40,5 +40,6 @@
|
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=18"
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
|
+
"mcpName": "io.github.jarekpiot/provenonce"
|
|
44
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tools.ts"],"sourcesContent":["/** Provenonce Skill — 9 MCP tool definitions (JSON Schema) */\r\nexport const PROVENONCE_TOOLS = [\r\n {\r\n name: 'provenonce_register',\r\n description:\r\n 'Register this agent with Provenonce to get a cryptographic identity (hash + API key). ' +\r\n 'Safe to call multiple times — returns existing identity if already registered. ' +\r\n 'No wallet required. Free.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'Human-readable name for this agent (optional, max 64 chars)',\r\n maxLength: 64,\r\n },\r\n skill_ref: {\r\n type: 'string',\r\n description:\r\n '16-character hex ref token of the skill that deployed you — for rev-share attribution (optional)',\r\n pattern: '^[0-9a-f]{16}$',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_status',\r\n description:\r\n 'Get this agent\\'s current Provenonce status: identity, SIGIL, beats balance, and next steps. ' +\r\n 'Requires prior provenonce_register call.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {},\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_purchase_sigil',\r\n description:\r\n 'Purchase a Provenonce SIGIL to unlock full provenance: heartbeat access, signed passport, ' +\r\n 'and a permanent identity record. Requires a Solana payment transaction. ' +\r\n 'SIGIL format: name*principal*tier (e.g. my-agent*acme*ind).',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n name: {\r\n type: 'string',\r\n description: 'SIGIL name segment — identifies this specific agent (e.g. \"my-agent\")',\r\n },\r\n principal: {\r\n type: 'string',\r\n description: 'Principal segment — identifies the operator or organisation (e.g. \"acme\")',\r\n },\r\n identity_class: {\r\n type: 'string',\r\n enum: ['ind', 'org', 'sov', 'eph', 'sbx'],\r\n description:\r\n 'Identity class: ind=individual, org=organisation, sov=sovereign, eph=ephemeral, sbx=sandbox',\r\n },\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the SIGIL fee payment',\r\n },\r\n },\r\n required: ['name', 'principal', 'identity_class', 'payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_heartbeat',\r\n description:\r\n 'Submit a heartbeat to prove this agent is alive. Requires a SIGIL (call provenonce_purchase_sigil first). ' +\r\n 'Requires a Solana payment transaction for the heartbeat fee.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the heartbeat fee payment',\r\n },\r\n },\r\n required: ['payment_tx'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_passport',\r\n description:\r\n 'Get this agent\\'s cryptographically signed Passport — a verifiable identity document ' +\r\n 'any third party can verify offline using the Provenonce authority public key. ' +\r\n 'Requires an active SIGIL and at least one heartbeat.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n payment_tx: {\r\n type: 'string',\r\n description: 'Solana transaction signature for the passport reissue fee (if applicable)',\r\n },\r\n },\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_beats_proof',\r\n description:\r\n 'Compute a local Beats work-proof — cryptographic evidence of computational effort by this agent. ' +\r\n 'Returns a hash chain proof that can be shared as evidence of work. No network call required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n count: {\r\n type: 'integer',\r\n description: 'Number of beats to compute (min 10, max 1000)',\r\n minimum: 10,\r\n maximum: 1000,\r\n },\r\n },\r\n required: ['count'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_verify_agent',\r\n description:\r\n 'Verify another agent\\'s Provenonce identity. Returns their SIGIL, identity class, and registration status. ' +\r\n 'Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description: 'The agent hash to verify (0x + 64 hex chars)',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n required: ['hash'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_spawn',\r\n description:\r\n 'Spawn a child agent under this agent\\'s identity. The child inherits lineage from the parent. ' +\r\n 'Returns the child\\'s hash and API key. Requires sufficient beats balance or a work-proof receipt.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n child_name: {\r\n type: 'string',\r\n description: 'Name for the child agent (max 64 chars)',\r\n maxLength: 64,\r\n },\r\n },\r\n required: ['child_name'],\r\n },\r\n },\r\n\r\n {\r\n name: 'provenonce_get_lineage',\r\n description:\r\n 'Get the full lineage chain for an agent — all events in its provenance history ' +\r\n '(registration, SIGIL issuance, heartbeats, spawns). Public — no authentication required.',\r\n inputSchema: {\r\n type: 'object',\r\n properties: {\r\n hash: {\r\n type: 'string',\r\n description:\r\n 'The agent hash to get lineage for (0x + 64 hex chars). Defaults to this agent if omitted.',\r\n pattern: '^0x[0-9a-fA-F]{64}$',\r\n },\r\n },\r\n },\r\n },\r\n] as const;\r\n\r\nexport type ToolName = (typeof PROVENONCE_TOOLS)[number]['name'];\r\n"],"mappings":";;;AACO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,MAAM;AAAA,UACJ,MAAM;AAAA,UACN,aAAa;AAAA,UACb,WAAW;AAAA,QACb;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aACE;AAAA,UACF,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAEF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,IACf;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IAGF,aAAa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