@j0hanz/superfetch 2.4.11 → 2.4.12
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/README.md +0 -4
- package/dist/mcp.js +1 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -263,10 +263,6 @@ Large content handling:
|
|
|
263
263
|
| `internal://instructions` | Server usage instructions. | `text/markdown` |
|
|
264
264
|
| `internal://config` | Current runtime config (secrets redacted). | `application/json` |
|
|
265
265
|
|
|
266
|
-
### Prompts
|
|
267
|
-
|
|
268
|
-
- `summarize-webpage` (registered when `fetch-url` is enabled)
|
|
269
|
-
|
|
270
266
|
### Tasks
|
|
271
267
|
|
|
272
268
|
`fetch-url` supports async execution via MCP tasks. Call `tools/call` with a
|
package/dist/mcp.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { completable } from '@modelcontextprotocol/sdk/server/completable.js';
|
|
4
3
|
import { McpServer, ResourceTemplate, } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
6
5
|
import { CallToolRequestSchema, ErrorCode, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
-
import {
|
|
6
|
+
import { registerCachedContentResource } from './cache.js';
|
|
8
7
|
import { config } from './config.js';
|
|
9
8
|
import { destroyAgents } from './fetch.js';
|
|
10
9
|
import { logError, logInfo, setMcpServer } from './observability.js';
|
|
@@ -41,7 +40,6 @@ function createServerCapabilities() {
|
|
|
41
40
|
return {
|
|
42
41
|
tools: { listChanged: false },
|
|
43
42
|
resources: { listChanged: false, subscribe: false },
|
|
44
|
-
prompts: { listChanged: false },
|
|
45
43
|
logging: {},
|
|
46
44
|
tasks: {
|
|
47
45
|
list: {},
|
|
@@ -392,27 +390,6 @@ function registerTaskHandlers(server) {
|
|
|
392
390
|
});
|
|
393
391
|
});
|
|
394
392
|
}
|
|
395
|
-
function registerPrompts(server) {
|
|
396
|
-
if (config.tools.enabled.includes(FETCH_URL_TOOL_NAME)) {
|
|
397
|
-
server.registerPrompt('summarize-webpage', {
|
|
398
|
-
title: 'Summarize Webpage',
|
|
399
|
-
description: 'Summarize the content of a webpage given its URL.',
|
|
400
|
-
argsSchema: {
|
|
401
|
-
url: completable(z.string().describe('The URL to summarize'), () => getRecentCachedUrls().map((entry) => entry.url)),
|
|
402
|
-
},
|
|
403
|
-
}, (args) => ({
|
|
404
|
-
messages: [
|
|
405
|
-
{
|
|
406
|
-
role: 'user',
|
|
407
|
-
content: {
|
|
408
|
-
type: 'text',
|
|
409
|
-
text: `Please summarize the content of the webpage at the following URL: ${args.url}`,
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
],
|
|
413
|
-
}));
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
393
|
export async function createMcpServer() {
|
|
417
394
|
const instructions = await createServerInstructions(config.server.version);
|
|
418
395
|
const serverInfo = await createServerInfo();
|
|
@@ -427,7 +404,6 @@ export async function createMcpServer() {
|
|
|
427
404
|
registerInstructionsResource(server, instructions);
|
|
428
405
|
registerConfigResource(server);
|
|
429
406
|
registerTaskHandlers(server);
|
|
430
|
-
registerPrompts(server);
|
|
431
407
|
return server;
|
|
432
408
|
}
|
|
433
409
|
function attachServerErrorHandler(server) {
|
package/package.json
CHANGED