@agentcred-ai/mcp-server 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 AgentCred Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,288 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ createServer: () => createServer,
25
+ registerResources: () => registerResources,
26
+ registerTools: () => registerTools,
27
+ version: () => version
28
+ });
29
+ module.exports = __toCommonJS(index_exports);
30
+ var import_server = require("@modelcontextprotocol/sdk/server/index.js");
31
+ var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
32
+
33
+ // src/tools.ts
34
+ var import_types = require("@modelcontextprotocol/sdk/types.js");
35
+ var import_sdk = require("@agentcred-ai/sdk");
36
+ var storage = new import_sdk.MemoryKeyStorage();
37
+ function getConfig() {
38
+ return { storage };
39
+ }
40
+ var currentUsername = null;
41
+ function getStorage() {
42
+ return storage;
43
+ }
44
+ function getCurrentUsername() {
45
+ return currentUsername;
46
+ }
47
+ var TOOLS = [
48
+ {
49
+ name: "agentcred_init",
50
+ description: "Initialize an AgentCred identity by authenticating with GitHub and generating a signing keypair.",
51
+ inputSchema: {
52
+ type: "object",
53
+ properties: {
54
+ github_token: {
55
+ type: "string",
56
+ description: "GitHub personal access token for authentication"
57
+ }
58
+ },
59
+ required: ["github_token"]
60
+ }
61
+ },
62
+ {
63
+ name: "agentcred_sign",
64
+ description: "Sign content with the current AgentCred identity, producing a verifiable envelope.",
65
+ inputSchema: {
66
+ type: "object",
67
+ properties: {
68
+ content: {
69
+ type: "string",
70
+ description: "The content to sign"
71
+ },
72
+ agent: {
73
+ type: "string",
74
+ description: 'Optional agent identifier (defaults to "default")'
75
+ }
76
+ },
77
+ required: ["content"]
78
+ }
79
+ },
80
+ {
81
+ name: "agentcred_verify",
82
+ description: "Verify an AgentCred envelope to check its authenticity and integrity.",
83
+ inputSchema: {
84
+ type: "object",
85
+ properties: {
86
+ envelope: {
87
+ type: "string",
88
+ description: "JSON string of the AgentCredEnvelope to verify"
89
+ }
90
+ },
91
+ required: ["envelope"]
92
+ }
93
+ },
94
+ {
95
+ name: "agentcred_whoami",
96
+ description: "Show the current AgentCred identity information.",
97
+ inputSchema: {
98
+ type: "object",
99
+ properties: {}
100
+ }
101
+ }
102
+ ];
103
+ async function handleInit(args) {
104
+ const identity = await (0, import_sdk.createIdentity)(args.github_token, getConfig());
105
+ currentUsername = identity.github.username;
106
+ return {
107
+ content: [{
108
+ type: "text",
109
+ text: `Identity initialized for ${identity.github.username}
110
+ Fingerprint: ${identity.fingerprint}
111
+ Registered at: ${identity.registeredAt}`
112
+ }]
113
+ };
114
+ }
115
+ async function handleSign(args) {
116
+ if (!currentUsername) {
117
+ return {
118
+ content: [{ type: "text", text: "Error: No identity configured. Run agentcred_init first." }],
119
+ isError: true
120
+ };
121
+ }
122
+ const loaded = await (0, import_sdk.loadIdentity)(currentUsername, getConfig());
123
+ if (!loaded) {
124
+ return {
125
+ content: [{ type: "text", text: "Error: Failed to load identity. Run agentcred_init first." }],
126
+ isError: true
127
+ };
128
+ }
129
+ const signIdentity = { privateKey: loaded.privateKey, github: currentUsername };
130
+ const envelope = await (0, import_sdk.sign)(args.content, signIdentity, { agent: args.agent });
131
+ return {
132
+ content: [{ type: "text", text: JSON.stringify(envelope, null, 2) }]
133
+ };
134
+ }
135
+ async function handleVerify(args) {
136
+ let envelope;
137
+ try {
138
+ envelope = JSON.parse(args.envelope);
139
+ } catch {
140
+ return {
141
+ content: [{ type: "text", text: "Error: Invalid JSON envelope" }],
142
+ isError: true
143
+ };
144
+ }
145
+ const result = await (0, import_sdk.verify)(envelope);
146
+ return {
147
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
148
+ };
149
+ }
150
+ async function handleWhoami() {
151
+ if (!currentUsername) {
152
+ return {
153
+ content: [{ type: "text", text: "No identity configured. Run agentcred_init to set up." }]
154
+ };
155
+ }
156
+ const loaded = await (0, import_sdk.loadIdentity)(currentUsername, getConfig());
157
+ if (!loaded) {
158
+ return {
159
+ content: [{ type: "text", text: "No identity configured. Run agentcred_init to set up." }]
160
+ };
161
+ }
162
+ return {
163
+ content: [{
164
+ type: "text",
165
+ text: JSON.stringify(loaded.identity, null, 2)
166
+ }]
167
+ };
168
+ }
169
+ function registerTools(server) {
170
+ server.setRequestHandler(import_types.ListToolsRequestSchema, async () => ({
171
+ tools: TOOLS
172
+ }));
173
+ server.setRequestHandler(import_types.CallToolRequestSchema, async (request) => {
174
+ const { name } = request.params;
175
+ const args = request.params.arguments ?? {};
176
+ switch (name) {
177
+ case "agentcred_init":
178
+ return handleInit(args);
179
+ case "agentcred_sign":
180
+ return handleSign(args);
181
+ case "agentcred_verify":
182
+ return handleVerify(args);
183
+ case "agentcred_whoami":
184
+ return handleWhoami();
185
+ default:
186
+ throw new Error(`Unknown tool: ${name}`);
187
+ }
188
+ });
189
+ }
190
+
191
+ // src/resources.ts
192
+ var import_types2 = require("@modelcontextprotocol/sdk/types.js");
193
+ var import_sdk2 = require("@agentcred-ai/sdk");
194
+ var RESOURCES = [
195
+ {
196
+ uri: "agentcred://identity",
197
+ name: "Current Identity",
198
+ description: "The current AgentCred identity information as JSON",
199
+ mimeType: "application/json"
200
+ },
201
+ {
202
+ uri: "agentcred://spec",
203
+ name: "AgentCred Specification",
204
+ description: "Link to the AgentCred protocol specification",
205
+ mimeType: "text/plain"
206
+ }
207
+ ];
208
+ function registerResources(server) {
209
+ server.setRequestHandler(import_types2.ListResourcesRequestSchema, async () => ({
210
+ resources: RESOURCES
211
+ }));
212
+ server.setRequestHandler(import_types2.ReadResourceRequestSchema, async (request) => {
213
+ const { uri } = request.params;
214
+ switch (uri) {
215
+ case "agentcred://identity": {
216
+ const username = getCurrentUsername();
217
+ if (!username) {
218
+ return {
219
+ contents: [{
220
+ uri,
221
+ mimeType: "application/json",
222
+ text: JSON.stringify({ error: "No identity configured" })
223
+ }]
224
+ };
225
+ }
226
+ const loaded = await (0, import_sdk2.loadIdentity)(username, { storage: getStorage() });
227
+ if (!loaded) {
228
+ return {
229
+ contents: [{
230
+ uri,
231
+ mimeType: "application/json",
232
+ text: JSON.stringify({ error: "Failed to load identity" })
233
+ }]
234
+ };
235
+ }
236
+ return {
237
+ contents: [{
238
+ uri,
239
+ mimeType: "application/json",
240
+ text: JSON.stringify(loaded.identity, null, 2)
241
+ }]
242
+ };
243
+ }
244
+ case "agentcred://spec":
245
+ return {
246
+ contents: [{
247
+ uri,
248
+ mimeType: "text/plain",
249
+ text: "AgentCred Protocol Specification: https://github.com/agentcred/spec\n\nAgentCred enables AI agents to cryptographically sign their outputs using Ed25519 keys tied to GitHub identities."
250
+ }]
251
+ };
252
+ default:
253
+ throw new Error(`Unknown resource: ${uri}`);
254
+ }
255
+ });
256
+ }
257
+
258
+ // src/index.ts
259
+ var version = "0.0.1";
260
+ function createServer() {
261
+ const server = new import_server.Server(
262
+ { name: "agentcred", version },
263
+ { capabilities: { tools: {}, resources: {} } }
264
+ );
265
+ registerTools(server);
266
+ registerResources(server);
267
+ return server;
268
+ }
269
+ async function main() {
270
+ const server = createServer();
271
+ const transport = new import_stdio.StdioServerTransport();
272
+ await server.connect(transport);
273
+ }
274
+ var isMainModule = process.argv[1] && (process.argv[1].endsWith("/dist/index.js") || process.argv[1].endsWith("/dist/index.cjs") || process.argv[1].endsWith("/src/index.ts"));
275
+ if (isMainModule) {
276
+ main().catch((error) => {
277
+ console.error("Fatal error:", error);
278
+ process.exit(1);
279
+ });
280
+ }
281
+ // Annotate the CommonJS export names for ESM import in node:
282
+ 0 && (module.exports = {
283
+ createServer,
284
+ registerResources,
285
+ registerTools,
286
+ version
287
+ });
288
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/tools.ts","../src/resources.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { registerTools } from './tools.js'\nimport { registerResources } from './resources.js'\n\nexport const version = '0.0.1'\n\nexport function createServer(): Server {\n const server = new Server(\n { name: 'agentcred', version },\n { capabilities: { tools: {}, resources: {} } }\n )\n\n registerTools(server)\n registerResources(server)\n\n return server\n}\n\nexport { registerTools } from './tools.js'\nexport { registerResources } from './resources.js'\n\nasync function main(): Promise<void> {\n const server = createServer()\n const transport = new StdioServerTransport()\n await server.connect(transport)\n}\n\nconst isMainModule = process.argv[1] &&\n (process.argv[1].endsWith('/dist/index.js') ||\n process.argv[1].endsWith('/dist/index.cjs') ||\n process.argv[1].endsWith('/src/index.ts'))\n\nif (isMainModule) {\n main().catch((error: unknown) => {\n console.error('Fatal error:', error)\n process.exit(1)\n })\n}\n","import type { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport {\n ListToolsRequestSchema,\n CallToolRequestSchema,\n type CallToolResult,\n} from '@modelcontextprotocol/sdk/types.js'\nimport {\n createIdentity,\n loadIdentity,\n sign,\n verify,\n MemoryKeyStorage,\n type AgentCredEnvelope,\n type AgentCredConfig,\n} from '@agentcred-ai/sdk'\n\nconst storage = new MemoryKeyStorage()\n\nfunction getConfig(): AgentCredConfig {\n return { storage }\n}\n\nlet currentUsername: string | null = null\n\nexport function getStorage(): MemoryKeyStorage {\n return storage\n}\n\nexport function getCurrentUsername(): string | null {\n return currentUsername\n}\n\nexport function setCurrentUsername(username: string | null): void {\n currentUsername = username\n}\n\nconst TOOLS = [\n {\n name: 'agentcred_init',\n description: 'Initialize an AgentCred identity by authenticating with GitHub and generating a signing keypair.',\n inputSchema: {\n type: 'object' as const,\n properties: {\n github_token: {\n type: 'string',\n description: 'GitHub personal access token for authentication',\n },\n },\n required: ['github_token'],\n },\n },\n {\n name: 'agentcred_sign',\n description: 'Sign content with the current AgentCred identity, producing a verifiable envelope.',\n inputSchema: {\n type: 'object' as const,\n properties: {\n content: {\n type: 'string',\n description: 'The content to sign',\n },\n agent: {\n type: 'string',\n description: 'Optional agent identifier (defaults to \"default\")',\n },\n },\n required: ['content'],\n },\n },\n {\n name: 'agentcred_verify',\n description: 'Verify an AgentCred envelope to check its authenticity and integrity.',\n inputSchema: {\n type: 'object' as const,\n properties: {\n envelope: {\n type: 'string',\n description: 'JSON string of the AgentCredEnvelope to verify',\n },\n },\n required: ['envelope'],\n },\n },\n {\n name: 'agentcred_whoami',\n description: 'Show the current AgentCred identity information.',\n inputSchema: {\n type: 'object' as const,\n properties: {},\n },\n },\n]\n\nasync function handleInit(args: { github_token: string }): Promise<CallToolResult> {\n const identity = await createIdentity(args.github_token, getConfig())\n currentUsername = identity.github.username\n return {\n content: [{\n type: 'text',\n text: `Identity initialized for ${identity.github.username}\\nFingerprint: ${identity.fingerprint}\\nRegistered at: ${identity.registeredAt}`,\n }],\n }\n}\n\nasync function handleSign(args: { content: string; agent?: string }): Promise<CallToolResult> {\n if (!currentUsername) {\n return {\n content: [{ type: 'text', text: 'Error: No identity configured. Run agentcred_init first.' }],\n isError: true,\n }\n }\n\n const loaded = await loadIdentity(currentUsername, getConfig())\n if (!loaded) {\n return {\n content: [{ type: 'text', text: 'Error: Failed to load identity. Run agentcred_init first.' }],\n isError: true,\n }\n }\n\n const signIdentity = { privateKey: loaded.privateKey, github: currentUsername }\n const envelope = await sign(args.content, signIdentity, { agent: args.agent })\n return {\n content: [{ type: 'text', text: JSON.stringify(envelope, null, 2) }],\n }\n}\n\nasync function handleVerify(args: { envelope: string }): Promise<CallToolResult> {\n let envelope: AgentCredEnvelope\n try {\n envelope = JSON.parse(args.envelope) as AgentCredEnvelope\n } catch {\n return {\n content: [{ type: 'text', text: 'Error: Invalid JSON envelope' }],\n isError: true,\n }\n }\n\n const result = await verify(envelope)\n return {\n content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n }\n}\n\nasync function handleWhoami(): Promise<CallToolResult> {\n if (!currentUsername) {\n return {\n content: [{ type: 'text', text: 'No identity configured. Run agentcred_init to set up.' }],\n }\n }\n\n const loaded = await loadIdentity(currentUsername, getConfig())\n if (!loaded) {\n return {\n content: [{ type: 'text', text: 'No identity configured. Run agentcred_init to set up.' }],\n }\n }\n\n return {\n content: [{\n type: 'text',\n text: JSON.stringify(loaded.identity, null, 2),\n }],\n }\n}\n\nexport function registerTools(server: Server): void {\n server.setRequestHandler(ListToolsRequestSchema, async () => ({\n tools: TOOLS,\n }))\n\n server.setRequestHandler(CallToolRequestSchema, async (request): Promise<CallToolResult> => {\n const { name } = request.params\n const args = (request.params.arguments ?? {}) as Record<string, unknown>\n\n switch (name) {\n case 'agentcred_init':\n return handleInit(args as { github_token: string })\n case 'agentcred_sign':\n return handleSign(args as { content: string; agent?: string })\n case 'agentcred_verify':\n return handleVerify(args as { envelope: string })\n case 'agentcred_whoami':\n return handleWhoami()\n default:\n throw new Error(`Unknown tool: ${name}`)\n }\n })\n}\n","import type { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport {\n ListResourcesRequestSchema,\n ReadResourceRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js'\nimport { loadIdentity } from '@agentcred-ai/sdk'\nimport { getStorage, getCurrentUsername } from './tools.js'\n\nconst RESOURCES = [\n {\n uri: 'agentcred://identity',\n name: 'Current Identity',\n description: 'The current AgentCred identity information as JSON',\n mimeType: 'application/json',\n },\n {\n uri: 'agentcred://spec',\n name: 'AgentCred Specification',\n description: 'Link to the AgentCred protocol specification',\n mimeType: 'text/plain',\n },\n]\n\nexport function registerResources(server: Server): void {\n server.setRequestHandler(ListResourcesRequestSchema, async () => ({\n resources: RESOURCES,\n }))\n\n server.setRequestHandler(ReadResourceRequestSchema, async (request) => {\n const { uri } = request.params\n\n switch (uri) {\n case 'agentcred://identity': {\n const username = getCurrentUsername()\n if (!username) {\n return {\n contents: [{\n uri,\n mimeType: 'application/json',\n text: JSON.stringify({ error: 'No identity configured' }),\n }],\n }\n }\n\n const loaded = await loadIdentity(username, { storage: getStorage() })\n if (!loaded) {\n return {\n contents: [{\n uri,\n mimeType: 'application/json',\n text: JSON.stringify({ error: 'Failed to load identity' }),\n }],\n }\n }\n\n return {\n contents: [{\n uri,\n mimeType: 'application/json',\n text: JSON.stringify(loaded.identity, null, 2),\n }],\n }\n }\n\n case 'agentcred://spec':\n return {\n contents: [{\n uri,\n mimeType: 'text/plain',\n text: 'AgentCred Protocol Specification: https://github.com/agentcred/spec\\n\\nAgentCred enables AI agents to cryptographically sign their outputs using Ed25519 keys tied to GitHub identities.',\n }],\n }\n\n default:\n throw new Error(`Unknown resource: ${uri}`)\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAuB;AACvB,mBAAqC;;;ACFrC,mBAIO;AACP,iBAQO;AAEP,IAAM,UAAU,IAAI,4BAAiB;AAErC,SAAS,YAA6B;AACpC,SAAO,EAAE,QAAQ;AACnB;AAEA,IAAI,kBAAiC;AAE9B,SAAS,aAA+B;AAC7C,SAAO;AACT;AAEO,SAAS,qBAAoC;AAClD,SAAO;AACT;AAMA,IAAM,QAAQ;AAAA,EACZ;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,cAAc;AAAA,IAC3B;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,SAAS;AAAA,UACP,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,OAAO;AAAA,UACL,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,SAAS;AAAA,IACtB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa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AAA,YACA,UAAU;AAAA,YACV,MAAM;AAAA,UACR,CAAC;AAAA,QACH;AAAA,MAEF;AACE,cAAM,IAAI,MAAM,qBAAqB,GAAG,EAAE;AAAA,IAC9C;AAAA,EACF,CAAC;AACH;;;AFtEO,IAAM,UAAU;AAEhB,SAAS,eAAuB;AACrC,QAAM,SAAS,IAAI;AAAA,IACjB,EAAE,MAAM,aAAa,QAAQ;AAAA,IAC7B,EAAE,cAAc,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,EAAE,EAAE;AAAA,EAC/C;AAEA,gBAAc,MAAM;AACpB,oBAAkB,MAAM;AAExB,SAAO;AACT;AAKA,eAAe,OAAsB;AACnC,QAAM,SAAS,aAAa;AAC5B,QAAM,YAAY,IAAI,kCAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,IAAM,eAAe,QAAQ,KAAK,CAAC,MAChC,QAAQ,KAAK,CAAC,EAAE,SAAS,gBAAgB,KACzC,QAAQ,KAAK,CAAC,EAAE,SAAS,iBAAiB,KAC1C,QAAQ,KAAK,CAAC,EAAE,SAAS,eAAe;AAE3C,IAAI,cAAc;AAChB,OAAK,EAAE,MAAM,CAAC,UAAmB;AAC/B,YAAQ,MAAM,gBAAgB,KAAK;AACnC,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":["import_types","import_sdk"]}
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+
4
+ declare function registerTools(server: Server): void;
5
+
6
+ declare function registerResources(server: Server): void;
7
+
8
+ declare const version = "0.0.1";
9
+ declare function createServer(): Server;
10
+
11
+ export { createServer, registerResources, registerTools, version };
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+
4
+ declare function registerTools(server: Server): void;
5
+
6
+ declare function registerResources(server: Server): void;
7
+
8
+ declare const version = "0.0.1";
9
+ declare function createServer(): Server;
10
+
11
+ export { createServer, registerResources, registerTools, version };
package/dist/index.js ADDED
@@ -0,0 +1,273 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
+
7
+ // src/tools.ts
8
+ import {
9
+ ListToolsRequestSchema,
10
+ CallToolRequestSchema
11
+ } from "@modelcontextprotocol/sdk/types.js";
12
+ import {
13
+ createIdentity,
14
+ loadIdentity,
15
+ sign,
16
+ verify,
17
+ MemoryKeyStorage
18
+ } from "@agentcred-ai/sdk";
19
+ var storage = new MemoryKeyStorage();
20
+ function getConfig() {
21
+ return { storage };
22
+ }
23
+ var currentUsername = null;
24
+ function getStorage() {
25
+ return storage;
26
+ }
27
+ function getCurrentUsername() {
28
+ return currentUsername;
29
+ }
30
+ var TOOLS = [
31
+ {
32
+ name: "agentcred_init",
33
+ description: "Initialize an AgentCred identity by authenticating with GitHub and generating a signing keypair.",
34
+ inputSchema: {
35
+ type: "object",
36
+ properties: {
37
+ github_token: {
38
+ type: "string",
39
+ description: "GitHub personal access token for authentication"
40
+ }
41
+ },
42
+ required: ["github_token"]
43
+ }
44
+ },
45
+ {
46
+ name: "agentcred_sign",
47
+ description: "Sign content with the current AgentCred identity, producing a verifiable envelope.",
48
+ inputSchema: {
49
+ type: "object",
50
+ properties: {
51
+ content: {
52
+ type: "string",
53
+ description: "The content to sign"
54
+ },
55
+ agent: {
56
+ type: "string",
57
+ description: 'Optional agent identifier (defaults to "default")'
58
+ }
59
+ },
60
+ required: ["content"]
61
+ }
62
+ },
63
+ {
64
+ name: "agentcred_verify",
65
+ description: "Verify an AgentCred envelope to check its authenticity and integrity.",
66
+ inputSchema: {
67
+ type: "object",
68
+ properties: {
69
+ envelope: {
70
+ type: "string",
71
+ description: "JSON string of the AgentCredEnvelope to verify"
72
+ }
73
+ },
74
+ required: ["envelope"]
75
+ }
76
+ },
77
+ {
78
+ name: "agentcred_whoami",
79
+ description: "Show the current AgentCred identity information.",
80
+ inputSchema: {
81
+ type: "object",
82
+ properties: {}
83
+ }
84
+ }
85
+ ];
86
+ async function handleInit(args) {
87
+ const identity = await createIdentity(args.github_token, getConfig());
88
+ currentUsername = identity.github.username;
89
+ return {
90
+ content: [{
91
+ type: "text",
92
+ text: `Identity initialized for ${identity.github.username}
93
+ Fingerprint: ${identity.fingerprint}
94
+ Registered at: ${identity.registeredAt}`
95
+ }]
96
+ };
97
+ }
98
+ async function handleSign(args) {
99
+ if (!currentUsername) {
100
+ return {
101
+ content: [{ type: "text", text: "Error: No identity configured. Run agentcred_init first." }],
102
+ isError: true
103
+ };
104
+ }
105
+ const loaded = await loadIdentity(currentUsername, getConfig());
106
+ if (!loaded) {
107
+ return {
108
+ content: [{ type: "text", text: "Error: Failed to load identity. Run agentcred_init first." }],
109
+ isError: true
110
+ };
111
+ }
112
+ const signIdentity = { privateKey: loaded.privateKey, github: currentUsername };
113
+ const envelope = await sign(args.content, signIdentity, { agent: args.agent });
114
+ return {
115
+ content: [{ type: "text", text: JSON.stringify(envelope, null, 2) }]
116
+ };
117
+ }
118
+ async function handleVerify(args) {
119
+ let envelope;
120
+ try {
121
+ envelope = JSON.parse(args.envelope);
122
+ } catch {
123
+ return {
124
+ content: [{ type: "text", text: "Error: Invalid JSON envelope" }],
125
+ isError: true
126
+ };
127
+ }
128
+ const result = await verify(envelope);
129
+ return {
130
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
131
+ };
132
+ }
133
+ async function handleWhoami() {
134
+ if (!currentUsername) {
135
+ return {
136
+ content: [{ type: "text", text: "No identity configured. Run agentcred_init to set up." }]
137
+ };
138
+ }
139
+ const loaded = await loadIdentity(currentUsername, getConfig());
140
+ if (!loaded) {
141
+ return {
142
+ content: [{ type: "text", text: "No identity configured. Run agentcred_init to set up." }]
143
+ };
144
+ }
145
+ return {
146
+ content: [{
147
+ type: "text",
148
+ text: JSON.stringify(loaded.identity, null, 2)
149
+ }]
150
+ };
151
+ }
152
+ function registerTools(server) {
153
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
154
+ tools: TOOLS
155
+ }));
156
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
157
+ const { name } = request.params;
158
+ const args = request.params.arguments ?? {};
159
+ switch (name) {
160
+ case "agentcred_init":
161
+ return handleInit(args);
162
+ case "agentcred_sign":
163
+ return handleSign(args);
164
+ case "agentcred_verify":
165
+ return handleVerify(args);
166
+ case "agentcred_whoami":
167
+ return handleWhoami();
168
+ default:
169
+ throw new Error(`Unknown tool: ${name}`);
170
+ }
171
+ });
172
+ }
173
+
174
+ // src/resources.ts
175
+ import {
176
+ ListResourcesRequestSchema,
177
+ ReadResourceRequestSchema
178
+ } from "@modelcontextprotocol/sdk/types.js";
179
+ import { loadIdentity as loadIdentity2 } from "@agentcred-ai/sdk";
180
+ var RESOURCES = [
181
+ {
182
+ uri: "agentcred://identity",
183
+ name: "Current Identity",
184
+ description: "The current AgentCred identity information as JSON",
185
+ mimeType: "application/json"
186
+ },
187
+ {
188
+ uri: "agentcred://spec",
189
+ name: "AgentCred Specification",
190
+ description: "Link to the AgentCred protocol specification",
191
+ mimeType: "text/plain"
192
+ }
193
+ ];
194
+ function registerResources(server) {
195
+ server.setRequestHandler(ListResourcesRequestSchema, async () => ({
196
+ resources: RESOURCES
197
+ }));
198
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
199
+ const { uri } = request.params;
200
+ switch (uri) {
201
+ case "agentcred://identity": {
202
+ const username = getCurrentUsername();
203
+ if (!username) {
204
+ return {
205
+ contents: [{
206
+ uri,
207
+ mimeType: "application/json",
208
+ text: JSON.stringify({ error: "No identity configured" })
209
+ }]
210
+ };
211
+ }
212
+ const loaded = await loadIdentity2(username, { storage: getStorage() });
213
+ if (!loaded) {
214
+ return {
215
+ contents: [{
216
+ uri,
217
+ mimeType: "application/json",
218
+ text: JSON.stringify({ error: "Failed to load identity" })
219
+ }]
220
+ };
221
+ }
222
+ return {
223
+ contents: [{
224
+ uri,
225
+ mimeType: "application/json",
226
+ text: JSON.stringify(loaded.identity, null, 2)
227
+ }]
228
+ };
229
+ }
230
+ case "agentcred://spec":
231
+ return {
232
+ contents: [{
233
+ uri,
234
+ mimeType: "text/plain",
235
+ text: "AgentCred Protocol Specification: https://github.com/agentcred/spec\n\nAgentCred enables AI agents to cryptographically sign their outputs using Ed25519 keys tied to GitHub identities."
236
+ }]
237
+ };
238
+ default:
239
+ throw new Error(`Unknown resource: ${uri}`);
240
+ }
241
+ });
242
+ }
243
+
244
+ // src/index.ts
245
+ var version = "0.0.1";
246
+ function createServer() {
247
+ const server = new Server(
248
+ { name: "agentcred", version },
249
+ { capabilities: { tools: {}, resources: {} } }
250
+ );
251
+ registerTools(server);
252
+ registerResources(server);
253
+ return server;
254
+ }
255
+ async function main() {
256
+ const server = createServer();
257
+ const transport = new StdioServerTransport();
258
+ await server.connect(transport);
259
+ }
260
+ var isMainModule = process.argv[1] && (process.argv[1].endsWith("/dist/index.js") || process.argv[1].endsWith("/dist/index.cjs") || process.argv[1].endsWith("/src/index.ts"));
261
+ if (isMainModule) {
262
+ main().catch((error) => {
263
+ console.error("Fatal error:", error);
264
+ process.exit(1);
265
+ });
266
+ }
267
+ export {
268
+ createServer,
269
+ registerResources,
270
+ registerTools,
271
+ version
272
+ };
273
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/tools.ts","../src/resources.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { registerTools } from './tools.js'\nimport { registerResources } from './resources.js'\n\nexport const version = '0.0.1'\n\nexport function createServer(): Server {\n const server = new Server(\n { name: 'agentcred', version },\n { capabilities: { tools: {}, resources: {} } }\n )\n\n registerTools(server)\n registerResources(server)\n\n return server\n}\n\nexport { registerTools } from './tools.js'\nexport { registerResources } from './resources.js'\n\nasync function main(): Promise<void> {\n const server = createServer()\n const transport = new StdioServerTransport()\n await server.connect(transport)\n}\n\nconst isMainModule = process.argv[1] &&\n (process.argv[1].endsWith('/dist/index.js') ||\n process.argv[1].endsWith('/dist/index.cjs') ||\n process.argv[1].endsWith('/src/index.ts'))\n\nif (isMainModule) {\n main().catch((error: unknown) => {\n console.error('Fatal error:', error)\n process.exit(1)\n })\n}\n","import type { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport {\n ListToolsRequestSchema,\n CallToolRequestSchema,\n type CallToolResult,\n} from '@modelcontextprotocol/sdk/types.js'\nimport {\n createIdentity,\n loadIdentity,\n sign,\n verify,\n MemoryKeyStorage,\n type AgentCredEnvelope,\n type AgentCredConfig,\n} from '@agentcred-ai/sdk'\n\nconst storage = new MemoryKeyStorage()\n\nfunction getConfig(): AgentCredConfig {\n return { storage }\n}\n\nlet currentUsername: string | null = null\n\nexport function getStorage(): MemoryKeyStorage {\n return storage\n}\n\nexport function getCurrentUsername(): string | null {\n return currentUsername\n}\n\nexport function setCurrentUsername(username: string | null): void {\n currentUsername = username\n}\n\nconst TOOLS = [\n {\n name: 'agentcred_init',\n description: 'Initialize an AgentCred identity by authenticating with GitHub and generating a signing keypair.',\n inputSchema: {\n type: 'object' as const,\n properties: {\n github_token: {\n type: 'string',\n description: 'GitHub personal access token for authentication',\n },\n },\n required: ['github_token'],\n },\n },\n {\n name: 'agentcred_sign',\n description: 'Sign content with the current AgentCred identity, producing a verifiable envelope.',\n inputSchema: {\n type: 'object' as const,\n properties: {\n content: {\n type: 'string',\n description: 'The content to sign',\n },\n agent: {\n type: 'string',\n description: 'Optional agent identifier (defaults to \"default\")',\n },\n },\n required: ['content'],\n },\n },\n {\n name: 'agentcred_verify',\n description: 'Verify an AgentCred envelope to check its authenticity and integrity.',\n inputSchema: {\n type: 'object' as const,\n properties: {\n envelope: {\n type: 'string',\n description: 'JSON string of the AgentCredEnvelope to verify',\n },\n },\n required: ['envelope'],\n },\n },\n {\n name: 'agentcred_whoami',\n description: 'Show the current AgentCred identity information.',\n inputSchema: {\n type: 'object' as const,\n properties: {},\n },\n },\n]\n\nasync function handleInit(args: { github_token: string }): Promise<CallToolResult> {\n const identity = await createIdentity(args.github_token, getConfig())\n currentUsername = identity.github.username\n return {\n content: [{\n type: 'text',\n text: `Identity initialized for ${identity.github.username}\\nFingerprint: ${identity.fingerprint}\\nRegistered at: ${identity.registeredAt}`,\n }],\n }\n}\n\nasync function handleSign(args: { content: string; agent?: string }): Promise<CallToolResult> {\n if (!currentUsername) {\n return {\n content: [{ type: 'text', text: 'Error: No identity configured. Run agentcred_init first.' }],\n isError: true,\n }\n }\n\n const loaded = await loadIdentity(currentUsername, getConfig())\n if (!loaded) {\n return {\n content: [{ type: 'text', text: 'Error: Failed to load identity. Run agentcred_init first.' }],\n isError: true,\n }\n }\n\n const signIdentity = { privateKey: loaded.privateKey, github: currentUsername }\n const envelope = await sign(args.content, signIdentity, { agent: args.agent })\n return {\n content: [{ type: 'text', text: JSON.stringify(envelope, null, 2) }],\n }\n}\n\nasync function handleVerify(args: { envelope: string }): Promise<CallToolResult> {\n let envelope: AgentCredEnvelope\n try {\n envelope = JSON.parse(args.envelope) as AgentCredEnvelope\n } catch {\n return {\n content: [{ type: 'text', text: 'Error: Invalid JSON envelope' }],\n isError: true,\n }\n }\n\n const result = await verify(envelope)\n return {\n content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n }\n}\n\nasync function handleWhoami(): Promise<CallToolResult> {\n if (!currentUsername) {\n return {\n content: [{ type: 'text', text: 'No identity configured. Run agentcred_init to set up.' }],\n }\n }\n\n const loaded = await loadIdentity(currentUsername, getConfig())\n if (!loaded) {\n return {\n content: [{ type: 'text', text: 'No identity configured. Run agentcred_init to set up.' }],\n }\n }\n\n return {\n content: [{\n type: 'text',\n text: JSON.stringify(loaded.identity, null, 2),\n }],\n }\n}\n\nexport function registerTools(server: Server): void {\n server.setRequestHandler(ListToolsRequestSchema, async () => ({\n tools: TOOLS,\n }))\n\n server.setRequestHandler(CallToolRequestSchema, async (request): Promise<CallToolResult> => {\n const { name } = request.params\n const args = (request.params.arguments ?? {}) as Record<string, unknown>\n\n switch (name) {\n case 'agentcred_init':\n return handleInit(args as { github_token: string })\n case 'agentcred_sign':\n return handleSign(args as { content: string; agent?: string })\n case 'agentcred_verify':\n return handleVerify(args as { envelope: string })\n case 'agentcred_whoami':\n return handleWhoami()\n default:\n throw new Error(`Unknown tool: ${name}`)\n }\n })\n}\n","import type { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport {\n ListResourcesRequestSchema,\n ReadResourceRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js'\nimport { loadIdentity } from '@agentcred-ai/sdk'\nimport { getStorage, getCurrentUsername } from './tools.js'\n\nconst RESOURCES = [\n {\n uri: 'agentcred://identity',\n name: 'Current Identity',\n description: 'The current AgentCred identity information as JSON',\n mimeType: 'application/json',\n },\n {\n uri: 'agentcred://spec',\n name: 'AgentCred Specification',\n description: 'Link to the AgentCred protocol specification',\n mimeType: 'text/plain',\n },\n]\n\nexport function registerResources(server: Server): void {\n server.setRequestHandler(ListResourcesRequestSchema, async () => ({\n resources: RESOURCES,\n }))\n\n server.setRequestHandler(ReadResourceRequestSchema, async (request) => {\n const { uri } = request.params\n\n switch (uri) {\n case 'agentcred://identity': {\n const username = getCurrentUsername()\n if (!username) {\n return {\n contents: [{\n uri,\n mimeType: 'application/json',\n text: JSON.stringify({ error: 'No identity configured' }),\n }],\n }\n }\n\n const loaded = await loadIdentity(username, { storage: getStorage() })\n if (!loaded) {\n return {\n contents: [{\n uri,\n mimeType: 'application/json',\n text: JSON.stringify({ error: 'Failed to load identity' }),\n }],\n }\n }\n\n return {\n contents: [{\n uri,\n mimeType: 'application/json',\n text: JSON.stringify(loaded.identity, null, 2),\n }],\n }\n }\n\n case 'agentcred://spec':\n return {\n contents: [{\n uri,\n mimeType: 'text/plain',\n text: 'AgentCred Protocol Specification: https://github.com/agentcred/spec\\n\\nAgentCred enables AI agents to cryptographically sign their outputs using Ed25519 keys tied to GitHub identities.',\n }],\n }\n\n default:\n throw new Error(`Unknown resource: ${uri}`)\n }\n })\n}\n"],"mappings":";;;AAEA,SAAS,cAAc;AACvB,SAAS,4BAA4B;;;ACFrC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAEP,IAAM,UAAU,IAAI,iBAAiB;AAErC,SAAS,YAA6B;AACpC,SAAO,EAAE,QAAQ;AACnB;AAEA,IAAI,kBAAiC;AAE9B,SAAS,aAA+B;AAC7C,SAAO;AACT;AAEO,SAAS,qBAAoC;AAClD,SAAO;AACT;AAMA,IAAM,QAAQ;AAAA,EACZ;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,cAAc;AAAA,IAC3B;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,SAAS;AAAA,UACP,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,OAAO;AAAA,UACL,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,SAAS;AAAA,IACtB;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,UAAU;AAAA,IACvB;AAAA,EACF;AAAA,EACA;AA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AU;AAEhB,SAAS,eAAuB;AACrC,QAAM,SAAS,IAAI;AAAA,IACjB,EAAE,MAAM,aAAa,QAAQ;AAAA,IAC7B,EAAE,cAAc,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,EAAE,EAAE;AAAA,EAC/C;AAEA,gBAAc,MAAM;AACpB,oBAAkB,MAAM;AAExB,SAAO;AACT;AAKA,eAAe,OAAsB;AACnC,QAAM,SAAS,aAAa;AAC5B,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,IAAM,eAAe,QAAQ,KAAK,CAAC,MAChC,QAAQ,KAAK,CAAC,EAAE,SAAS,gBAAgB,KACzC,QAAQ,KAAK,CAAC,EAAE,SAAS,iBAAiB,KAC1C,QAAQ,KAAK,CAAC,EAAE,SAAS,eAAe;AAE3C,IAAI,cAAc;AAChB,OAAK,EAAE,MAAM,CAAC,UAAmB;AAC/B,YAAQ,MAAM,gBAAgB,KAAK;AACnC,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;","names":["loadIdentity","loadIdentity"]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@agentcred-ai/mcp-server",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for AgentCred integration with AI agents",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js",
10
+ "require": "./dist/index.cjs"
11
+ }
12
+ },
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "bin": {
17
+ "agentcred-mcp": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "dependencies": {
23
+ "@modelcontextprotocol/sdk": "^1.25.3",
24
+ "@agentcred-ai/sdk": "0.1.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node": "^25.1.0",
28
+ "tsup": "^8.0.0",
29
+ "typescript": "^5.8.0",
30
+ "vitest": "^3.0.0"
31
+ },
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/agentcred-ai/agentcred",
36
+ "directory": "packages/mcp-server"
37
+ },
38
+ "homepage": "https://agentcred.dev",
39
+ "bugs": {
40
+ "url": "https://github.com/agentcred-ai/agentcred/issues"
41
+ },
42
+ "keywords": [
43
+ "agentcred",
44
+ "ai-agent",
45
+ "mcp",
46
+ "cryptography",
47
+ "ed25519",
48
+ "identity",
49
+ "signature"
50
+ ],
51
+ "author": "AgentCred Contributors",
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "test": "vitest run",
55
+ "typecheck": "tsc --noEmit"
56
+ }
57
+ }