Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Hey @nojaf, thanks for the feature. We've seen some work by folks who have made this a skill instead (create-marimo-notebook-skill). So, just wondering if there's anything special a tool can do that a skill / good prompt can't? |
|
Hey @Light2Dark, great question! A skill could use My use case: I run
With a skill using Why notebooks instead of scripts:
The goal is for Claude to have an introspectable interactive Python session it can work with autonomously. Ideally I never need to open the browser - Claude iterates, gets the answer, and reports back. I only check the notebook manually if something seems off. What we have now: This PR adds What's still needed: For the full workflow to work without manual intervention, we'd also need:
Looking at the codebase, Happy to scope this PR to just file creation as a first step, or expand it to include session management - whatever fits better with your roadmap. |
|
Got it thanks. Looping in @dmadisetti since he tried the skills approach. There is a |
`StartSession registers an existing notebook with the running server and returns a URL, instead of creating files on disk
`StartSession creates a headless kernel session for an existing notebook, enabling MCP tools to inspect cells without opening a browser.
|
Hi @Light2Dark , I talked about this PR with @mscolnick last week. Let me know if that works. |
|
This pull request has been automatically marked as stale because it has not had activity in 30 days. It will be closed in 14 days if no further activity occurs. If this PR is still relevant, please leave a comment or push new changes to keep it open. Thank you for your contribution! |
|
Yes, this PR is still relevant. I'm still hoping to get a reaction from the team here. |
|
Looping in @manzt since |
|
Thanks @dmadisetti for pointing me to marimo-pair, I was able to do it but my LLM got quite confused. It gave me some feedback: @manzt want me to create an issue for that over at marimo-pair? |
|
Happy to close this in favour of marimo-pair. |
|
Thanks @nojaf. Yeah feel free to open an issue in pair! |
📝 Summary
Adds a new MCP tool
create_notebookthat allows AI assistants to create new marimo notebooks via the MCP server.🔍 Description of Changes
Motivation
When using marimo with an AI assistant (like Claude) via MCP, there was no way to programmatically create new notebooks. Users had to manually create files or use
marimo newseparately. This PR enables a workflow where you can tell an AI assistant "create a new notebook that does X" and have it create the file, ready to open.Changes
New MCP Tool:
create_notebookmarimo/_ai/_tools/tools/create_notebook.pyfilename(required): Name for the new notebook (e.g.,analysis.py)prompt(optional): If provided, attempts to generate initial content via marimo's AI APIfile_pathandurlto open the notebook in the browserKey Features:
https://ai.marimo.app/api/notebook.pyto generate initial notebook contentmarimo checkto validate generated content before writing (checkslinter.erroredandlinter.issues_count)analysis.pyexists, createsanalysis_1.py,analysis_2.py, etc.marimo edit .): Creates in served directory, callsmark_stale()on routermarimo edit notebook.py): Creates sibling file, callsregister_allowed_file()Files Changed:
marimo/_ai/_tools/tools/create_notebook.py(new)marimo/_ai/_tools/tools_registry.py(added to tool list)tests/_ai/tools/tools/test_create_notebook.py(new, 20 tests)Usage
Then ask Claude: "Create a new notebook called
data_analysis.pythat visualizes some sample data"📋 Checklist