@silkweave/mcp 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +18 -0
- package/.turbo/turbo-check.log +13 -0
- package/.turbo/turbo-lint.log +6 -0
- package/.turbo/turbo-prepack.log +26 -0
- package/README.md +91 -0
- package/build/index.d.ts +19 -0
- package/build/index.js +412 -0
- package/build/index.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @silkweave/mcp@1.3.0 build /Users/atomic/projects/ai/silkweave/packages/mcp
|
|
4
|
+
> tsup
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.1
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/atomic/projects/ai/silkweave/packages/mcp/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: es2022
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mbuild/index.js [22m[32m15.31 KB[39m
|
|
14
|
+
[32mESM[39m [1mbuild/index.js.map [22m[32m26.75 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 12ms
|
|
16
|
+
DTS Build start
|
|
17
|
+
DTS ⚡️ Build success in 840ms
|
|
18
|
+
DTS build/index.d.ts 592.00 B
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @silkweave/mcp@1.3.0 check /Users/atomic/projects/ai/silkweave/packages/mcp
|
|
4
|
+
> pnpm lint && pnpm typecheck
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
> @silkweave/mcp@1.3.0 lint /Users/atomic/projects/ai/silkweave/packages/mcp
|
|
8
|
+
> eslint
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
> @silkweave/mcp@1.3.0 typecheck /Users/atomic/projects/ai/silkweave/packages/mcp
|
|
12
|
+
> tsc --noEmit
|
|
13
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @silkweave/mcp@1.3.0 prepack /Users/atomic/projects/ai/mcphero/packages/mcp
|
|
4
|
+
> pnpm clean && pnpm build
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
> @silkweave/mcp@1.3.0 clean /Users/atomic/projects/ai/mcphero/packages/mcp
|
|
8
|
+
> rimraf build
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
> @silkweave/mcp@1.3.0 build /Users/atomic/projects/ai/mcphero/packages/mcp
|
|
12
|
+
> tsup
|
|
13
|
+
|
|
14
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
15
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
16
|
+
[34mCLI[39m tsup v8.5.1
|
|
17
|
+
[34mCLI[39m Using tsup config: /Users/atomic/projects/ai/mcphero/packages/mcp/tsup.config.ts
|
|
18
|
+
[34mCLI[39m Target: es2022
|
|
19
|
+
[34mCLI[39m Cleaning output folder
|
|
20
|
+
[34mESM[39m Build start
|
|
21
|
+
[32mESM[39m [1mbuild/index.js [22m[32m15.31 KB[39m
|
|
22
|
+
[32mESM[39m [1mbuild/index.js.map [22m[32m26.75 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 7ms
|
|
24
|
+
DTS Build start
|
|
25
|
+
DTS ⚡️ Build success in 651ms
|
|
26
|
+
DTS build/index.d.ts 592.00 B
|
package/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# @silkweave/mcp
|
|
2
|
+
|
|
3
|
+
MCP transport adapters for [Silkweave](https://github.com/atomicbi/silkweave) — expose your actions as MCP tools over stdio, Streamable HTTP, or via a CLI proxy client.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @silkweave/core @silkweave/mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Adapters
|
|
12
|
+
|
|
13
|
+
### stdio
|
|
14
|
+
|
|
15
|
+
Standard MCP transport for local tool servers. Communicates over stdin/stdout.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { silkweave } from '@silkweave/core'
|
|
19
|
+
import { stdio } from '@silkweave/mcp'
|
|
20
|
+
|
|
21
|
+
await silkweave({ name: 'my-tools', description: 'My Tools', version: '1.0.0' })
|
|
22
|
+
.adapter(stdio())
|
|
23
|
+
.action(MyAction)
|
|
24
|
+
.start()
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Configure in Claude Desktop or Claude Code:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"my-tools": {
|
|
33
|
+
"command": "node",
|
|
34
|
+
"args": ["server.js"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### http
|
|
41
|
+
|
|
42
|
+
Session-based MCP transport over HTTP with SSE streaming and resumability.
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { silkweave } from '@silkweave/core'
|
|
46
|
+
import { http } from '@silkweave/mcp'
|
|
47
|
+
|
|
48
|
+
await silkweave({ name: 'my-tools', description: 'My Tools', version: '1.0.0' })
|
|
49
|
+
.adapter(http({ host: 'localhost', port: 8080, allowedHosts: ['localhost'] }))
|
|
50
|
+
.action(MyAction)
|
|
51
|
+
.start()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Exposes `POST /mcp` (invoke tools), `GET /mcp` (SSE stream), and `DELETE /mcp` (terminate session). Built on Express with `StreamableHTTPServerTransport` from the MCP SDK.
|
|
55
|
+
|
|
56
|
+
| Option | Type | Description |
|
|
57
|
+
|--------|------|-------------|
|
|
58
|
+
| `host` | `string` | Bind address |
|
|
59
|
+
| `port` | `number` | Listen port |
|
|
60
|
+
| `allowedHosts` | `string[]` | Allowed hosts for DNS rebinding protection |
|
|
61
|
+
|
|
62
|
+
### cliProxy
|
|
63
|
+
|
|
64
|
+
MCP CLI proxy client — connects to a running HTTP MCP server and invokes tools from the command line.
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { silkweave } from '@silkweave/core'
|
|
68
|
+
import { cliProxy } from '@silkweave/mcp'
|
|
69
|
+
|
|
70
|
+
await silkweave({ name: 'my-tools', description: 'My Tools', version: '1.0.0' })
|
|
71
|
+
.adapter(cliProxy({ url: 'http://localhost:8080/mcp' }))
|
|
72
|
+
.start()
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## How Actions Become MCP Tools
|
|
76
|
+
|
|
77
|
+
| Action property | MCP tool property |
|
|
78
|
+
|-----------------|-------------------|
|
|
79
|
+
| `name: 'searchDocs'` | Tool name: `SearchDocs` (PascalCase) |
|
|
80
|
+
| `description` | Tool description |
|
|
81
|
+
| `input` (Zod schema) | `inputSchema` (JSON Schema) |
|
|
82
|
+
| Return value | `TextContent` JSON response |
|
|
83
|
+
| Thrown errors | Structured error response |
|
|
84
|
+
|
|
85
|
+
Logging notifications (`logger.info()`, `logger.progress()`) are sent to the MCP client as `notifications/message` and `notifications/progress`.
|
|
86
|
+
|
|
87
|
+
## See Also
|
|
88
|
+
|
|
89
|
+
- [Silkweave README](https://github.com/atomicbi/silkweave) — Full documentation
|
|
90
|
+
- [`@silkweave/core`](https://www.npmjs.com/package/@silkweave/core) — Core library
|
|
91
|
+
- [`@silkweave/vercel`](https://www.npmjs.com/package/@silkweave/vercel) — Stateless MCP for Vercel
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AdapterFactory } from '@silkweave/core';
|
|
2
|
+
import { CreateMcpExpressAppOptions } from '@modelcontextprotocol/sdk/server/express.js';
|
|
3
|
+
import { AuthConfig } from '@silkweave/auth';
|
|
4
|
+
|
|
5
|
+
interface CliProxyOptions {
|
|
6
|
+
url: URL;
|
|
7
|
+
}
|
|
8
|
+
declare const cliProxy: AdapterFactory<CliProxyOptions>;
|
|
9
|
+
|
|
10
|
+
interface HttpAdapterOptions extends CreateMcpExpressAppOptions {
|
|
11
|
+
host: string;
|
|
12
|
+
port: number;
|
|
13
|
+
auth?: AuthConfig;
|
|
14
|
+
}
|
|
15
|
+
declare const http: AdapterFactory<HttpAdapterOptions>;
|
|
16
|
+
|
|
17
|
+
declare const stdio: AdapterFactory;
|
|
18
|
+
|
|
19
|
+
export { type CliProxyOptions, type HttpAdapterOptions, cliProxy, http, stdio };
|
package/build/index.js
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
// src/adapter/cliProxy.ts
|
|
2
|
+
import { intro } from "@clack/prompts";
|
|
3
|
+
import { Client } from "@modelcontextprotocol/sdk/client";
|
|
4
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
5
|
+
import { LoggingMessageNotificationSchema, ProgressNotificationSchema } from "@modelcontextprotocol/sdk/types";
|
|
6
|
+
import { parseToolResponse, unwrap } from "@silkweave/core";
|
|
7
|
+
import { createCLILogger } from "@silkweave/logger";
|
|
8
|
+
import { kebabCase } from "change-case";
|
|
9
|
+
import { Command } from "commander";
|
|
10
|
+
import { randomUUID } from "crypto";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
var cliProxy = ({ url }) => {
|
|
13
|
+
return (options, baseContext) => {
|
|
14
|
+
const context = baseContext.fork({ adapter: "cliProxy" });
|
|
15
|
+
const program = new Command().name(options.name).description(options.description).version(options.version).option("-s, --silent", "Silent mode, prevent log messages", false);
|
|
16
|
+
return {
|
|
17
|
+
context,
|
|
18
|
+
start: async () => {
|
|
19
|
+
const client = new Client({
|
|
20
|
+
name: options.name,
|
|
21
|
+
description: options.description,
|
|
22
|
+
version: options.version
|
|
23
|
+
});
|
|
24
|
+
const transport = new StreamableHTTPClientTransport(url);
|
|
25
|
+
await client.connect(transport);
|
|
26
|
+
const { tools } = await client.listTools();
|
|
27
|
+
for (const tool of tools) {
|
|
28
|
+
const name = kebabCase(tool.name);
|
|
29
|
+
const command = program.command(name);
|
|
30
|
+
if (tool.description) {
|
|
31
|
+
command.description(tool.description);
|
|
32
|
+
}
|
|
33
|
+
const schema = z.fromJSONSchema(tool.inputSchema);
|
|
34
|
+
if (!(schema instanceof z.ZodObject)) {
|
|
35
|
+
throw new Error("Invalid schema");
|
|
36
|
+
}
|
|
37
|
+
const shape = schema.shape;
|
|
38
|
+
const keys = Object.keys(shape);
|
|
39
|
+
for (const key of keys) {
|
|
40
|
+
const [type, { defaultValue }] = unwrap(shape[key]);
|
|
41
|
+
const description = type.description;
|
|
42
|
+
if (type instanceof z.ZodBoolean) {
|
|
43
|
+
command.option(`--${kebabCase(key)}`, description, defaultValue);
|
|
44
|
+
command.option(`--no-${kebabCase(key)}`);
|
|
45
|
+
} else if (type instanceof z.ZodNumber) {
|
|
46
|
+
command.option(`--${kebabCase(key)} <number>`, description, defaultValue);
|
|
47
|
+
} else if (type instanceof z.ZodString || type instanceof z.ZodEnum) {
|
|
48
|
+
command.option(`--${kebabCase(key)} <string>`, description, defaultValue);
|
|
49
|
+
} else if (type instanceof z.ZodObject || type instanceof z.ZodRecord || type instanceof z.ZodArray) {
|
|
50
|
+
command.option(`--${kebabCase(key)} <json>`, description ?? "", JSON.parse, defaultValue);
|
|
51
|
+
} else {
|
|
52
|
+
throw new Error(`Invalid zod type: ${type.def.type}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
command.action(async (args) => {
|
|
56
|
+
const { silent } = program.opts();
|
|
57
|
+
const logger = createCLILogger();
|
|
58
|
+
if (!silent) {
|
|
59
|
+
intro(`${options.name} - ${tool.name}`);
|
|
60
|
+
client.setNotificationHandler(LoggingMessageNotificationSchema, ({ params: { level, data } }) => {
|
|
61
|
+
logger[level](data);
|
|
62
|
+
});
|
|
63
|
+
client.setNotificationHandler(ProgressNotificationSchema, ({ params: { progress, total, message } }) => {
|
|
64
|
+
logger.info({ progress, total, message });
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const input = await schema.parseAsync(args);
|
|
68
|
+
const response = await client.callTool({
|
|
69
|
+
name: tool.name,
|
|
70
|
+
arguments: input,
|
|
71
|
+
_meta: { progressToken: randomUUID() }
|
|
72
|
+
});
|
|
73
|
+
const result = parseToolResponse(response);
|
|
74
|
+
process.stdout.write(JSON.stringify(result, null, 2));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
await program.parseAsync();
|
|
78
|
+
await transport.close();
|
|
79
|
+
},
|
|
80
|
+
stop: async () => {
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// src/adapter/http.ts
|
|
87
|
+
import { InMemoryEventStore } from "@modelcontextprotocol/sdk/examples/shared/inMemoryEventStore.js";
|
|
88
|
+
import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js";
|
|
89
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
90
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
91
|
+
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
92
|
+
import { generateProtectedResourceMetadata, validateToken } from "@silkweave/auth";
|
|
93
|
+
import { toolResponse } from "@silkweave/core";
|
|
94
|
+
import { createLogger } from "@silkweave/logger";
|
|
95
|
+
import { capitalCase, pascalCase } from "change-case";
|
|
96
|
+
import cors from "cors";
|
|
97
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
98
|
+
import express from "express";
|
|
99
|
+
import { readFile } from "fs/promises";
|
|
100
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
101
|
+
var authStorage = new AsyncLocalStorage();
|
|
102
|
+
function mountOAuthRoutes(app, auth) {
|
|
103
|
+
const provider = auth.provider;
|
|
104
|
+
const callbackPath = auth.callbackPath ?? "/auth/callback";
|
|
105
|
+
const toOAuthReq = (req) => ({
|
|
106
|
+
method: req.method,
|
|
107
|
+
url: new URL(req.url, `${req.protocol}://${req.get("host")}`),
|
|
108
|
+
headers: Object.fromEntries(Object.entries(req.headers).map(([k, v]) => [k, Array.isArray(v) ? v[0] : v])),
|
|
109
|
+
body: req.body
|
|
110
|
+
});
|
|
111
|
+
const sendOAuth = (res, oauthRes) => {
|
|
112
|
+
for (const [key, value] of Object.entries(oauthRes.headers)) {
|
|
113
|
+
res.header(key, value);
|
|
114
|
+
}
|
|
115
|
+
if (oauthRes.body) {
|
|
116
|
+
res.status(oauthRes.status).send(typeof oauthRes.body === "string" ? oauthRes.body : JSON.stringify(oauthRes.body));
|
|
117
|
+
} else {
|
|
118
|
+
res.status(oauthRes.status).end();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
app.get("/.well-known/oauth-authorization-server", (_req, res) => {
|
|
122
|
+
sendOAuth(res, provider.metadata());
|
|
123
|
+
});
|
|
124
|
+
app.get("/authorize", async (req, res) => {
|
|
125
|
+
sendOAuth(res, await provider.authorize(toOAuthReq(req)));
|
|
126
|
+
});
|
|
127
|
+
app.get(callbackPath, async (req, res) => {
|
|
128
|
+
sendOAuth(res, await provider.callback(toOAuthReq(req)));
|
|
129
|
+
});
|
|
130
|
+
app.post("/token", express.urlencoded({ extended: false }), async (req, res) => {
|
|
131
|
+
sendOAuth(res, await provider.token(toOAuthReq(req)));
|
|
132
|
+
});
|
|
133
|
+
app.post("/register", express.json(), async (req, res) => {
|
|
134
|
+
sendOAuth(res, await provider.register(toOAuthReq(req)));
|
|
135
|
+
});
|
|
136
|
+
return /* @__PURE__ */ new Set(["/.well-known/oauth-authorization-server", "/authorize", callbackPath, "/token", "/register"]);
|
|
137
|
+
}
|
|
138
|
+
function mountAuthMiddleware(app, auth, oauthPaths) {
|
|
139
|
+
app.use(async (req, res, next) => {
|
|
140
|
+
if (req.path.startsWith("/.well-known/") || oauthPaths.has(req.path)) {
|
|
141
|
+
return next();
|
|
142
|
+
}
|
|
143
|
+
const result = await validateToken(req.headers.authorization, auth);
|
|
144
|
+
if (result.error) {
|
|
145
|
+
for (const [key, value] of Object.entries(result.error.headers)) {
|
|
146
|
+
res.header(key, value);
|
|
147
|
+
}
|
|
148
|
+
res.status(result.error.statusCode).json(result.error.body);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (result.auth) {
|
|
152
|
+
authStorage.run(result.auth, () => {
|
|
153
|
+
next();
|
|
154
|
+
});
|
|
155
|
+
} else {
|
|
156
|
+
next();
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function createMcpServer(options, actions, context) {
|
|
161
|
+
const server = new McpServer({
|
|
162
|
+
name: options.name,
|
|
163
|
+
description: options.description,
|
|
164
|
+
version: options.version
|
|
165
|
+
}, {
|
|
166
|
+
capabilities: { tools: {}, logging: {} }
|
|
167
|
+
});
|
|
168
|
+
for (const action of actions) {
|
|
169
|
+
server.registerTool(pascalCase(action.name), {
|
|
170
|
+
title: capitalCase(action.name),
|
|
171
|
+
description: action.description,
|
|
172
|
+
inputSchema: action.input
|
|
173
|
+
}, async (input, extra) => {
|
|
174
|
+
const logger = createLogger({
|
|
175
|
+
stream: process.stderr,
|
|
176
|
+
onLog: (level, data) => {
|
|
177
|
+
extra.sendNotification({ method: "notifications/message", params: { level, data } });
|
|
178
|
+
},
|
|
179
|
+
onProgress: ({ progress, total, message }) => {
|
|
180
|
+
if (!extra._meta?.progressToken) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
extra.sendNotification({
|
|
184
|
+
method: "notifications/progress",
|
|
185
|
+
params: {
|
|
186
|
+
progress,
|
|
187
|
+
total,
|
|
188
|
+
message,
|
|
189
|
+
progressToken: extra._meta.progressToken
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
const currentAuth = authStorage.getStore();
|
|
195
|
+
return action.run(input, context.fork({ logger, extra, ...currentAuth ? { auth: currentAuth } : {} })).then((result) => {
|
|
196
|
+
return toolResponse(result);
|
|
197
|
+
}).catch((error) => {
|
|
198
|
+
if (error instanceof Error) {
|
|
199
|
+
return toolResponse({ success: false, name: error.name, message: error.message, stack: error.stack });
|
|
200
|
+
} else {
|
|
201
|
+
return toolResponse({ success: false, name: "Unknown Error", message: "An unknown error occured", error });
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return server;
|
|
207
|
+
}
|
|
208
|
+
function mountMcpTransport(app, transports, createServer) {
|
|
209
|
+
app.post("/mcp", async (req, res) => {
|
|
210
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
211
|
+
try {
|
|
212
|
+
let transport;
|
|
213
|
+
if (sessionId && transports[sessionId]) {
|
|
214
|
+
transport = transports[sessionId];
|
|
215
|
+
} else if (isInitializeRequest(req.body)) {
|
|
216
|
+
const eventStore = new InMemoryEventStore();
|
|
217
|
+
transport = new StreamableHTTPServerTransport({
|
|
218
|
+
sessionIdGenerator: () => randomUUID2(),
|
|
219
|
+
enableJsonResponse: false,
|
|
220
|
+
eventStore,
|
|
221
|
+
onsessioninitialized: (sId) => {
|
|
222
|
+
console.log(`Session initialized with ID: ${sId}`);
|
|
223
|
+
transports[sId] = transport;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
transport.onerror = (error) => {
|
|
227
|
+
console.error(error);
|
|
228
|
+
};
|
|
229
|
+
transport.onclose = () => {
|
|
230
|
+
const sid = transport.sessionId;
|
|
231
|
+
if (sid && transports[sid]) {
|
|
232
|
+
console.log(`Transport closed for session ${sid}, removing from transports map`);
|
|
233
|
+
delete transports[sid];
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
await createServer().connect(transport);
|
|
237
|
+
await transport.handleRequest(req, res, req.body);
|
|
238
|
+
return;
|
|
239
|
+
} else {
|
|
240
|
+
res.status(404).json({
|
|
241
|
+
jsonrpc: "2.0",
|
|
242
|
+
error: { code: -32e3, message: "Session not found" },
|
|
243
|
+
id: null
|
|
244
|
+
});
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
await transport.handleRequest(req, res, req.body);
|
|
248
|
+
} catch (error) {
|
|
249
|
+
console.error("Error handling MCP request:", error);
|
|
250
|
+
if (!res.headersSent) {
|
|
251
|
+
res.status(500).json({
|
|
252
|
+
jsonrpc: "2.0",
|
|
253
|
+
error: { code: -32603, message: "Internal server error" },
|
|
254
|
+
id: null
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const handleSessionStream = async (req, res) => {
|
|
260
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
261
|
+
if (!sessionId || !transports[sessionId]) {
|
|
262
|
+
res.status(400).send("Invalid or missing session ID");
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const transport = transports[sessionId];
|
|
266
|
+
await transport.handleRequest(req, res);
|
|
267
|
+
};
|
|
268
|
+
app.get("/mcp", handleSessionStream);
|
|
269
|
+
app.delete("/mcp", handleSessionStream);
|
|
270
|
+
app.get("/mcp/resource/:id", handleSessionStream);
|
|
271
|
+
}
|
|
272
|
+
var http = ({ host, port, auth, ...mcpOptions }) => {
|
|
273
|
+
return (options, baseContext) => {
|
|
274
|
+
const context = baseContext.fork({ adapter: "http" });
|
|
275
|
+
const app = createMcpExpressApp({ ...mcpOptions, host });
|
|
276
|
+
app.use(cors({ exposedHeaders: ["WWW-Authenticate", "Mcp-Session-Id", "Last-Event-Id", "Mcp-Protocol-Version"], origin: "*" }));
|
|
277
|
+
if (auth?.authorizationServers?.length && auth.resourceUrl) {
|
|
278
|
+
app.get("/.well-known/oauth-protected-resource", (_req, res) => {
|
|
279
|
+
const metadata = generateProtectedResourceMetadata(auth.resourceUrl, auth.authorizationServers);
|
|
280
|
+
res.json(metadata);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
const oauthPaths = auth?.provider ? mountOAuthRoutes(app, auth) : /* @__PURE__ */ new Set();
|
|
284
|
+
if (auth) {
|
|
285
|
+
mountAuthMiddleware(app, auth, oauthPaths);
|
|
286
|
+
}
|
|
287
|
+
const transports = {};
|
|
288
|
+
let mountedActions = [];
|
|
289
|
+
app.get("/resource/:id", async (req, res) => {
|
|
290
|
+
const id = req.params.id;
|
|
291
|
+
if (!id || typeof id !== "string") {
|
|
292
|
+
throw new Error("Invalid ID");
|
|
293
|
+
}
|
|
294
|
+
const resourceMeta = JSON.parse(await readFile(`resources/${id}.json`, "utf-8"));
|
|
295
|
+
const buffer = await readFile(`resources/${id}`);
|
|
296
|
+
res.status(200);
|
|
297
|
+
res.header("Content-Type", resourceMeta.contentType);
|
|
298
|
+
res.send(buffer);
|
|
299
|
+
});
|
|
300
|
+
mountMcpTransport(app, transports, () => createMcpServer(options, mountedActions, context));
|
|
301
|
+
let httpServer;
|
|
302
|
+
return {
|
|
303
|
+
context,
|
|
304
|
+
start: async (actions) => {
|
|
305
|
+
mountedActions = actions;
|
|
306
|
+
httpServer = app.listen(port, host, (error) => {
|
|
307
|
+
if (error) {
|
|
308
|
+
console.error("Failed to start server:", error);
|
|
309
|
+
process.exit(1);
|
|
310
|
+
}
|
|
311
|
+
console.log(`MCP Streamable HTTP Server listening on http://${host}:${port}/mcp`);
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
stop: async () => {
|
|
315
|
+
if (httpServer) {
|
|
316
|
+
await new Promise((resolve, reject) => {
|
|
317
|
+
return httpServer.close((err) => {
|
|
318
|
+
if (err) {
|
|
319
|
+
reject(err);
|
|
320
|
+
} else {
|
|
321
|
+
resolve();
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
httpServer = void 0;
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// src/adapter/stdio.ts
|
|
333
|
+
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
334
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
335
|
+
import { toolResponse as toolResponse2 } from "@silkweave/core";
|
|
336
|
+
import { createLogger as createLogger2 } from "@silkweave/logger";
|
|
337
|
+
import { capitalCase as capitalCase2, pascalCase as pascalCase2 } from "change-case";
|
|
338
|
+
var stdio = () => {
|
|
339
|
+
return (options, baseContext) => {
|
|
340
|
+
const context = baseContext.fork({ adapter: "stdio" });
|
|
341
|
+
const server = new McpServer2({
|
|
342
|
+
name: options.name,
|
|
343
|
+
description: options.description,
|
|
344
|
+
version: options.version
|
|
345
|
+
}, {
|
|
346
|
+
capabilities: { tools: {}, logging: {} }
|
|
347
|
+
});
|
|
348
|
+
return {
|
|
349
|
+
context,
|
|
350
|
+
start: async (actions) => {
|
|
351
|
+
for (const action of actions) {
|
|
352
|
+
server.registerTool(pascalCase2(action.name), {
|
|
353
|
+
title: capitalCase2(action.name),
|
|
354
|
+
description: action.description,
|
|
355
|
+
inputSchema: action.input
|
|
356
|
+
}, async (input, extra) => {
|
|
357
|
+
const logger = createLogger2({
|
|
358
|
+
stream: false,
|
|
359
|
+
onLog: (level, data) => {
|
|
360
|
+
extra.sendNotification({ method: "notifications/message", params: { level, data } });
|
|
361
|
+
},
|
|
362
|
+
onProgress: ({ progress, total, message }) => {
|
|
363
|
+
if (!extra._meta?.progressToken) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
extra.sendNotification({
|
|
367
|
+
method: "notifications/progress",
|
|
368
|
+
params: {
|
|
369
|
+
progress,
|
|
370
|
+
total,
|
|
371
|
+
message,
|
|
372
|
+
progressToken: extra._meta.progressToken
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
return action.run(input, context.fork({ logger, extra })).then((result) => {
|
|
378
|
+
return toolResponse2(result);
|
|
379
|
+
}).catch((error) => {
|
|
380
|
+
if (error instanceof Error) {
|
|
381
|
+
return toolResponse2({
|
|
382
|
+
success: false,
|
|
383
|
+
name: error.name,
|
|
384
|
+
message: error.message,
|
|
385
|
+
stack: error.stack
|
|
386
|
+
});
|
|
387
|
+
} else {
|
|
388
|
+
return toolResponse2({
|
|
389
|
+
success: false,
|
|
390
|
+
name: "Unknown Error",
|
|
391
|
+
message: "An unknown error occured",
|
|
392
|
+
error
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
const transport = new StdioServerTransport();
|
|
399
|
+
await server.connect(transport);
|
|
400
|
+
},
|
|
401
|
+
stop: async () => {
|
|
402
|
+
await server?.close();
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
export {
|
|
408
|
+
cliProxy,
|
|
409
|
+
http,
|
|
410
|
+
stdio
|
|
411
|
+
};
|
|
412
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapter/cliProxy.ts","../src/adapter/http.ts","../src/adapter/stdio.ts"],"sourcesContent":["import { intro } from '@clack/prompts'\nimport { Client } from '@modelcontextprotocol/sdk/client'\nimport { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'\nimport { LoggingMessageNotificationSchema, ProgressNotificationSchema } from '@modelcontextprotocol/sdk/types'\nimport { AdapterFactory, parseToolResponse, ToolResponse, unwrap } from '@silkweave/core'\nimport { createCLILogger } from '@silkweave/logger'\nimport { kebabCase } from 'change-case'\nimport { Command } from 'commander'\nimport { randomUUID } from 'crypto'\nimport { z } from 'zod'\nimport { JSONSchema } from 'zod/v4/core'\n\nexport interface CliProxyOptions {\n url: URL\n}\n\nexport const cliProxy: AdapterFactory<CliProxyOptions> = ({ url }) => {\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'cliProxy' })\n const program = new Command()\n .name(options.name)\n .description(options.description)\n .version(options.version)\n .option('-s, --silent', 'Silent mode, prevent log messages', false)\n\n return {\n context,\n start: async () => {\n const client = new Client({\n name: options.name,\n description: options.description,\n version: options.version\n })\n const transport = new StreamableHTTPClientTransport(url)\n await client.connect(transport)\n const { tools } = await client.listTools()\n for (const tool of tools) {\n const name = kebabCase(tool.name)\n const command = program.command(name)\n if (tool.description) { command.description(tool.description) }\n const schema = z.fromJSONSchema(tool.inputSchema as JSONSchema.JSONSchema)\n if (!(schema instanceof z.ZodObject)) { throw new Error('Invalid schema') }\n const shape = schema.shape\n const keys = Object.keys(shape)\n for (const key of keys) {\n const [type, { defaultValue }] = unwrap(shape[key])\n const description = type.description\n if (type instanceof z.ZodBoolean) {\n command.option(`--${kebabCase(key)}`, description, defaultValue)\n command.option(`--no-${kebabCase(key)}`)\n } else if (type instanceof z.ZodNumber) {\n command.option(`--${kebabCase(key)} <number>`, description, defaultValue)\n } else if (type instanceof z.ZodString || type instanceof z.ZodEnum) {\n command.option(`--${kebabCase(key)} <string>`, description, defaultValue)\n } else if (type instanceof z.ZodObject || type instanceof z.ZodRecord || type instanceof z.ZodArray) {\n command.option(`--${kebabCase(key)} <json>`, description ?? '', JSON.parse, defaultValue)\n } else {\n throw new Error(`Invalid zod type: ${type.def.type}`)\n }\n }\n command.action(async (args) => {\n const { silent } = program.opts<{ silent: boolean }>()\n const logger = createCLILogger()\n if (!silent) {\n intro(`${options.name} - ${tool.name}`)\n client.setNotificationHandler(LoggingMessageNotificationSchema, ({ params: { level, data } }) => {\n logger[level](data)\n })\n client.setNotificationHandler(ProgressNotificationSchema, ({ params: { progress, total, message } }) => {\n logger.info({ progress, total, message })\n })\n }\n const input = await schema.parseAsync(args)\n const response = await client.callTool({\n name: tool.name,\n arguments: input,\n _meta: { progressToken: randomUUID() }\n })\n const result = parseToolResponse(response as ToolResponse)\n process.stdout.write(JSON.stringify(result, null, 2))\n })\n }\n await program.parseAsync()\n await transport.close()\n },\n stop: async () => { }\n }\n }\n}\n","import { InMemoryEventStore } from '@modelcontextprotocol/sdk/examples/shared/inMemoryEventStore.js'\nimport { createMcpExpressApp, CreateMcpExpressAppOptions } from '@modelcontextprotocol/sdk/server/express.js'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'\nimport { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js'\nimport { AuthConfig, AuthInfo, generateProtectedResourceMetadata, OAuthRequest, OAuthResponse, validateToken } from '@silkweave/auth'\nimport { Action, AdapterFactory, SideloadResource, SilkweaveContext, SilkweaveOptions, toolResponse } from '@silkweave/core'\nimport { createLogger } from '@silkweave/logger'\nimport { capitalCase, pascalCase } from 'change-case'\nimport cors from 'cors'\nimport { randomUUID } from 'crypto'\nimport express, { Express, Request, Response } from 'express'\nimport { readFile } from 'fs/promises'\nimport { Server } from 'http'\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nconst authStorage = new AsyncLocalStorage<AuthInfo>()\n\nexport interface HttpAdapterOptions extends CreateMcpExpressAppOptions {\n host: string\n port: number\n auth?: AuthConfig\n}\n\nfunction mountOAuthRoutes(app: Express, auth: AuthConfig): Set<string> {\n const provider = auth.provider!\n const callbackPath = auth.callbackPath ?? '/auth/callback'\n\n const toOAuthReq = (req: Request): OAuthRequest => ({\n method: req.method,\n url: new URL(req.url, `${req.protocol}://${req.get('host')}`),\n headers: Object.fromEntries(Object.entries(req.headers).map(([k, v]) => [k, Array.isArray(v) ? v[0] : v])),\n body: req.body as Record<string, string> | undefined\n })\n\n const sendOAuth = (res: Response, oauthRes: OAuthResponse) => {\n for (const [key, value] of Object.entries(oauthRes.headers)) { res.header(key, value) }\n if (oauthRes.body) {\n res.status(oauthRes.status).send(typeof oauthRes.body === 'string' ? oauthRes.body : JSON.stringify(oauthRes.body))\n } else {\n res.status(oauthRes.status).end()\n }\n }\n\n app.get('/.well-known/oauth-authorization-server', (_req: Request, res: Response) => {\n sendOAuth(res, provider.metadata())\n })\n app.get('/authorize', async (req: Request, res: Response) => {\n sendOAuth(res, await provider.authorize(toOAuthReq(req)))\n })\n app.get(callbackPath, async (req: Request, res: Response) => {\n sendOAuth(res, await provider.callback(toOAuthReq(req)))\n })\n app.post('/token', express.urlencoded({ extended: false }), async (req: Request, res: Response) => {\n sendOAuth(res, await provider.token(toOAuthReq(req)))\n })\n app.post('/register', express.json(), async (req: Request, res: Response) => {\n sendOAuth(res, await provider.register(toOAuthReq(req)))\n })\n\n return new Set(['/.well-known/oauth-authorization-server', '/authorize', callbackPath, '/token', '/register'])\n}\n\nfunction mountAuthMiddleware(app: Express, auth: AuthConfig, oauthPaths: Set<string>) {\n app.use(async (req: Request, res: Response, next: (err?: unknown) => void) => {\n if (req.path.startsWith('/.well-known/') || oauthPaths.has(req.path)) { return next() }\n const result = await validateToken(req.headers.authorization, auth)\n if (result.error) {\n for (const [key, value] of Object.entries(result.error.headers)) {\n res.header(key, value)\n }\n res.status(result.error.statusCode).json(result.error.body)\n return\n }\n if (result.auth) {\n authStorage.run(result.auth, () => { next() })\n } else {\n next()\n }\n })\n}\n\nfunction createMcpServer(options: SilkweaveOptions, actions: Action[], context: SilkweaveContext): McpServer {\n const server = new McpServer({\n name: options.name,\n description: options.description,\n version: options.version\n }, {\n capabilities: { tools: {}, logging: {} }\n })\n\n for (const action of actions) {\n server.registerTool(pascalCase(action.name), {\n title: capitalCase(action.name),\n description: action.description,\n inputSchema: action.input\n }, async (input, extra) => {\n const logger = createLogger({\n stream: process.stderr,\n onLog: (level, data) => {\n extra.sendNotification({ method: 'notifications/message', params: { level, data } })\n },\n onProgress: ({ progress, total, message }) => {\n if (!extra._meta?.progressToken) { return }\n extra.sendNotification({\n method: 'notifications/progress',\n params: {\n progress,\n total,\n message,\n progressToken: extra._meta.progressToken\n }\n })\n }\n })\n const currentAuth = authStorage.getStore()\n return action.run(input, context.fork({ logger, extra, ...(currentAuth ? { auth: currentAuth } : {}) })).then((result) => {\n return toolResponse(result)\n }).catch((error) => {\n if (error instanceof Error) {\n return toolResponse({ success: false, name: error.name, message: error.message, stack: error.stack })\n } else {\n return toolResponse({ success: false, name: 'Unknown Error', message: 'An unknown error occured', error })\n }\n })\n })\n }\n\n return server\n}\n\nfunction mountMcpTransport(\n app: Express,\n transports: Record<string, StreamableHTTPServerTransport>,\n createServer: () => McpServer\n) {\n app.post('/mcp', async (req: Request, res: Response) => {\n const sessionId = req.headers['mcp-session-id'] as string | undefined\n try {\n let transport: StreamableHTTPServerTransport\n if (sessionId && transports[sessionId]) {\n transport = transports[sessionId]\n } else if (isInitializeRequest(req.body)) {\n const eventStore = new InMemoryEventStore()\n transport = new StreamableHTTPServerTransport({\n sessionIdGenerator: () => randomUUID(),\n enableJsonResponse: false,\n eventStore,\n onsessioninitialized: (sId) => {\n console.log(`Session initialized with ID: ${sId}`)\n transports[sId] = transport\n }\n })\n transport.onerror = (error) => {\n console.error(error)\n }\n transport.onclose = () => {\n const sid = transport.sessionId\n if (sid && transports[sid]) {\n console.log(`Transport closed for session ${sid}, removing from transports map`)\n delete transports[sid]\n }\n }\n await createServer().connect(transport)\n await transport.handleRequest(req, res, req.body)\n return\n } else {\n res.status(404).json({\n jsonrpc: '2.0',\n error: { code: -32_000, message: 'Session not found' },\n id: null\n })\n return\n }\n await transport.handleRequest(req, res, req.body)\n } catch (error) {\n console.error('Error handling MCP request:', error)\n if (!res.headersSent) {\n res.status(500).json({\n jsonrpc: '2.0',\n error: { code: -32_603, message: 'Internal server error' },\n id: null\n })\n }\n }\n })\n\n const handleSessionStream = async (req: Request, res: Response) => {\n const sessionId = req.headers['mcp-session-id'] as string | undefined\n if (!sessionId || !transports[sessionId]) {\n res.status(400).send('Invalid or missing session ID')\n return\n }\n const transport = transports[sessionId]\n await transport.handleRequest(req, res)\n }\n\n app.get('/mcp', handleSessionStream)\n app.delete('/mcp', handleSessionStream)\n app.get('/mcp/resource/:id', handleSessionStream)\n}\n\nexport const http: AdapterFactory<HttpAdapterOptions> = ({ host, port, auth, ...mcpOptions }) => {\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'http' })\n const app = createMcpExpressApp({ ...mcpOptions, host })\n app.use(cors({ exposedHeaders: ['WWW-Authenticate', 'Mcp-Session-Id', 'Last-Event-Id', 'Mcp-Protocol-Version'], origin: '*' }))\n\n if (auth?.authorizationServers?.length && auth.resourceUrl) {\n app.get('/.well-known/oauth-protected-resource', (_req: Request, res: Response) => {\n const metadata = generateProtectedResourceMetadata(auth.resourceUrl!, auth.authorizationServers!)\n res.json(metadata)\n })\n }\n\n const oauthPaths = auth?.provider ? mountOAuthRoutes(app, auth) : new Set<string>()\n\n if (auth) {\n mountAuthMiddleware(app, auth, oauthPaths)\n }\n\n const transports: Record<string, StreamableHTTPServerTransport> = {}\n let mountedActions: Action[] = []\n\n app.get('/resource/:id', async (req: Request, res: Response) => {\n const id = req.params.id\n if (!id || typeof id !== 'string') { throw new Error('Invalid ID') }\n const resourceMeta: SideloadResource = JSON.parse(await readFile(`resources/${id}.json`, 'utf-8'))\n const buffer = await readFile(`resources/${id}`)\n res.status(200)\n res.header('Content-Type', resourceMeta.contentType)\n res.send(buffer)\n })\n\n mountMcpTransport(app, transports, () => createMcpServer(options, mountedActions, context))\n\n let httpServer: Server | undefined\n return {\n context,\n start: async (actions) => {\n mountedActions = actions\n httpServer = app.listen(port, host, (error) => {\n if (error) {\n console.error('Failed to start server:', error)\n process.exit(1)\n }\n console.log(`MCP Streamable HTTP Server listening on http://${host}:${port}/mcp`)\n })\n },\n stop: async () => {\n if (httpServer) {\n await new Promise<void>((resolve, reject) => {\n return httpServer!.close((err) => {\n if (err) {\n reject(err)\n } else {\n resolve()\n }\n })\n })\n }\n httpServer = undefined\n }\n }\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { AdapterFactory, toolResponse } from '@silkweave/core'\nimport { createLogger } from '@silkweave/logger'\nimport { capitalCase, pascalCase } from 'change-case'\n\nexport const stdio: AdapterFactory = () => {\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'stdio' })\n const server = new McpServer({\n name: options.name,\n description: options.description,\n version: options.version\n }, {\n capabilities: { tools: {}, logging: {} }\n })\n return {\n context,\n start: async (actions) => {\n for (const action of actions) {\n server.registerTool(pascalCase(action.name), {\n title: capitalCase(action.name),\n description: action.description,\n inputSchema: action.input\n }, async (input, extra) => {\n const logger = createLogger({\n stream: false,\n onLog: (level, data) => {\n extra.sendNotification({ method: 'notifications/message', params: { level, data } })\n },\n onProgress: ({ progress, total, message }) => {\n if (!extra._meta?.progressToken) { return }\n extra.sendNotification({\n method: 'notifications/progress',\n params: {\n progress,\n total,\n message,\n progressToken: extra._meta.progressToken\n }\n })\n }\n })\n return action.run(input, context.fork({ logger, extra })).then((result) => {\n return toolResponse(result)\n }).catch((error) => {\n if (error instanceof Error) {\n return toolResponse({\n success: false,\n name: error.name,\n message: error.message,\n stack: error.stack\n })\n } else {\n return toolResponse({\n success: false,\n name: 'Unknown Error',\n message: 'An unknown error occured',\n error\n })\n }\n })\n })\n }\n const transport = new StdioServerTransport()\n await server.connect(transport)\n },\n stop: async () => {\n await server?.close()\n }\n }\n }\n}\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,qCAAqC;AAC9C,SAAS,kCAAkC,kCAAkC;AAC7E,SAAyB,mBAAiC,cAAc;AACxE,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,SAAS;AAOX,IAAM,WAA4C,CAAC,EAAE,IAAI,MAAM;AACpE,SAAO,CAAC,SAAS,gBAAgB;AAC/B,UAAM,UAAU,YAAY,KAAK,EAAE,SAAS,WAAW,CAAC;AACxD,UAAM,UAAU,IAAI,QAAQ,EACzB,KAAK,QAAQ,IAAI,EACjB,YAAY,QAAQ,WAAW,EAC/B,QAAQ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OD,cAAa,MAAM;AAAA,YAC5B,CAAC,EAAE,MAAM,CAAC,UAAU;AAClB,kBAAI,iBAAiB,OAAO;AAC1B,uBAAOA,cAAa;AAAA,kBAClB,SAAS;AAAA,kBACT,MAAM,MAAM;AAAA,kBACZ,SAAS,MAAM;AAAA,kBACf,OAAO,MAAM;AAAA,gBACf,CAAC;AAAA,cACH,OAAO;AACL,uBAAOA,cAAa;AAAA,kBAClB,SAAS;AAAA,kBACT,MAAM;AAAA,kBACN,SAAS;AAAA,kBACT;AAAA,gBACF,CAAC;AAAA,cACH;AAAA,YACF,CAAC;AAAA,UACH,CAAC;AAAA,QACH;AACA,cAAM,YAAY,IAAI,qBAAqB;AAC3C,cAAM,OAAO,QAAQ,SAAS;AAAA,MAChC;AAAA,MACA,MAAM,YAAY;AAChB,cAAM,QAAQ,MAAM;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF;","names":["randomUUID","McpServer","toolResponse","createLogger","capitalCase","pascalCase"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@silkweave/mcp",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Silkweave MCP Package",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+ssh://git@github.com/atomicbi/silkweave.git",
|
|
8
|
+
"directory": "packages/mcp"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "build/index.js",
|
|
12
|
+
"types": "build/index.d.ts",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@clack/prompts": "^1.0.1",
|
|
15
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
16
|
+
"change-case": "^5.4.4",
|
|
17
|
+
"commander": "^13.1.0",
|
|
18
|
+
"cors": "^2.8.6",
|
|
19
|
+
"express": "^5.2.1",
|
|
20
|
+
"zod": "^4.3.6",
|
|
21
|
+
"@silkweave/auth": "1.3.0",
|
|
22
|
+
"@silkweave/core": "1.3.0",
|
|
23
|
+
"@silkweave/logger": "1.3.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^10.0.1",
|
|
27
|
+
"@modelcontextprotocol/inspector": "^0.21.1",
|
|
28
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
29
|
+
"@types/cors": "^2.8.19",
|
|
30
|
+
"@types/express": "^5.0.6",
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"rimraf": "^6.1.3",
|
|
33
|
+
"tsup": "^8.5.1",
|
|
34
|
+
"tsx": "^4.21.0",
|
|
35
|
+
"typescript": "^5.9.3",
|
|
36
|
+
"typescript-eslint": "^8.56.1"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"clean": "rimraf build",
|
|
40
|
+
"build": "tsup",
|
|
41
|
+
"watch": "tsup --watch",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"lint": "eslint",
|
|
44
|
+
"check": "pnpm lint && pnpm typecheck"
|
|
45
|
+
}
|
|
46
|
+
}
|