-
Notifications
You must be signed in to change notification settings - Fork 14
Enhancement/mcp apps #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Enhancement/mcp apps #161
Changes from all commits
de64ee1
d76e96f
88ea500
477b6bc
5b127f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| { | ||
| "python-envs.defaultEnvManager": "ms-python.python:system", | ||
| "python-envs.pythonProjects": [] | ||
| "python-envs.defaultEnvManager": "ms-python.python:system" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,10 +117,21 @@ def _execute_code(snippet: Snippet) -> pn.viewable.Viewable | None: | |
| """ | ||
| module_name = f"holoviz_snippet_{snippet.id.replace('-', '_')}" | ||
|
|
||
| # We need to reset the material design | ||
| app: str = ( | ||
| """\ | ||
| import panel as pn | ||
|
|
||
| pn.config.design = None | ||
|
|
||
| """ | ||
| + snippet.app | ||
| ) | ||
|
|
||
| if snippet.method == "jupyter": | ||
| # Extract last expression | ||
| try: | ||
| statements, last_expr = extract_last_expression(snippet.app) | ||
| statements, last_expr = extract_last_expression(app) | ||
| except ValueError as e: | ||
| raise ValueError(f"Failed to parse code: {e}") from e | ||
|
|
||
|
|
@@ -150,7 +161,7 @@ def _execute_code(snippet: Snippet) -> pn.viewable.Viewable | None: | |
| else: # panel method | ||
| # Execute code that should call .servable() | ||
| execute_in_module( | ||
| snippet.app, | ||
| app, | ||
| module_name=module_name, | ||
| cleanup=True, # Can cleanup immediately | ||
| ) | ||
|
Comment on lines
131
to
167
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
showtool now returns a JSON text payload (as implemented inholoviz_mcp.server.display()), not a plain success/error message string. This “Returns” description is now misleading; update it to describe the JSON payload shape (and/or the fallback behavior in non-MCP-App hosts).