Expose AnyWidget interfaces as interactive MCP Apps
Project description
anywidget-mcp
Some answers work better as interfaces.
anywidget-mcp brings AnyWidget to
MCP Apps. Build a
widget once, use it in Jupyter or marimo, then let people open the same
interface right inside the conversation.
Color pickers, data explorers, diagrams, and interactive explanations stay connected to Python, so the model can respond to what the user does next.
Start with a widget library or bring your own.
Documentation: peter-gy.github.io/anywidget-mcp
Install
Requires Python 3.11 or newer.
pip install anywidget-mcp
See a widget in chat
This example uses Wigglystuff, an AnyWidget library:
pip install wigglystuff
anywidget-mcp serve wigglystuff:ColorPicker --port 8010
Keep the server running. Start mcp-use Inspector in another terminal:
npx --yes @mcp-use/inspector@12.0.3 \
--url http://127.0.0.1:8010/mcp \
--port 7878 \
--no-open
Open Inspector Chat, configure a model provider, and ask:
Use
color_pickerso I can choose a color.
The widget renders in the conversation. Change the color, then ask the model what color it is. The answer comes from the widget's current Python state.
Browse the AnyWidget gallery for other widgets.
Serve your AnyWidget
Point the CLI at any importable AnyWidget class:
anywidget-mcp serve my_widgets:MyWidget
Or start the server from Python:
from anywidget_mcp import serve
from my_widgets import MyWidget
serve(MyWidget)
anywidget-mcp supplies the MCP tool, app resource, session lifecycle, and
state synchronization. MyWidget stays an ordinary anywidget.AnyWidget
subclass with the same Python traits and frontend module used in notebooks.
When the widget needs data from the conversation, use a Python function that accepts the input and returns the widget. Runtime inputs and composition covers that workflow, multiple widgets, and existing FastMCP servers.
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anywidget_mcp-0.0.1.tar.gz.
File metadata
- Download URL: anywidget_mcp-0.0.1.tar.gz
- Upload date:
- Size: 148.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eb6040a8dd6f5411f007fc12e35e91a3c8e6fd71b6a364e95ea02580c25ae12
|
|
| MD5 |
1c1ae44ed4ea07794e4a14dd63f602a4
|
|
| BLAKE2b-256 |
f1f8246ddc6a0e8d938388026245c30385fcb09cbdd2157bc81a6f1ce052ebdd
|
Provenance
The following attestation bundles were made for anywidget_mcp-0.0.1.tar.gz:
Publisher:
publish.yml on peter-gy/anywidget-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anywidget_mcp-0.0.1.tar.gz -
Subject digest:
7eb6040a8dd6f5411f007fc12e35e91a3c8e6fd71b6a364e95ea02580c25ae12 - Sigstore transparency entry: 2205827246
- Sigstore integration time:
-
Permalink:
peter-gy/anywidget-mcp@d8b9967149315487417c687761dfc05c60f1e5c7 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/peter-gy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d8b9967149315487417c687761dfc05c60f1e5c7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file anywidget_mcp-0.0.1-py3-none-any.whl.
File metadata
- Download URL: anywidget_mcp-0.0.1-py3-none-any.whl
- Upload date:
- Size: 159.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c80e208ae71e199b8c6dc2d51da1146bb699926ac459e8f7c9f71e3d21ed434
|
|
| MD5 |
cf115bfd478cc4e407934265ee052885
|
|
| BLAKE2b-256 |
c0d7f0f4681800412febe2f9be98d88fef3b82dc47d26edc7741c282ca8635d7
|
Provenance
The following attestation bundles were made for anywidget_mcp-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on peter-gy/anywidget-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anywidget_mcp-0.0.1-py3-none-any.whl -
Subject digest:
8c80e208ae71e199b8c6dc2d51da1146bb699926ac459e8f7c9f71e3d21ed434 - Sigstore transparency entry: 2205827556
- Sigstore integration time:
-
Permalink:
peter-gy/anywidget-mcp@d8b9967149315487417c687761dfc05c60f1e5c7 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/peter-gy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d8b9967149315487417c687761dfc05c60f1e5c7 -
Trigger Event:
push
-
Statement type: