@agentmanifest/mcp-server 0.0.0-stage → 0.1.3

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.
Files changed (45) hide show
  1. package/README.md +212 -2
  2. package/dist/create-server.d.ts +3 -0
  3. package/dist/create-server.d.ts.map +1 -0
  4. package/dist/create-server.js +95 -0
  5. package/dist/create-server.js.map +1 -0
  6. package/dist/http.d.ts +3 -0
  7. package/dist/http.d.ts.map +1 -0
  8. package/dist/http.js +74 -0
  9. package/dist/http.js.map +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +13 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/lib/__tests__/check-permissions.test.d.ts +2 -0
  15. package/dist/lib/__tests__/check-permissions.test.d.ts.map +1 -0
  16. package/dist/lib/__tests__/check-permissions.test.js +29 -0
  17. package/dist/lib/__tests__/check-permissions.test.js.map +1 -0
  18. package/dist/lib/check-permissions.d.ts +13 -0
  19. package/dist/lib/check-permissions.d.ts.map +1 -0
  20. package/dist/lib/check-permissions.js +188 -0
  21. package/dist/lib/check-permissions.js.map +1 -0
  22. package/dist/lib/fetch-manifest.d.ts +5 -0
  23. package/dist/lib/fetch-manifest.d.ts.map +1 -0
  24. package/dist/lib/fetch-manifest.js +74 -0
  25. package/dist/lib/fetch-manifest.js.map +1 -0
  26. package/dist/lib/resolve-manifest-url.d.ts +5 -0
  27. package/dist/lib/resolve-manifest-url.d.ts.map +1 -0
  28. package/dist/lib/resolve-manifest-url.js +8 -0
  29. package/dist/lib/resolve-manifest-url.js.map +1 -0
  30. package/dist/lib/schemas.d.ts +3 -0
  31. package/dist/lib/schemas.d.ts.map +1 -0
  32. package/dist/lib/schemas.js +8 -0
  33. package/dist/lib/schemas.js.map +1 -0
  34. package/dist/lib/types.d.ts +84 -0
  35. package/dist/lib/types.d.ts.map +1 -0
  36. package/dist/lib/types.js +2 -0
  37. package/dist/lib/types.js.map +1 -0
  38. package/dist/lib/validate-syntax.d.ts +3 -0
  39. package/dist/lib/validate-syntax.d.ts.map +1 -0
  40. package/dist/lib/validate-syntax.js +52 -0
  41. package/dist/lib/validate-syntax.js.map +1 -0
  42. package/package.json +61 -4
  43. package/schemas/v0.2/manifest.json +290 -0
  44. package/schemas/v0.3/manifest.json +488 -0
  45. package/smithery.yaml +31 -0
@@ -0,0 +1,488 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://agent-manifest.com/schemas/v0.3/manifest.json",
4
+ "title": "Agent Manifest v0.3",
5
+ "description": "Schema for manifests that declare spec_version agentmanifest-0.3 (specification revision 0.3.1). Manifests declaring agentmanifest-0.2 are validated against https://agent-manifest.com/schemas/v0.2/manifest.json.",
6
+ "type": "object",
7
+ "required": [
8
+ "spec_version",
9
+ "name",
10
+ "version",
11
+ "description",
12
+ "categories",
13
+ "primary_category",
14
+ "endpoints",
15
+ "pricing",
16
+ "authentication",
17
+ "agent_notes",
18
+ "contact",
19
+ "last_updated"
20
+ ],
21
+ "properties": {
22
+ "spec_version": {
23
+ "type": "string",
24
+ "enum": ["agentmanifest-0.3"],
25
+ "description": "Version of the AgentManifest specification"
26
+ },
27
+ "name": {
28
+ "type": "string",
29
+ "minLength": 3,
30
+ "maxLength": 100,
31
+ "description": "Human-readable name of the API"
32
+ },
33
+ "version": {
34
+ "type": "string",
35
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
36
+ "description": "Semantic version of the API"
37
+ },
38
+ "description": {
39
+ "type": "string",
40
+ "minLength": 100,
41
+ "description": "Plain language explanation for AI agents"
42
+ },
43
+ "homepage": {
44
+ "type": "string",
45
+ "format": "uri",
46
+ "description": "URL to the API homepage"
47
+ },
48
+ "documentation": {
49
+ "type": "string",
50
+ "format": "uri",
51
+ "description": "URL to external documentation"
52
+ },
53
+ "categories": {
54
+ "type": "array",
55
+ "minItems": 1,
56
+ "items": {
57
+ "type": "string",
58
+ "enum": [
59
+ "food-science",
60
+ "materials",
61
+ "construction",
62
+ "music-gear",
63
+ "chemistry",
64
+ "biology",
65
+ "physics",
66
+ "mathematics",
67
+ "geography",
68
+ "finance",
69
+ "legal",
70
+ "medical",
71
+ "engineering",
72
+ "education",
73
+ "translation",
74
+ "media",
75
+ "agriculture",
76
+ "computing",
77
+ "language",
78
+ "history",
79
+ "commerce",
80
+ "identity",
81
+ "weather",
82
+ "logistics",
83
+ "other"
84
+ ]
85
+ },
86
+ "description": "Categories from controlled vocabulary"
87
+ },
88
+ "primary_category": {
89
+ "type": "string",
90
+ "enum": [
91
+ "reference",
92
+ "live",
93
+ "computational",
94
+ "transactional",
95
+ "enrichment",
96
+ "personal",
97
+ "discovery"
98
+ ],
99
+ "description": "Primary classification of the API"
100
+ },
101
+ "endpoints": {
102
+ "type": "array",
103
+ "minItems": 1,
104
+ "items": {
105
+ "type": "object",
106
+ "required": ["path", "method", "description", "parameters", "response_description"],
107
+ "properties": {
108
+ "path": {
109
+ "type": "string",
110
+ "pattern": "^/",
111
+ "description": "API endpoint path"
112
+ },
113
+ "method": {
114
+ "type": "string",
115
+ "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
116
+ "description": "HTTP method"
117
+ },
118
+ "description": {
119
+ "type": "string",
120
+ "minLength": 20,
121
+ "description": "When and why agents should use this endpoint"
122
+ },
123
+ "parameters": {
124
+ "type": "array",
125
+ "items": {
126
+ "type": "object",
127
+ "required": ["name", "type", "required", "description"],
128
+ "properties": {
129
+ "name": { "type": "string" },
130
+ "type": { "type": "string" },
131
+ "required": { "type": "boolean" },
132
+ "description": { "type": "string" }
133
+ }
134
+ },
135
+ "description": "Array of parameter objects"
136
+ },
137
+ "response_description": {
138
+ "type": "string",
139
+ "minLength": 20,
140
+ "description": "Response content and interpretation guide"
141
+ },
142
+ "cost_hint": {
143
+ "type": "object",
144
+ "required": ["unit", "estimated_price", "currency"],
145
+ "properties": {
146
+ "unit": {
147
+ "type": "string",
148
+ "description": "Billing unit for this endpoint"
149
+ },
150
+ "estimated_price": {
151
+ "type": "string",
152
+ "pattern": "^\\d+(\\.\\d+)?$",
153
+ "description": "Estimated cost per unit as decimal string"
154
+ },
155
+ "currency": {
156
+ "type": "string",
157
+ "description": "ISO 4217 code or x- prefixed unit identifier"
158
+ },
159
+ "notes": {
160
+ "type": "string",
161
+ "description": "Pricing notes for this endpoint"
162
+ }
163
+ },
164
+ "description": "Per-endpoint cost metadata"
165
+ }
166
+ }
167
+ },
168
+ "description": "Available API endpoints"
169
+ },
170
+ "pricing": {
171
+ "type": "object",
172
+ "required": ["model"],
173
+ "properties": {
174
+ "model": {
175
+ "type": "string",
176
+ "enum": [
177
+ "free",
178
+ "freemium",
179
+ "per-query",
180
+ "subscription",
181
+ "pay-what-you-want",
182
+ "tiered",
183
+ "usage_based",
184
+ "unknown"
185
+ ],
186
+ "description": "Pricing model. 'freemium' and 'unknown' were added in revision 0.3.1; 'unknown' is intended for registry entries generated from public documentation that does not state pricing."
187
+ },
188
+ "free_tier": {
189
+ "type": ["object", "null"],
190
+ "properties": {
191
+ "queries_per_day": { "type": ["number", "null"], "minimum": 0 },
192
+ "queries_per_month": { "type": ["number", "null"], "minimum": 0 }
193
+ },
194
+ "description": "Free usage limits"
195
+ },
196
+ "paid_tier": {
197
+ "type": ["object", "null"],
198
+ "required": ["unit", "description"],
199
+ "anyOf": [
200
+ { "required": ["amount_usd"] },
201
+ { "required": ["amount", "currency"] }
202
+ ],
203
+ "properties": {
204
+ "amount_usd": { "type": "number", "minimum": 0 },
205
+ "amount": {
206
+ "type": "string",
207
+ "pattern": "^\\d+(\\.\\d+)?$",
208
+ "description": "Price as a decimal string in the declared currency (revision 0.3.1)"
209
+ },
210
+ "currency": {
211
+ "type": "string",
212
+ "description": "ISO 4217 code or x- prefixed unit identifier for amount (revision 0.3.1)"
213
+ },
214
+ "unit": { "type": "string" },
215
+ "description": { "type": "string" }
216
+ },
217
+ "description": "Paid tier details. Declare amount_usd, or amount with currency for prices that are not in USD."
218
+ },
219
+ "support_url": {
220
+ "type": ["string", "null"],
221
+ "format": "uri",
222
+ "description": "URL for voluntary contributions or payment"
223
+ }
224
+ },
225
+ "description": "Informational pricing metadata"
226
+ },
227
+ "payment": {
228
+ "oneOf": [
229
+ { "type": "null" },
230
+ {
231
+ "type": "object",
232
+ "required": ["model", "currency", "rates", "settlement"],
233
+ "properties": {
234
+ "model": {
235
+ "type": "string",
236
+ "enum": ["free", "per_request", "metered_usage", "prepaid_credits", "subscription"],
237
+ "description": "Payment model"
238
+ },
239
+ "currency": {
240
+ "type": "string",
241
+ "description": "ISO 4217 code or x- prefixed unit identifier"
242
+ },
243
+ "protocol": {
244
+ "type": "string",
245
+ "enum": ["x402"],
246
+ "description": "Payment protocol spoken by the API's endpoints (revision 0.3.1). With 'x402', an unpaid request to a paid endpoint returns HTTP 402 with payment requirements, and onboarding becomes optional."
247
+ },
248
+ "networks": {
249
+ "type": "array",
250
+ "minItems": 1,
251
+ "items": { "type": "string", "minLength": 1 },
252
+ "description": "Settlement networks accepted by the protocol, preferably as CAIP-2 identifiers (for example 'nano:mainnet', 'eip155:8453'). Required when protocol is set."
253
+ },
254
+ "discovery_url": {
255
+ "type": "string",
256
+ "format": "uri",
257
+ "description": "URL of the protocol's discovery document, for example https://api.example.com/.well-known/x402"
258
+ },
259
+ "rates": {
260
+ "type": "array",
261
+ "items": {
262
+ "type": "object",
263
+ "required": ["unit", "price"],
264
+ "properties": {
265
+ "unit": {
266
+ "type": "string",
267
+ "description": "Billing unit (request, token, byte, compute_second, query, record, month)"
268
+ },
269
+ "price": {
270
+ "type": "string",
271
+ "pattern": "^\\d+(\\.\\d+)?$",
272
+ "description": "Cost per unit as decimal string"
273
+ },
274
+ "description": { "type": "string" },
275
+ "tier": { "type": ["string", "null"] },
276
+ "threshold": { "type": ["integer", "null"] },
277
+ "cap": { "type": ["integer", "null"] }
278
+ }
279
+ },
280
+ "description": "Rate definitions"
281
+ },
282
+ "onboarding": {
283
+ "type": "object",
284
+ "required": ["url", "method", "accepts", "returns"],
285
+ "properties": {
286
+ "url": { "type": "string", "format": "uri" },
287
+ "method": { "type": "string", "enum": ["POST", "PUT"] },
288
+ "accepts": {
289
+ "type": "array",
290
+ "minItems": 1,
291
+ "items": {
292
+ "type": "string",
293
+ "enum": ["signed_jwt", "platform_token", "oauth_bearer"]
294
+ },
295
+ "description": "Credential types the onboarding endpoint accepts"
296
+ },
297
+ "returns": {
298
+ "type": "object",
299
+ "required": ["credential_type", "credential_field", "instructions"],
300
+ "properties": {
301
+ "credential_type": {
302
+ "type": "string",
303
+ "enum": ["api_key", "bearer_token", "session_token", "subscription_id"]
304
+ },
305
+ "credential_field": { "type": "string" },
306
+ "instructions": { "type": "string" },
307
+ "expires_in": { "type": ["integer", "null"] },
308
+ "refresh_url": { "type": ["string", "null"], "format": "uri" }
309
+ }
310
+ }
311
+ },
312
+ "description": "Autonomous payment onboarding endpoint"
313
+ },
314
+ "usage_endpoint": {
315
+ "type": "object",
316
+ "required": ["url", "method", "authentication"],
317
+ "properties": {
318
+ "url": { "type": "string", "format": "uri" },
319
+ "method": { "type": "string", "enum": ["GET", "POST"] },
320
+ "authentication": {
321
+ "type": "string",
322
+ "enum": ["same_as_api", "onboarding_credential"]
323
+ }
324
+ },
325
+ "description": "Usage/spend checking endpoint"
326
+ },
327
+ "settlement": {
328
+ "type": "object",
329
+ "required": ["type"],
330
+ "properties": {
331
+ "type": {
332
+ "type": "string",
333
+ "enum": ["real_time", "postpaid_cycle", "prepaid_debit"]
334
+ },
335
+ "cycle": {
336
+ "type": ["string", "null"],
337
+ "enum": ["daily", "weekly", "monthly", "quarterly", "annual", null]
338
+ },
339
+ "provider_name": { "type": ["string", "null"] },
340
+ "provider_url": { "type": ["string", "null"], "format": "uri" }
341
+ }
342
+ },
343
+ "budget_controls": {
344
+ "type": "object",
345
+ "properties": {
346
+ "supports_spend_cap": { "type": "boolean", "default": false },
347
+ "supports_per_request_limit": { "type": "boolean", "default": false },
348
+ "supports_rate_limit": { "type": "boolean", "default": false },
349
+ "supports_alerting": { "type": "boolean", "default": false }
350
+ }
351
+ },
352
+ "refund_policy": {
353
+ "type": "object",
354
+ "required": ["type"],
355
+ "properties": {
356
+ "type": {
357
+ "type": "string",
358
+ "enum": ["none", "full", "partial", "prorated", "credit"]
359
+ },
360
+ "terms_url": { "type": ["string", "null"], "format": "uri" },
361
+ "window_seconds": { "type": ["integer", "null"], "minimum": 0 }
362
+ }
363
+ }
364
+ },
365
+ "if": { "required": ["protocol"] },
366
+ "then": { "required": ["networks"] },
367
+ "description": "Machine-executable payment contract"
368
+ }
369
+ ]
370
+ },
371
+ "authentication": {
372
+ "type": "object",
373
+ "required": ["required"],
374
+ "properties": {
375
+ "required": { "type": "boolean" },
376
+ "type": {
377
+ "type": ["string", "null"],
378
+ "enum": ["api_key", "oauth2", "bearer", "none", null]
379
+ },
380
+ "instructions": { "type": ["string", "null"] },
381
+ "config": { "type": "object" }
382
+ },
383
+ "description": "Authentication requirements"
384
+ },
385
+ "reliability": {
386
+ "type": "object",
387
+ "properties": {
388
+ "maintained_by": {
389
+ "type": "string",
390
+ "enum": ["individual", "organization", "community"]
391
+ },
392
+ "status_url": { "type": ["string", "null"], "format": "uri" },
393
+ "expected_uptime_pct": { "type": ["number", "null"], "minimum": 0, "maximum": 100 },
394
+ "uptime_percentage": { "type": "number", "minimum": 0, "maximum": 100 },
395
+ "avg_response_time_ms": { "type": "integer", "minimum": 0 },
396
+ "last_30_days_uptime": { "type": "number", "minimum": 0, "maximum": 100 }
397
+ },
398
+ "description": "Reliability information"
399
+ },
400
+ "rate_limits": {
401
+ "type": "object",
402
+ "properties": {
403
+ "requests_per_minute": { "type": ["integer", "null"], "minimum": 0 },
404
+ "requests_per_day": { "type": ["integer", "null"], "minimum": 0 }
405
+ }
406
+ },
407
+ "agent_notes": {
408
+ "type": "string",
409
+ "minLength": 150,
410
+ "description": "Operational guidance for AI agents"
411
+ },
412
+ "contact": {
413
+ "description": "Contact email, URL, or object",
414
+ "oneOf": [
415
+ { "type": "string" },
416
+ {
417
+ "type": "object",
418
+ "properties": {
419
+ "email": { "type": "string", "format": "email" },
420
+ "support_url": { "type": "string", "format": "uri" },
421
+ "github": { "type": "string", "format": "uri" }
422
+ }
423
+ }
424
+ ]
425
+ },
426
+ "listing_requested": {
427
+ "type": "boolean",
428
+ "description": "Whether API requests public listing"
429
+ },
430
+ "last_updated": {
431
+ "type": "string",
432
+ "format": "date-time",
433
+ "description": "ISO 8601 timestamp of last manifest update"
434
+ }
435
+ },
436
+ "additionalProperties": true,
437
+ "allOf": [
438
+ {
439
+ "if": {
440
+ "properties": {
441
+ "payment": {
442
+ "type": "object",
443
+ "properties": { "model": { "not": { "const": "free" } } },
444
+ "not": { "required": ["protocol"] }
445
+ }
446
+ },
447
+ "required": ["payment"]
448
+ },
449
+ "then": {
450
+ "properties": {
451
+ "payment": {
452
+ "required": ["onboarding"]
453
+ }
454
+ }
455
+ }
456
+ },
457
+ {
458
+ "if": {
459
+ "properties": {
460
+ "payment": {
461
+ "type": "object",
462
+ "properties": {
463
+ "settlement": {
464
+ "type": "object",
465
+ "properties": { "type": { "const": "postpaid_cycle" } }
466
+ }
467
+ }
468
+ }
469
+ },
470
+ "required": ["payment"]
471
+ },
472
+ "then": {
473
+ "properties": {
474
+ "payment": {
475
+ "properties": {
476
+ "settlement": {
477
+ "required": ["type", "cycle"],
478
+ "properties": {
479
+ "cycle": { "type": "string" }
480
+ }
481
+ }
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ ]
488
+ }
package/smithery.yaml ADDED
@@ -0,0 +1,31 @@
1
+ # Smithery configuration: https://smithery.ai/docs/build/project-config
2
+ startCommand:
3
+ type: stdio
4
+ configSchema:
5
+ type: object
6
+ description: Optional tuning for AMP MCP (all fields optional).
7
+ properties:
8
+ AMP_FETCH_TIMEOUT_MS:
9
+ type: integer
10
+ minimum: 1000
11
+ maximum: 120000
12
+ default: 15000
13
+ description: Timeout in milliseconds when fetching manifests over HTTP.
14
+ AMP_VALIDATOR_URL:
15
+ type: string
16
+ format: uri
17
+ default: "https://validator.agent-manifest.com"
18
+ description: Base URL for the public AMP validator (used for optional remote checks).
19
+ additionalProperties: false
20
+ commandFunction: |
21
+ (config) => ({
22
+ command: 'node',
23
+ args: ['dist/index.js'],
24
+ env: {
25
+ AMP_FETCH_TIMEOUT_MS: String(config.AMP_FETCH_TIMEOUT_MS ?? 15000),
26
+ AMP_VALIDATOR_URL: config.AMP_VALIDATOR_URL ?? 'https://validator.agent-manifest.com',
27
+ },
28
+ })
29
+ exampleConfig:
30
+ AMP_FETCH_TIMEOUT_MS: 15000
31
+ AMP_VALIDATOR_URL: "https://validator.agent-manifest.com"