MCPcopy Create free account
hub / github.com/deepnote/deepnote / listResources

Function listResources

packages/mcp/src/resources.ts:73–110  ·  view source on GitHub ↗
(workspaceRoot?: string)

Source from the content-addressed store, hash-verified

71 * List available resources
72 */
73export async function listResources(workspaceRoot?: string): Promise<Resource[]> {
74 const resources: Resource[] = []
75
76 // Add examples resource
77 resources.push({
78 uri: 'deepnote://examples',
79 name: 'Example Notebooks',
80 description: 'Built-in example notebooks showing Deepnote features',
81 mimeType: 'application/json',
82 })
83
84 // Add workspace resource if available
85 if (workspaceRoot) {
86 resources.push({
87 uri: 'deepnote://workspace',
88 name: 'Workspace Notebooks',
89 description: 'All .deepnote files in the current workspace',
90 mimeType: 'application/json',
91 })
92
93 // Also list individual notebooks in workspace
94 const workspaceFiles = await findDeepnoteFiles(workspaceRoot)
95 for (const file of workspaceFiles) {
96 const relativePath = path.relative(workspaceRoot, file)
97 const name = path.basename(file, DEEPNOTE_EXTENSION)
98 const encodedFilePath = encodeURIComponent(file)
99
100 resources.push({
101 uri: `deepnote://file/${encodedFilePath}`,
102 name,
103 description: `Notebook: ${relativePath}`,
104 mimeType: 'application/x-deepnote',
105 })
106 }
107 }
108
109 return resources
110}
111
112/**
113 * Read a resource's contents

Callers 2

resources.test.tsFile · 0.90
createServerFunction · 0.90

Calls 1

findDeepnoteFilesFunction · 0.70

Tested by

no test coverage detected