From 5e2e0a4a29439ec38dbd6b03a3d8c2cc8fb27ef7 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Sat, 31 Oct 2026 13:44:18 +1000 Subject: [PATCH] mv mcp from main to docs --- README.rst | 98 +-------------------------------------------- docs/index.rst | 4 ++ docs/mcp.rst | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 96 deletions(-) create mode 100644 docs/mcp.rst diff --git a/README.rst b/README.rst index 2a6ef838d..0bdedfa4f 100644 --- a/README.rst +++ b/README.rst @@ -138,102 +138,8 @@ UltraPlot includes a Model Context Protocol (MCP) server that lets AI assistants search documentation and examples, inspect the live Python API, and read source code and release notes. -Run directly with uvx ---------------------- - -With `uv `__ installed, -your MCP client can launch the server with ``uvx``. uv installs the package and -its dependencies in an isolated environment automatically, so you do not need -to create a virtual environment or install UltraPlot separately. - -For a PyPI release containing the MCP server, the launch command is: - -.. code-block:: bash - - uvx --from 'ultraplot[mcp]' ultraplot-mcp - -For clients that use an ``mcpServers`` configuration, add: - -.. code-block:: json - - { - "mcpServers": { - "ultraplot": { - "command": "uvx", - "args": ["--from", "ultraplot[mcp]", "ultraplot-mcp"] - } - } - } - -The client starts the server when needed and communicates with it over stdio. -Other clients may use a different configuration format; use the same command -and arguments. ``uvx`` is equivalent to ``uv tool run``. - -Until the MCP server is released on PyPI, run it directly from the feature -branch instead: - -.. code-block:: bash - - uvx --from 'ultraplot[mcp] @ git+https://github.com/ultraplot/ultraplot.git@feat/mcp' ultraplot-mcp - -For this development version, replace ``ultraplot[mcp]`` in the client -configuration with -``ultraplot[mcp] @ git+https://github.com/ultraplot/ultraplot.git@feat/mcp``. - -Install persistently with uv ----------------------------- - -Alternatively, keep the executable on your ``PATH`` by installing it as a uv -tool. For a PyPI release containing the MCP server: - -.. code-block:: bash - - uv tool install 'ultraplot[mcp]' - ultraplot-mcp --help - -Before that release, install from the feature branch: - -.. code-block:: bash - - uv tool install 'ultraplot[mcp] @ git+https://github.com/ultraplot/ultraplot.git@feat/mcp' - -Then configure your client to launch ``ultraplot-mcp`` with no arguments. -If uv reports that its executable directory is missing from ``PATH``, run -``uv tool update-shell`` and restart your shell. - -Install from a checkout ------------------------ - -From a checkout containing the MCP implementation, install the optional ``mcp`` -extra in the Python environment you want the server to use: - -.. code-block:: bash - - pip install -e '.[mcp]' - -Connect an MCP client ---------------------- - -After installing persistently with uv or pip, register the server with an -installed Codex CLI: - -.. code-block:: bash - - ultraplot-mcp install codex - -Restart Codex after registration. Try asking it to search the UltraPlot -examples for shared colorbars or inspect ``ultraplot.subplots``. - -For other MCP clients, configure a stdio server with ``ultraplot-mcp`` as the -command and no arguments. Use the executable's absolute path if the client does -not inherit your Python environment's ``PATH``. Running ``ultraplot-mcp`` starts -the server; ``ultraplot-mcp --help`` lists the available commands. - -Documentation tools read the checkout's ``docs`` directory. Direct uvx and uv -tool installations require a separate documentation checkout for these tools. -If documentation lives elsewhere, set ``ULTRAPLOT_MCP_DOCS`` to its absolute path in the MCP -client's server environment. Documentation is not currently bundled in the -Python package; API and source inspection use the installed UltraPlot version. +See the `MCP installation guide `__ +for installation instructions, client configuration, and documentation setup. Citing UltraPlot ================ diff --git a/docs/index.rst b/docs/index.rst index 5934fc6c4..26fec4a70 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,6 +5,9 @@ **UltraPlot** is a succinct wrapper around `matplotlib `__ for creating **publication-quality graphics** with a small, familiar API. +.. raw:: html + :file: _templates/plot-carousel.html + Start with a finished figure ############################ @@ -134,6 +137,7 @@ For details, see the full :doc:`User guide ` and :hidden: install + mcp why_ultraplot first_figure usage diff --git a/docs/mcp.rst b/docs/mcp.rst new file mode 100644 index 000000000..d1e4dc238 --- /dev/null +++ b/docs/mcp.rst @@ -0,0 +1,105 @@ +.. _mcp_install: + +MCP server installation +======================= + +UltraPlot includes a Model Context Protocol (MCP) server that lets AI assistants +search documentation and examples, inspect the live Python API, and read source +code and release notes. + +Run directly with uvx +--------------------- + +With `uv `__ installed, +your MCP client can launch the server with ``uvx``. uv installs the package and +its dependencies in an isolated environment automatically, so you do not need +to create a virtual environment or install UltraPlot separately. + +For a PyPI release containing the MCP server, the launch command is: + +.. code-block:: bash + + uvx --from 'ultraplot[mcp]' ultraplot-mcp + +For clients that use an ``mcpServers`` configuration, add: + +.. code-block:: json + + { + "mcpServers": { + "ultraplot": { + "command": "uvx", + "args": ["--from", "ultraplot[mcp]", "ultraplot-mcp"] + } + } + } + +The client starts the server when needed and communicates with it over stdio. +Other clients may use a different configuration format; use the same command +and arguments. ``uvx`` is equivalent to ``uv tool run``. + +Until the MCP server is released on PyPI, run it directly from the feature +branch instead: + +.. code-block:: bash + + uvx --from 'ultraplot[mcp] @ git+https://github.com/ultraplot/ultraplot.git@feat/mcp' ultraplot-mcp + +For this development version, replace ``ultraplot[mcp]`` in the client +configuration with +``ultraplot[mcp] @ git+https://github.com/ultraplot/ultraplot.git@feat/mcp``. + +Install persistently with uv +---------------------------- + +Alternatively, keep the executable on your ``PATH`` by installing it as a uv +tool. For a PyPI release containing the MCP server: + +.. code-block:: bash + + uv tool install 'ultraplot[mcp]' + ultraplot-mcp --help + +Before that release, install from the feature branch: + +.. code-block:: bash + + uv tool install 'ultraplot[mcp] @ git+https://github.com/ultraplot/ultraplot.git@feat/mcp' + +Then configure your client to launch ``ultraplot-mcp`` with no arguments. +If uv reports that its executable directory is missing from ``PATH``, run +``uv tool update-shell`` and restart your shell. + +Install from a checkout +----------------------- + +From a checkout containing the MCP implementation, install the optional ``mcp`` +extra in the Python environment you want the server to use: + +.. code-block:: bash + + pip install -e '.[mcp]' + +Connect an MCP client +--------------------- + +After installing persistently with uv or pip, register the server with an +installed Codex CLI: + +.. code-block:: bash + + ultraplot-mcp install codex + +Restart Codex after registration. Try asking it to search the UltraPlot +examples for shared colorbars or inspect ``ultraplot.subplots``. + +For other MCP clients, configure a stdio server with ``ultraplot-mcp`` as the +command and no arguments. Use the executable's absolute path if the client does +not inherit your Python environment's ``PATH``. Running ``ultraplot-mcp`` starts +the server; ``ultraplot-mcp --help`` lists the available commands. + +Documentation tools read the checkout's ``docs`` directory. Direct uvx and uv +tool installations require a separate documentation checkout for these tools. +If documentation lives elsewhere, set ``ULTRAPLOT_MCP_DOCS`` to its absolute path in the MCP +client's server environment. Documentation is not currently bundled in the +Python package; API and source inspection use the installed UltraPlot version.