Skip to content

Conversation

@mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Oct 2, 2025

  • cleanup MCP server ui in the CLI
  • add auth to /mcp/route
  • set defaults like remove server-token and add watch
  • add Tool to fetch marimo rules

@mscolnick mscolnick requested a review from akshayka as a code owner October 2, 2025 22:19
@vercel
Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Oct 5, 2025 4:30pm

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 2, 2025
)
# Add to Claude code
print_tabbed(
f"{_utf8('➜')} {green('Add to Claude Code')}: claude mcp add --transport http marimo {mcp_url}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also include 'add to Cursor'? Since the most likely use cases for this are Claude Code and Cursor. It can be something like:

print_tabbed(
    f"{_utf8('➜')} {green('Add to Cursor')}: Add the following to ~/.cursor/mcp.json:\n"
    f"""  {{
    "mcpServers": {{
      "marimo": {{
        "url": "{mcp_url}"
      }}
    }}
  }}"""
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems a bit verbose for the CLI. we could look into making the CLI more interface in the future (e.g. press i for more info)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense

source_url: str = MARIMO_RULES_URL


class GetMarimoRules(ToolBase[EmptyArgs, GetMarimoRulesOutput]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good! Maybe we should add this to the next_steps= suggestion for some of the other tools?
My suggestions would be:

  • GetNotebookErrors() if there are any notebook specific or marimo specific errors
  • GetLightweightCellMap() and GetActiveNotebooks() because these are entry points.
  • GetDatabaseTables() because the rules contain some SQL-specific guidelines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can do this in a followup. it hard to tell why an AI would ask for rules so im not sure if the next steps would veer it off track

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sounds good. I'll keep this incase we decide to update it later. We can see first if the Chat LLMs either don't pull rules initially or pull it early on in the conversation then forget it.

@bjoaquinc
Copy link
Contributor

bjoaquinc commented Oct 5, 2025

Also not sure if this is intentional or not but since all the other tools have tests, might be nice to include some tests too for GetMarimoRules in tests/_ai/tools/tools/test_rules.py? Esp since it uses an external http dep.

mcp_app = mcp.streamable_http_app()

# Middleware to require edit scope
class RequiresEditMiddleware(BaseHTTPMiddleware):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RequiresEditMiddleware() doesn't seem to be mcp specific at all. Maybe it would be better to move this logic to marimo/_server/api/middleware.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually just for MCP. we already support auth on other endpoints with @requires

@mscolnick mscolnick merged commit 8736ffc into main Oct 5, 2025
38 of 41 checks passed
@mscolnick mscolnick deleted the ms/mcp-server-improvements branch October 5, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants