Skip to main content

anywidget-mcp

PyPI License: MIT

anywidget-mcp runs AnyWidgets inside AI conversations. Interact with a Python widget, then let the model respond to its current state. Connect through a host that supports MCP Apps, the Model Context Protocol extension for interactive interfaces.

Choose a color, then explore an interactive HEX-to-RGB explanation

  • Bring existing widgets. Serve widgets from a package or reuse the ones you develop in Jupyter and marimo.
  • Accept conversational input. Typed Python factories become tools that create a fresh widget for each call.
  • Share selected state. Python validates interactions, and you choose which values the model can read.
  • Explore large datasets. Serve query-backed viewers such as Embedding Atlas and share their current filter with the model.
  • Compose interfaces. Expose several tools, return a group of widgets, or create widgets from source in a sandbox.

Try it

Requires Python 3.11+ and uv, a Python package runner:

uvx --with wigglystuff anywidget-mcp serve wigglystuff:ColorPicker --port 8010

Connect your MCP Apps host to http://127.0.0.1:8010/mcp, ask to pick a color, and change the selection. Getting started walks through this in Inspector Chat.

Use Python

Install in the environment that owns your widgets:

uv pip install anywidget-mcp wigglystuff
from anywidget_mcp import serve
from wigglystuff import ColorPicker

serve(ColorPicker, state="color")

state="color" gives the model the current color while the full widget remains interactive. Use AnyWidgetMCP to register several tools or attach() to add widgets to an existing server.

Documentation

Getting started · Write a widget · Pass input · Share state · API reference · Deployment

Experimental software. The API may change between releases.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anywidget_mcp-0.1.1.tar.gz (158.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anywidget_mcp-0.1.1-py3-none-any.whl (170.4 kB view details)

Uploaded Python 3

File details

Details for the file anywidget_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: anywidget_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 158.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anywidget_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8726e8d4705c0969a3fd67953552a4f8bc653db4f5c28afa602c86eb6b18c811
MD5 5541d953859071e194f47b2e0ca66abe
BLAKE2b-256 03199d81f4e83ebf74af680cd3fbcfafb2e107308918931aaece3305fe07bca1

See more details on using hashes here.

File details

Details for the file anywidget_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: anywidget_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 170.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anywidget_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 129de966f454600fbf2d128ac7339c75459333c0fa17c0e486bf991aaece4cce
MD5 5278c992effd78cb59c30f25292017ef
BLAKE2b-256 d8c3d75ff2a2bf199d447328b917de23b36c279f2929fc2fe0c415d61165ff6e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page