mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-02-19 11:54:58 -05:00
[WIP] Refactor everything server to be more modular and use recommended APIs.
[WIP] Adding Gzip File as Resource tool * Updated architecture.md * In resources/files.ts - remove 'Docs: ' from resource name * In resources/templates.ts - use blob instead of text in resource content
This commit is contained in:
@@ -105,7 +105,7 @@ At `src/everything`:
|
||||
- get-resource-reference.ts
|
||||
- Registers a `get-resource-reference` tool that returns a reference for a selected dynamic resource.
|
||||
- get-sampling-request.ts
|
||||
- Registers a `sampling-request` tool that sends a `sampling/createMessage` request to the client/LLM and returns the sampling result.
|
||||
- Registers a `sampling-request` tool that sends a `sampling/createMessage` request to the client/LLM and returns the sampling result.
|
||||
- get-structured-content.ts
|
||||
- Registers a `get-structured-content` tool that demonstrates structuredContent block responses.
|
||||
- get-sum.ts
|
||||
|
||||
@@ -40,12 +40,11 @@ export const registerFileResources = (server: McpServer) => {
|
||||
// Prepare file resource info
|
||||
const uri = `demo://resource/static/document/${encodeURIComponent(name)}`;
|
||||
const mimeType = getMimeType(name);
|
||||
const displayName = `Docs: ${name}`;
|
||||
const description = `Static document file exposed from /docs: ${name}`;
|
||||
|
||||
// Register file resource
|
||||
server.registerResource(
|
||||
displayName,
|
||||
name,
|
||||
uri,
|
||||
{ mimeType, description },
|
||||
async (uri) => {
|
||||
|
||||
@@ -106,7 +106,7 @@ export const blobResource = (uri: URL, resourceId: number) => {
|
||||
return {
|
||||
uri: uri.toString(),
|
||||
mimeType: "text/plain",
|
||||
text: resourceText,
|
||||
blob: resourceText,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user