diff --git a/DIRECTORY-EDITION.md b/DIRECTORY-EDITION.md new file mode 100644 index 0000000..41e7782 --- /dev/null +++ b/DIRECTORY-EDITION.md @@ -0,0 +1,32 @@ +# Claude plugin directory edition + +This branch (`Claude`) is the version of the Deepnote plugin that the Claude plugin directory tracks. It is `main` with a few items removed. Do not merge it into `main`. + +## Why it exists + +The directory accepts scripts, file types outside its allowed list, and extra config fields only from Verified organizations. Deepnote's Claude organization is not Verified, so the directory refused the plugin as it is on `main`. `main` stays unchanged for Codex and for the Claude Code marketplace in this repository. + +## How it differs from main + +All differences are inside `plugins/deepnote/`, the only folder the directory reads: + +- `skills/deepnote-data-apps/scripts/app-dev.mjs` is removed. The directory does not accept scripts. +- `assets/deepnote-icon.svg` is removed. SVG is not an allowed image type. The listing uses `assets/icon.png`. +- `.codex-plugin/plugin.json` is removed. It is not used by Claude and referred to the SVG. +- `.mcp.json` has no `bearer_token_env_var` field. Claude signs in with OAuth. +- `skills/deepnote-data-apps/SKILL.md` has no local preview steps. It tells Claude to say the page was not checked and to ask the user to open it. +- `README.md` in the plugin folder describes this edition. + +The Codex marketplace file in `.agents/` and the root `README.md` are left as they are on `main`. They do not apply to this branch. + +## Updating it for a release + +1. Merge `main` into this branch: `git checkout Claude && git merge main`. +2. Resolve conflicts by keeping this branch's side for the items listed above. A change on `main` to a removed file shows up as a modify/delete conflict; keep the deletion. +3. Check that nothing in `plugins/deepnote/` refers to the removed files: `grep -rn -E "app-dev|scripts/|bearer_token|\.svg" plugins/deepnote`. The one expected match is the `logo.svg` example in the data apps skill. +4. Run `claude plugin validate --strict plugins/deepnote`. +5. Push. The directory scans the new commit and shows the result in the developer portal. + +## Retiring it + +Once the organization is Verified, set the plugin's tracked branch back to `main` on its Settings tab in the developer portal, then delete this branch. diff --git a/plugins/deepnote/.codex-plugin/plugin.json b/plugins/deepnote/.codex-plugin/plugin.json deleted file mode 100644 index 6536296..0000000 --- a/plugins/deepnote/.codex-plugin/plugin.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "deepnote", - "version": "0.9.2", - "description": "Search Deepnote workspaces, inspect and edit projects and notebooks, manage integrations and project machines, build data apps and Streamlit apps, generate links, read docs, and run notebooks from ChatGPT and Codex.", - "author": { - "name": "Deepnote", - "url": "https://deepnote.com" - }, - "homepage": "https://github.com/deepnote/agent-plugins", - "repository": "https://github.com/deepnote/agent-plugins", - "license": "Apache-2.0", - "keywords": [ - "deepnote", - "mcp", - "codex", - "notebooks", - "data", - "analytics" - ], - "skills": "./skills/", - "mcpServers": "./.mcp.json", - "interface": { - "displayName": "Deepnote", - "shortDescription": "Analyze data with Deepnote", - "longDescription": "Work with Deepnote workspaces, projects, and notebooks from ChatGPT and Codex. Search resources, inspect projects, read, write, copy, and delete project files, manage integrations, choose project environments, start, stop, and resize project machines, generate project and notebook links, edit notebook structure, build data apps and Streamlit apps, read Deepnote docs, run notebooks with optional inputs, and summarize run history, status, and outputs. Requires a Deepnote account with access to the workspace and permission for each requested action; a workspace admin must enable MCP access.", - "developerName": "Deepnote", - "category": "Data & Analytics", - "capabilities": [ - "Interactive", - "Read", - "Write" - ], - "websiteURL": "https://deepnote.com", - "supportURL": "https://deepnote.com/docs/support", - "privacyPolicyURL": "https://deepnote.com/privacy", - "termsOfServiceURL": "https://deepnote.com/terms", - "defaultPrompt": [ - "Search my Deepnote workspace.", - "Inspect this Deepnote notebook.", - "Run a Deepnote notebook with inputs." - ], - "brandColor": "#3793EF", - "composerIcon": "./assets/deepnote-icon.svg", - "logo": "./assets/deepnote-icon.svg", - "screenshots": [] - } -} diff --git a/plugins/deepnote/.mcp.json b/plugins/deepnote/.mcp.json index 3b2c284..f6da7ec 100644 --- a/plugins/deepnote/.mcp.json +++ b/plugins/deepnote/.mcp.json @@ -2,8 +2,7 @@ "mcpServers": { "deepnote": { "type": "http", - "url": "https://deepnote.com/mcp", - "bearer_token_env_var": "DEEPNOTE_MCP_TOKEN" + "url": "https://deepnote.com/mcp" } } } diff --git a/plugins/deepnote/README.md b/plugins/deepnote/README.md index e4f1ca8..03a308a 100644 --- a/plugins/deepnote/README.md +++ b/plugins/deepnote/README.md @@ -17,6 +17,8 @@ If you already added the Deepnote connector in Claude, the plugin uses the same Then run `/mcp`, choose the Deepnote server, and sign in. +Installed this way, the plugin also includes a script that previews data apps on your computer before publishing. The directory edition leaves that script out. + ## Requirements - A Deepnote account with access to the workspace you want to use. @@ -35,8 +37,7 @@ Then run `/mcp`, choose the Deepnote server, and sign in. ## Data and network access - The plugin sends requests to `https://deepnote.com/mcp` on your behalf. What Claude reads there, such as notebook content, run outputs, file contents, and integration metadata, becomes part of your conversation with Claude. -- The plugin has no hooks and runs nothing on its own. -- The data apps skill ships one optional script, `skills/deepnote-data-apps/scripts/app-dev.mjs`, which Claude can run to preview a data app page before publishing it. It needs Node 18 or later and uses built-in modules only. It starts two servers on `127.0.0.1` (ports 4747 and 4748 by default), serves the page folder from your computer, and makes no outbound requests itself. The previewed page calls the Deepnote API from your browser with a short-lived viewer token that is passed on the command line and never written to a file. The preview only works where Claude can run local commands. +- The plugin has no hooks, ships no scripts, and runs nothing on your computer. - Data app pages that Claude writes with this skill load the Deepnote app client from `deepnote.com`, the Tailwind CSS browser build from `cdn.jsdelivr.net`, and the Inter font from `fonts.googleapis.com`. ## Links diff --git a/plugins/deepnote/assets/deepnote-icon.svg b/plugins/deepnote/assets/deepnote-icon.svg deleted file mode 100644 index d1f7d31..0000000 --- a/plugins/deepnote/assets/deepnote-icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/plugins/deepnote/skills/deepnote-data-apps/SKILL.md b/plugins/deepnote/skills/deepnote-data-apps/SKILL.md index b8bd5dc..2504230 100644 --- a/plugins/deepnote/skills/deepnote-data-apps/SKILL.md +++ b/plugins/deepnote/skills/deepnote-data-apps/SKILL.md @@ -33,7 +33,7 @@ A data app project has two parts: the page, a responsive HTML page in `_deepnote ## The Page - `index.html` can load other files from `_deepnote_static/` by relative path, such as `styles.css`, `app.js`, or `logo.svg`. Keep the app client script and the Tailwind setup below in `index.html`, and move the rest into files of their own when that keeps the page easier to change. -- Keep a local copy of `_deepnote_static/` in a folder of its own. Read each file the page loads or you will change with `read_file` once, unless you wrote it in this conversation; `get_project` lists them. Images that `read_file` cannot read show as broken in the local preview. Edit the files there, and once the page works in the local preview in Testing, push each new or changed file with `write_file` at its path under `_deepnote_static/` and `overwrite: true`. Where you cannot run local commands, write the files with `write_file` directly. When the app existed before this conversation, ask the user before the first push whether to update it in Deepnote, with the preview URL when there is one: pushing overwrites the app for good, and viewers of a published app see the change at once. Once they agree, push later changes they ask for in this conversation without asking again. +- Read each file the page loads or you will change with `read_file` once, unless you wrote it in this conversation; `get_project` lists them. Write each new or changed file with `write_file` at its path under `_deepnote_static/` and `overwrite: true`. When the app existed before this conversation, ask the user before the first push whether to update it in Deepnote: pushing overwrites the app for good, and viewers of a published app see the change at once. Once they agree, push later changes they ask for in this conversation without asking again. - Start the `` of `index.html` with ``, before any other script, and load CDN scripts with `crossorigin="anonymous"`. The script exposes `Deepnote.connect()`, not React components or `DeepnoteApp`. - Style the page with Tailwind CSS 4.3.3. After the app client script, add the Tailwind browser build, Inter, and the default theme below, then use its colors in classes (`bg-surface`, `text-muted`, `border-border`, `bg-accent`, `text-positive`, ...). Its dark values apply on their own, so don't add `dark:` variants for theme colors. Chart code reads series colors with `getComputedStyle(document.documentElement).getPropertyValue('--color-chart-1')`. @@ -78,15 +78,7 @@ A data app project has two parts: the page, a responsive HTML page in `_deepnote Test a changed-input submission with `create_run`, its `inputs`, and `detachedRunStorageMode: "readonly"`, then read it with `get_run` and `snapshotDelivery: "blocks"`. When it fails, inspect its status and output and fix the cause; when it is still pending after several checks, point to run history without claiming the flow works. Finish with a run using `{}` and check that it succeeds, since, when the app lets everyone with access see results without running it, they see the latest editor run until they run it themselves. Delete scratch blocks when done. -Preview the page locally before pushing it, against the same API and data it gets in Deepnote: - -1. Mint a viewer token with `create_data_app_token` for the project. Pass it only on the command line; never write it into files or answers. -2. Run `node scripts/app-dev.mjs --token --api-origin ` in the background, with the script from this skill's directory. Have the same background command kill it after 15 minutes, for example after `sleep 900`, so previews do not pile up; the token expires then anyway. It needs Node 18 or later. It serves the page embedded the way Deepnote does, prints the preview URL, and logs files the page asks for that do not exist. -3. With a browser tool, open the preview URL. The bar above the page says whether the app connected to Deepnote and lists its errors. Look at the page and try the inputs; runs started there are real runs. Fix the files and reload until the bar shows no errors. When it stops, mint a new token and start it again. -4. Without a browser tool, give the user the preview URL, ask them to open it, and say that you did not check the page yourself. -5. Push the new and changed files, after asking the user first when the app existed before this conversation, and leave the preview running so the user can open it until it is killed after 15 minutes. Stop it sooner when the user asks, or before starting another preview on the same port. When the user still wants it after it stops, mint a new token and start it again. - -A client that cannot run local commands, such as ChatGPT or claude.ai, cannot load the page: say the page itself was not checked and ask the user to open it. Do not install browser tools in the notebook to check it. +This edition of the plugin has no local preview, so the page cannot be loaded before it is pushed. After pushing, say the page itself was not checked and ask the user to open it. Do not mint a viewer token with `create_data_app_token` or install browser tools in the notebook to check it. ## Publishing @@ -94,7 +86,4 @@ Published and public are different settings. Published lets people with access t ## Reporting -Report the project and whether the app is published, and describe the work as changes to the app. MCP can't tell whether the app is public, so don't say either way. End with the links as two options, labeled with where each one runs: - -1. Deepnote (cloud): the app URL from `dataApp.url` in `get_project`. Never construct it. When the changes were not pushed, say the app in Deepnote is unchanged instead. -2. Local preview (this computer only): the preview URL and the time it stops, while a preview is running. +Report the project and whether the app is published, and describe the work as changes to the app. MCP can't tell whether the app is public, so don't say either way. End with the app URL from `dataApp.url` in `get_project`, and never construct it. When the changes were not pushed, say the app in Deepnote is unchanged instead. diff --git a/plugins/deepnote/skills/deepnote-data-apps/scripts/app-dev.mjs b/plugins/deepnote/skills/deepnote-data-apps/scripts/app-dev.mjs deleted file mode 100755 index 8320a58..0000000 --- a/plugins/deepnote/skills/deepnote-data-apps/scripts/app-dev.mjs +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/env node -// Previews a data app page locally, embedded the way Deepnote embeds it, against the real Deepnote API. -// -// Two loopback origins stand in for Deepnote: one serves the page folder with Deepnote's rules, the other serves a -// stand-in Deepnote page that embeds it, answers the app client's token requests, and lists the app's errors above -// it, where a browser tool can read them. The page calls the API itself, as it does in Deepnote. Built-in modules only. - -import fs from 'node:fs' -import http from 'node:http' -import path from 'node:path' -import { parseArgs } from 'node:util' - -const USAGE = `Usage: node app-dev.mjs --token --api-origin [--port ] - - --token Viewer token from the create_data_app_token MCP tool. It is never printed. - --api-origin apiOrigin from the same create_data_app_token result. - --port Port of the preview page; the app is served on the next one. Default 4747.` - -// The common web types from the table Deepnote's server looks content types up in. -const CONTENT_TYPES = { - '.avif': 'image/avif', - '.css': 'text/css; charset=utf-8', - '.csv': 'text/csv; charset=utf-8', - '.gif': 'image/gif', - '.htm': 'text/html; charset=utf-8', - '.html': 'text/html; charset=utf-8', - '.ico': 'image/x-icon', - '.jpeg': 'image/jpeg', - '.jpg': 'image/jpeg', - '.js': 'text/javascript; charset=utf-8', - '.json': 'application/json; charset=utf-8', - '.map': 'application/json; charset=utf-8', - '.md': 'text/markdown; charset=utf-8', - '.mjs': 'text/javascript; charset=utf-8', - '.mp3': 'audio/mpeg', - '.mp4': 'video/mp4', - '.otf': 'font/otf', - '.pdf': 'application/pdf', - '.png': 'image/png', - '.svg': 'image/svg+xml', - '.ttf': 'font/ttf', - '.txt': 'text/plain; charset=utf-8', - '.wasm': 'application/wasm', - '.webm': 'video/webm', - '.webp': 'image/webp', - '.woff': 'font/woff', - '.woff2': 'font/woff2', - '.xml': 'application/xml; charset=utf-8', -} -// The app client asks for a new token a minute before this, so its refresh path runs during a preview. -const TOKEN_LIFETIME_SECONDS = 120 - -function fail(message) { - console.error(message) - process.exit(1) -} - -/** - * Serves the folder the way Deepnote serves `_deepnote_static/`: paths ending in `/` get their index.html, a folder - * without the trailing `/` redirects to it so relative links inside work, other paths need the exact file name, and - * nosniff makes the content type matter. - */ -function createAppServer(root, origins, apiOrigin) { - return http.createServer(async (req, res) => { - const { pathname, search } = new URL(req.url, origins.app) - let filePath - let file - try { - filePath = path.join(root, decodeURIComponent(pathname), pathname.endsWith('/') ? 'index.html' : '') - if (filePath.startsWith(root + path.sep)) file = await fs.promises.readFile(filePath) - } catch (error) { - if (error.code === 'EISDIR') { - res.writeHead(302, { location: `${pathname}/${search}` }).end() - return - } - } - if (!file) { - console.log(`[page] 404 ${req.url}`) - res.writeHead(404).end() - return - } - res.writeHead(200, { - 'cache-control': 'no-store', - // The API origin is listed for local Deepnote setups, whose API is plain http. - 'content-security-policy': `default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob: https: ${apiOrigin}; frame-ancestors 'self' ${origins.deepnote}`, - 'content-type': CONTENT_TYPES[path.extname(filePath).toLowerCase()] ?? 'application/octet-stream', - 'referrer-policy': 'no-referrer', - 'x-content-type-options': 'nosniff', - }) - res.end(file) - }) -} - -function renderDeepnotePage({ appOrigin, apiOrigin, token }) { - return ` - - - -Deepnote app preview - - - -
Waiting for the app to connect to Deepnote.
- - - - -` -} - -function listen(server, port) { - return new Promise((resolve, reject) => { - server.once('error', reject) - server.listen(port, '127.0.0.1', () => resolve(`http://127.0.0.1:${server.address().port}`)) - }) -} - -async function main() { - const { values, positionals } = parseArgs({ - allowPositionals: true, - options: { - token: { type: 'string' }, - 'api-origin': { type: 'string' }, - port: { type: 'string', default: '4747' }, - help: { type: 'boolean', default: false }, - }, - }) - if (values.help) { - console.log(USAGE) - return - } - if (positionals.length !== 1 || !values.token || !values['api-origin']) { - fail(USAGE) - } - const root = path.resolve(positionals[0]) - if (!fs.existsSync(path.join(root, 'index.html'))) { - fail(`No index.html in ${root}.`) - } - const apiOrigin = new URL(values['api-origin']).origin - const port = Number(values.port) - - const origins = {} - const deepnoteServer = http.createServer((req, res) => - res - .writeHead(200, { 'cache-control': 'no-store', 'content-type': 'text/html; charset=utf-8' }) - .end(renderDeepnotePage({ appOrigin: origins.app, apiOrigin, token: values.token })) - ) - origins.deepnote = await listen(deepnoteServer, port) - origins.app = await listen(createAppServer(root, origins, apiOrigin), port + 1) - - console.log(`Serving ${root} as the app at ${origins.app}, against the API at ${apiOrigin}.`) - console.log(`Preview: ${origins.deepnote}/`) - console.log( - 'Files are read from disk on every load, so reload after editing. The bar above the page shows whether the app connected to Deepnote and lists its errors. Press Ctrl+C to stop.' - ) -} - -await main().catch(error => fail(error.message))