@absolutejs/mcp 0.4.1 → 0.4.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.
- package/dist/index.js +15 -0
- package/dist/manifest.js +8587 -0
- package/dist/manifest.json +124 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/manifest.d.ts +2 -0
- package/package.json +22 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": 1,
|
|
3
|
+
"identity": {
|
|
4
|
+
"accent": "#0ea5e9",
|
|
5
|
+
"category": "ai",
|
|
6
|
+
"description": "Serve a remote Model Context Protocol endpoint (streamable HTTP, stateless) from your Elysia app. Bridge installed AbsoluteJS packages' manifests with `toMcpToolRegistry` and their tools become callable by any connected MCP client; OAuth bearer auth, RFC 9728 discovery, and per-call guards are yours to wire.",
|
|
7
|
+
"docsUrl": "https://github.com/absolutejs/mcp",
|
|
8
|
+
"name": "@absolutejs/mcp",
|
|
9
|
+
"tagline": "Let AI assistants connect to your site and use its tools."
|
|
10
|
+
},
|
|
11
|
+
"requires": {
|
|
12
|
+
"peers": [
|
|
13
|
+
{
|
|
14
|
+
"name": "elysia",
|
|
15
|
+
"range": ">=1.1.0",
|
|
16
|
+
"reason": "plugin host"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"settings": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"required": [
|
|
23
|
+
"issuer",
|
|
24
|
+
"path"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"instructions": {
|
|
28
|
+
"description": "A short note shown to the AI about what this server does and how to use it.",
|
|
29
|
+
"title": "Instructions for the AI",
|
|
30
|
+
"type": "string"
|
|
31
|
+
},
|
|
32
|
+
"issuer": {
|
|
33
|
+
"description": "The web address of the sign-in server that issues access tokens for this endpoint. Usually your site's own address.",
|
|
34
|
+
"examples": [
|
|
35
|
+
"https://yoursite.com"
|
|
36
|
+
],
|
|
37
|
+
"format": "uri",
|
|
38
|
+
"title": "Token issuer",
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"path": {
|
|
42
|
+
"default": "/mcp",
|
|
43
|
+
"description": "Where on your site the AI endpoint lives.",
|
|
44
|
+
"title": "Endpoint path",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"scopesSupported": {
|
|
48
|
+
"description": "The permission scopes this endpoint advertises to connecting clients.",
|
|
49
|
+
"examples": [
|
|
50
|
+
[
|
|
51
|
+
"openid",
|
|
52
|
+
"mcp"
|
|
53
|
+
]
|
|
54
|
+
],
|
|
55
|
+
"title": "Advertised scopes",
|
|
56
|
+
"x-group": "advanced",
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"serveRootMetadata": {
|
|
63
|
+
"description": "Also answer discovery requests at the site root. Turn on for exactly one endpoint per site.",
|
|
64
|
+
"title": "Answer root discovery",
|
|
65
|
+
"x-group": "advanced",
|
|
66
|
+
"type": "boolean"
|
|
67
|
+
},
|
|
68
|
+
"serverInfo": {
|
|
69
|
+
"description": "How this server introduces itself to connecting AI clients.",
|
|
70
|
+
"title": "Server identity",
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"name": {
|
|
74
|
+
"title": "Machine name",
|
|
75
|
+
"examples": [
|
|
76
|
+
"your-site"
|
|
77
|
+
],
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"title": {
|
|
81
|
+
"title": "Display name",
|
|
82
|
+
"examples": [
|
|
83
|
+
"Your Site"
|
|
84
|
+
],
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"version": {
|
|
88
|
+
"title": "Version",
|
|
89
|
+
"examples": [
|
|
90
|
+
"1.0.0"
|
|
91
|
+
],
|
|
92
|
+
"type": "string"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"wiring": [
|
|
99
|
+
{
|
|
100
|
+
"description": "Mount a remote MCP endpoint that serves the tools of installed AbsoluteJS packages — bridge each package's manifest and any MCP client (Claude, etc.) can call them.",
|
|
101
|
+
"id": "default",
|
|
102
|
+
"server": {
|
|
103
|
+
"code": ".use(\n\tmcpServer({\n\t\t// TODO: decide who may call this endpoint — see verifyBearer for\n\t\t// the standard OAuth bearer-token checks. Denies everyone until\n\t\t// you wire it.\n\t\tauthorize: async () => ({\n\t\t\tok: false,\n\t\t\treason: 'authorization not configured'\n\t\t}),\n\t\tinstructions: ${settings.instructions},\n\t\tissuer: ${settings.issuer},\n\t\tpath: ${settings.path},\n\t\tscopesSupported: ${settings.scopesSupported},\n\t\tserveRootMetadata: ${settings.serveRootMetadata},\n\t\tserverInfo: ${settings.serverInfo} ?? { name: 'my-site', version: '0.1.0' },\n\t\ttools: async () => {\n\t\t\t// Every installed AbsoluteJS package ships a manifest; bridging\n\t\t\t// it exposes that package's tools here. Pass the live instance\n\t\t\t// you constructed for the package as `runtime` — tools without\n\t\t\t// their binding are omitted (fail closed).\n\t\t\t// TODO: list the packages this endpoint should expose.\n\t\t\tconst exposed: { name: string; runtime?: unknown }[] = [];\n\t\t\tconst registries = await Promise.all(\n\t\t\t\texposed.map(async ({ name, runtime }) => {\n\t\t\t\t\tconst loaded = await loadManifest(name);\n\n\t\t\t\t\treturn loaded.ok\n\t\t\t\t\t\t? toMcpToolRegistry(loaded.manifest, { runtime })\n\t\t\t\t\t\t: {};\n\t\t\t\t})\n\t\t\t);\n\n\t\t\treturn Object.assign({}, ...registries);\n\t\t}\n\t})\n)",
|
|
104
|
+
"imports": [
|
|
105
|
+
{
|
|
106
|
+
"from": "@absolutejs/mcp",
|
|
107
|
+
"names": [
|
|
108
|
+
"mcpServer"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"from": "@absolutejs/manifest",
|
|
113
|
+
"names": [
|
|
114
|
+
"loadManifest",
|
|
115
|
+
"toMcpToolRegistry"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"placement": "server-plugin"
|
|
120
|
+
},
|
|
121
|
+
"title": "Serve installed packages' tools over MCP"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -38,4 +38,4 @@ export { createMcpHandler } from "./handler";
|
|
|
38
38
|
export { metadataPathFor, protectedResourceMetadata, type ProtectedResourceMetadata, } from "./metadata";
|
|
39
39
|
export { mcpServer } from "./server";
|
|
40
40
|
export { createSessionRegistry, type SessionRegistry } from "./sessions";
|
|
41
|
-
export type { McpAudioContent, McpElicitationRequest, McpElicitResult, McpAuthResult, McpCallGate, McpCallMeta, McpContent, McpImageContent, McpPromptArgument, McpPromptDefinition, McpPrompts, McpResource, McpResourceLink, McpResources, McpServerConfig, McpServerInfo, McpTextContent, McpTool, McpToolAnnotations, McpToolCallContext, McpToolContext, McpToolRegistry, McpToolResult, McpToolReturn, } from "./types";
|
|
41
|
+
export type { McpAudioContent, McpElicitAnswer, McpElicitationRequest, McpElicitBus, McpElicitResult, McpSessionStore, McpAuthResult, McpCallGate, McpCallMeta, McpContent, McpImageContent, McpPromptArgument, McpPromptDefinition, McpPrompts, McpResource, McpResourceLink, McpResources, McpServerConfig, McpServerInfo, McpTextContent, McpTool, McpToolAnnotations, McpToolCallContext, McpToolContext, McpToolRegistry, McpToolResult, McpToolReturn, } from "./types";
|
package/package.json
CHANGED
|
@@ -10,7 +10,27 @@
|
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"elysia": ">=1.1.0"
|
|
12
12
|
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@absolutejs/manifest": "^0.1.0",
|
|
15
|
+
"@sinclair/typebox": "^0.34.0"
|
|
16
|
+
},
|
|
13
17
|
"license": "BUSL-1.1",
|
|
18
|
+
"absolutejs": {
|
|
19
|
+
"manifestContract": 1
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/src/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./manifest": {
|
|
28
|
+
"types": "./dist/src/manifest.d.ts",
|
|
29
|
+
"import": "./dist/manifest.js",
|
|
30
|
+
"default": "./dist/manifest.js"
|
|
31
|
+
},
|
|
32
|
+
"./manifest.json": "./dist/manifest.json"
|
|
33
|
+
},
|
|
14
34
|
"publishConfig": {
|
|
15
35
|
"access": "public"
|
|
16
36
|
},
|
|
@@ -30,12 +50,12 @@
|
|
|
30
50
|
"LICENSE"
|
|
31
51
|
],
|
|
32
52
|
"scripts": {
|
|
33
|
-
"build": "rm -rf dist && bun build src/index.ts --outdir dist --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json",
|
|
53
|
+
"build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --root ./src --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit",
|
|
34
54
|
"format": "prettier --write \"./**/*.{ts,json,md}\"",
|
|
35
55
|
"release": "bun run format && bun run test && bun run build && bun publish",
|
|
36
56
|
"test": "bun test",
|
|
37
57
|
"typecheck": "tsc --noEmit --project tsconfig.json"
|
|
38
58
|
},
|
|
39
59
|
"types": "./dist/src/index.d.ts",
|
|
40
|
-
"version": "0.4.
|
|
60
|
+
"version": "0.4.3"
|
|
41
61
|
}
|