API Reference¶
This section provides detailed API documentation for HoloViz MCP.
Core Modules¶
holoviz_mcp
¶
Accessible imports for the holoviz_mcp package.
mcp = FastMCP(name='holoviz', instructions="\n This MCP server provides comprehensive tools, resources and prompts for exploring data, creating data visualizations,\n data tools, dashboards and data apps using the HoloViz ecosystem.\n\n Use this MCP server to get help, resources, and prompts for working with the HoloViz ecosystem effectively.\n\n HoloViz provides a set of core Python packages that make visualization easier, more accurate, and more powerful:\n\n - [Colorcet](https://colorcet.holoviz.org): for perceptually uniform colormaps.\n - [Datashader](https://datashader.org): for rendering even the largest datasets.\n - [GeoViews](https://geoviews.org): to extend HoloViews for geographic data.\n - [HoloViews](https://holoviews.org): to create advanced, interactive and high quality data visualizations.\n - [hvPlot](https://hvplot.holoviz.org): to quickly generate interactive plots from your data.\n - [Lumen](https://lumen.holoviz.org): to build data-driven dashboards from a simple YAML specification that's well suited to modern AI tools like LLMs.\n - [Panel](https://panel.holoviz.org): for making data tools, dashboards and data apps using the Holoviz and wider PyData ecosystems.\n - [Param](https://param.holoviz.org): to create declarative user-configurable objects.\n ", lifespan=app_lifespan)
module-attribute
¶
Server¶
HoloViz MCP Server.
This MCP server provides comprehensive tools, resources and prompts for working with the HoloViz ecosystem, including Panel and hvPlot following best practices.
The server is composed of multiple sub-servers that provide various functionalities:
- Documentation: Search and access HoloViz documentation as context
- hvPlot: Tools, resources and prompts for using hvPlot to develop quick, interactive plots in Python
- Panel: Tools, resources and prompts for using Panel Material UI
logger = logging.getLogger(__name__)
module-attribute
¶
mcp = FastMCP(name='holoviz', instructions="\n This MCP server provides comprehensive tools, resources and prompts for exploring data, creating data visualizations,\n data tools, dashboards and data apps using the HoloViz ecosystem.\n\n Use this MCP server to get help, resources, and prompts for working with the HoloViz ecosystem effectively.\n\n HoloViz provides a set of core Python packages that make visualization easier, more accurate, and more powerful:\n\n - [Colorcet](https://colorcet.holoviz.org): for perceptually uniform colormaps.\n - [Datashader](https://datashader.org): for rendering even the largest datasets.\n - [GeoViews](https://geoviews.org): to extend HoloViews for geographic data.\n - [HoloViews](https://holoviews.org): to create advanced, interactive and high quality data visualizations.\n - [hvPlot](https://hvplot.holoviz.org): to quickly generate interactive plots from your data.\n - [Lumen](https://lumen.holoviz.org): to build data-driven dashboards from a simple YAML specification that's well suited to modern AI tools like LLMs.\n - [Panel](https://panel.holoviz.org): for making data tools, dashboards and data apps using the Holoviz and wider PyData ecosystems.\n - [Param](https://param.holoviz.org): to create declarative user-configurable objects.\n ", lifespan=app_lifespan)
module-attribute
¶
main()
¶
Set up and run the composed MCP server.
Source code in src/holoviz_mcp/server.py
setup_composed_server()
async
¶
Set up the composed server by importing all sub-servers with prefixes.
This uses static composition (import_server), which copies components from sub-servers into the main server with appropriate prefixes.
Source code in src/holoviz_mcp/server.py
Panel MCP¶
Panel MCP Server Package.
This package provides Model Context Protocol (MCP) tools for working with Panel, the Python library for creating interactive web applications and dashboards.
The package includes: - Component discovery and introspection tools - Parameter information extraction - URL proxying utilities for remote environments - Data models for component metadata
Main modules: - server: MCP server implementation with Panel-specific tools - data: Component metadata collection and utilities - models: Pydantic models for component information
Server¶
Panel MCP Server.
This MCP server provides tools, resources and prompts for using Panel to develop quick, interactive applications, tools and dashboards in Python using best practices.
Use this server to access:
- Panel Components: Detailed information about specific Panel components like widgets (input), panes (output) and layouts.
COMPONENTS = []
module-attribute
¶
logger = logging.getLogger(__name__)
module-attribute
¶
mcp = FastMCP(name='panel', instructions='\n [Panel](https://panel.holoviz.org/) MCP Server.\n\n This MCP server provides tools, resources and prompts for using Panel to develop quick, interactive\n applications, tools and dashboards in Python using best practices.\n\n DO use this server to search for specific Panel components and access detailed information including docstrings and parameter information.\n ')
module-attribute
¶
PlaywrightManager
¶
Persistent Playwright browser for fast repeated screenshots.
Source code in src/holoviz_mcp/panel_mcp/server.py
close()
async
¶
get_browser()
async
¶
Get a connected Playwright browser instance, launching if necessary.
Source code in src/holoviz_mcp/panel_mcp/server.py
get_component(ctx, name=None, module_path=None, package=None)
async
¶
Get complete details about a single Panel component including docstring and parameters.
Use this tool when you need full information about a specific Panel component, including its docstring, parameter specifications, and initialization signature. This is the most comprehensive tool for component information.
IMPORTANT: This tool returns exactly one component. If your criteria match multiple components, you'll get an error asking you to be more specific.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
name
|
str
|
Component name to match (case-insensitive). If None, must specify other criteria. Examples: "Button", "TextInput", "Slider" |
None
|
module_path
|
str
|
Full module path to match. If None, uses name and package to find component. Examples: "panel.widgets.Button", "panel_material_ui.Button" |
None
|
package
|
str
|
Package name to filter by. If None, searches all packages. Examples: "panel" or "panel_material_ui" |
None
|
Returns:
| Type | Description |
|---|---|
ComponentDetails
|
Complete component information including docstring, parameters, and initialization signature. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no components match the criteria or if multiple components match (be more specific). |
Examples:
Get Panel's Button component:
>>> get_component(name="Button", package="panel")
ComponentDetails(name="Button", package="panel", docstring="A clickable button...", parameters={...})
Get Material UI Button component:
>>> get_component(name="Button", package="panel_material_ui")
ComponentDetails(name="Button", package="panel_material_ui", ...)
Get component by exact module path:
>>> get_component(module_path="panel.widgets.button.Button")
ComponentDetails(name="Button", module_path="panel.widgets.button.Button", ...)
Source code in src/holoviz_mcp/panel_mcp/server.py
get_component_parameters(ctx, name=None, module_path=None, package=None)
async
¶
Get detailed parameter information for a single Panel component.
Use this tool when you need to understand the parameters of a specific Panel component, including their types, default values, documentation, and constraints. This is useful for understanding how to properly initialize and configure a component.
IMPORTANT: This tool returns parameters for exactly one component. If your criteria match multiple components, you'll get an error asking you to be more specific.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
name
|
str
|
Component name to match (case-insensitive). If None, must specify other criteria. Examples: "Button", "TextInput", "Slider" |
None
|
module_path
|
str
|
Full module path to match. If None, uses name and package to find component. Examples: "panel.widgets.Button", "panel_material_ui.Button" |
None
|
package
|
str
|
Package name to filter by. If None, searches all packages. Examples: "hvplot", "panel" or "panel_material_ui" |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, ParameterInfo]
|
Dictionary mapping parameter names to their detailed information, including: - type: Parameter type (e.g., 'String', 'Number', 'Boolean') - default: Default value - doc: Parameter documentation - bounds: Value constraints for numeric parameters - objects: Available options for selector parameters |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no components match the criteria or if multiple components match (be more specific). |
Examples:
Get Button parameters:
>>> get_component_parameters(name="Button", package="panel")
{"name": ParameterInfo(type="String", default="Button", doc="The text displayed on the button"), ...}
Get TextInput parameters:
>>> get_component_parameters(name="TextInput", package="panel")
{"value": ParameterInfo(type="String", default="", doc="The current text value"), ...}
Get parameters by exact module path:
>>> get_component_parameters(module_path="panel.widgets.Slider")
{"start": ParameterInfo(type="Number", default=0, bounds=(0, 100)), ...}
Source code in src/holoviz_mcp/panel_mcp/server.py
inspect_app(url='http://localhost:5006/', width=1920, height=1200, full_page=False, delay=2, save_screenshot=False, screenshot=True, console_logs=True, log_level=None)
async
¶
Inspect a running Panel app by capturing a screenshot and/or browser console logs.
Panel apps (especially custom components) often have JavaScript errors that are invisible to users and LLMs. This tool captures both a visual screenshot and the browser console output in a single call, making it easy to diagnose rendering issues, JS errors, and runtime warnings.
Arguments
url : str, default="http://localhost:5006/" The URL of the page to inspect. width : int, default=1920 The width of the browser viewport. height : int, default=1200 The height of the browser viewport. full_page : bool, default=False Whether to capture the full scrollable page. delay : int, default=2 Seconds to wait after page load before capturing, to allow dynamic content to render. save_screenshot : bool | str, default=False Whether and where to save the screenshot to disk: - True: Save to default screenshots directory (~/.holoviz-mcp/screenshots/) with auto-generated filename - False: Don't save screenshot to disk (only return to AI) - str: Save to specified absolute path (raises ValueError if path is not absolute) screenshot : bool, default=True Whether to capture a screenshot of the page. console_logs : bool, default=True Whether to capture browser console log messages. log_level : str | None, default=None Filter console logs by level. If None, all levels are captured. Common levels: 'log', 'info', 'warning', 'error', 'debug'.
Source code in src/holoviz_mcp/panel_mcp/server.py
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | |
list_components(ctx, name=None, module_path=None, package=None)
async
¶
Get a summary list of Panel components without detailed docstring and parameter information.
Use this tool to get an overview of available Panel components when you want to browse or discover components without needing full parameter details. This is faster than get_component and provides just the essential information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
name
|
str
|
Component name to filter by (case-insensitive). If None, returns all components. Examples: "Button", "TextInput", "Slider" |
None
|
module_path
|
str
|
Module path prefix to filter by. If None, returns all components. Examples: "panel.widgets" to get all widgets, "panel.pane" to get all panes |
None
|
package
|
str
|
Package name to filter by. If None, returns all components. Examples: "hvplot", "panel" or "panel_material_ui" |
None
|
Returns:
| Type | Description |
|---|---|
list[ComponentSummary]
|
List of component summaries containing name, package, description, and module path. No parameter details are included for faster responses. |
Examples:
Get all available components:
>>> list_components()
[ComponentSummary(name="Button", package="panel", description="A clickable button widget", ...)]
Get all Material UI components:
>>> list_components(package="panel_material_ui")
[ComponentSummary(name="Button", package="panel_material_ui", ...)]
Get all Button components from all packages:
>>> list_components(name="Button")
[ComponentSummary(name="Button", package="panel", ...), ComponentSummary(name="Button", package="panel_material_ui", ...)]
Source code in src/holoviz_mcp/panel_mcp/server.py
list_packages(ctx)
async
¶
List all installed packages that provide Panel UI components.
Use this tool to discover what Panel-related packages are available in your environment. This helps you understand which packages you can use in the 'package' parameter of other tools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of package names that provide Panel components, sorted alphabetically. Examples: ["panel"] or ["panel", "panel_material_ui"] |
Examples:
Use this tool to see available packages:
Then use those package names in other tools:
Source code in src/holoviz_mcp/panel_mcp/server.py
search_components(ctx, query, package=None, limit=10)
async
¶
Search for Panel components by search query and optional package filter.
Use this tool to find components when you don't know the exact name but have keywords. The search looks through component names, module paths, and documentation to find matches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
query
|
str
|
Search term to look for. Can be component names, functionality keywords, or descriptions. Examples: "button", "input", "text", "chart", "plot", "slider", "select" |
required |
package
|
str
|
Package name to filter results. If None, searches all packages. Examples: "hvplot", "panel", or "panel_material_ui" |
None
|
limit
|
int
|
Maximum number of results to return. Default is 10. |
10
|
Returns:
| Type | Description |
|---|---|
list[ComponentSummarySearchResult]
|
List of matching components with relevance scores (0-100, where 100 is exact match). Results are sorted by relevance score in descending order. |
Examples:
Search for button components:
>>> search_components("button")
[ComponentSummarySearchResult(name="Button", package="panel", relevance_score=80, ...)]
Search within a specific package:
>>> search_components("input", package="panel_material_ui")
[ComponentSummarySearchResult(name="TextInput", package="panel_material_ui", ...)]
Find chart components with limited results:
>>> search_components("chart", limit=5)
[ComponentSummarySearchResult(name="Bokeh", package="panel", ...)]
Source code in src/holoviz_mcp/panel_mcp/server.py
Models¶
Pydantic models for Panel component metadata collection.
This module defines the data models used to represent Panel UI component information, including parameter details, component summaries, and search results.
ComponentDetails
¶
Bases: ComponentSummary
Complete information about a Panel UI component.
This model includes all available information about a component: summary information, initialization signature, full docstring, and detailed parameter specifications.
Source code in src/holoviz_mcp/panel_mcp/models.py
docstring = Field(description='Docstring of the component, providing detailed information about its usage.')
class-attribute
instance-attribute
¶
init_signature = Field(description="Signature of the component's __init__ method.")
class-attribute
instance-attribute
¶
parameters = Field(description='Dictionary of parameters for the component, where keys are parameter names and values are ParameterInfo objects.')
class-attribute
instance-attribute
¶
to_base()
¶
Convert to a basic component summary.
Strips away detailed information to create a lightweight summary suitable for listings and overviews.
Returns:
| Type | Description |
|---|---|
ComponentSummary
|
A summary version of this component. |
Source code in src/holoviz_mcp/panel_mcp/models.py
ComponentSummary
¶
Bases: BaseModel
High-level information about a Panel UI component.
This model provides a compact representation of a component without detailed parameter information or docstrings. Used for listings and quick overviews.
Source code in src/holoviz_mcp/panel_mcp/models.py
description = Field(description="Short description of the component's purpose and functionality.")
class-attribute
instance-attribute
¶
module_path = Field(description="Full module path of the component, e.g., 'panel.widgets.Button' or 'panel_material_ui.Button'.")
class-attribute
instance-attribute
¶
name = Field(description="Name of the component, e.g., 'Button' or 'TextInput'.")
class-attribute
instance-attribute
¶
package = Field(description="Package name of the component, e.g., 'panel' or 'panel_material_ui'.")
class-attribute
instance-attribute
¶
ComponentSummarySearchResult
¶
Bases: ComponentSummary
Component summary with search relevance scoring.
Extends ComponentSummary with a relevance score for search results, allowing proper ranking and filtering of search matches.
Source code in src/holoviz_mcp/panel_mcp/models.py
relevance_score = Field(default=0, description='Relevance score for search results')
class-attribute
instance-attribute
¶
from_component(component, relevance_score)
classmethod
¶
Create a search result from a component and relevance score.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
ComponentDetails
|
The component to create a search result from. |
required |
relevance_score
|
int
|
The relevance score (0-100) for this search result. |
required |
Returns:
| Type | Description |
|---|---|
ComponentSummarySearchResult
|
A search result summary of the component. |
Source code in src/holoviz_mcp/panel_mcp/models.py
ConsoleLogEntry
¶
Bases: BaseModel
A single browser console log entry captured during app inspection.
Source code in src/holoviz_mcp/panel_mcp/models.py
level = Field(description="Console message level: 'log', 'info', 'warning', 'error', 'debug', etc.")
class-attribute
instance-attribute
¶
message = Field(description='The text content of the console message.')
class-attribute
instance-attribute
¶
timestamp = Field(default=None, description='ISO 8601 timestamp when the message was captured.')
class-attribute
instance-attribute
¶
ParameterInfo
¶
Bases: BaseModel
Information about a Panel component parameter.
This model captures parameter metadata including type, default value, documentation, and type-specific attributes like bounds or options.
Source code in src/holoviz_mcp/panel_mcp/models.py
allow_None = Field(default=None, description='Whether the parameter accepts None values.')
class-attribute
instance-attribute
¶
bounds = Field(default=None, description='Value bounds for Number-type parameters.')
class-attribute
instance-attribute
¶
constant = Field(default=None, description='Whether the parameter is constant (cannot be changed after initialization).')
class-attribute
instance-attribute
¶
default = Field(default=None, description='The default value for the parameter.')
class-attribute
instance-attribute
¶
doc = Field(default=None, description='Documentation string for the parameter.')
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='allow')
class-attribute
instance-attribute
¶
objects = Field(default=None, description='Available options for Selector-type parameters.')
class-attribute
instance-attribute
¶
per_instance = Field(default=None, description='Whether the parameter is per-instance or shared across instances.')
class-attribute
instance-attribute
¶
readonly = Field(default=None, description='Whether the parameter is read-only.')
class-attribute
instance-attribute
¶
regex = Field(default=None, description='Regular expression pattern for String-type parameters.')
class-attribute
instance-attribute
¶
type = Field(description="The type of the parameter, e.g., 'Parameter', 'Number', 'Selector'.")
class-attribute
instance-attribute
¶
Data¶
Data collection module for Panel component metadata.
This module provides functionality to collect metadata about Panel UI components, including their documentation, parameter schema, and module information. It supports collecting information from panel.viewable.Viewable subclasses across different Panel-related packages.
collect_component_info(cls)
¶
Collect comprehensive information about a Panel component class.
Extracts metadata including docstring, parameter information, method signatures, and other relevant details from a Panel component class. Handles parameter introspection safely, converting non-serializable values appropriately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
type
|
The Panel component class to analyze. |
required |
Returns:
| Type | Description |
|---|---|
ComponentDetails
|
A complete model containing all collected component information. |
Source code in src/holoviz_mcp/panel_mcp/data.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
find_all_subclasses(cls)
¶
Recursively find all subclasses of a given class.
This function performs a depth-first search through the class hierarchy to find all classes that inherit from the given base class, either directly or through inheritance chains.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
type
|
The base class to find subclasses for. |
required |
Returns:
| Type | Description |
|---|---|
set[type]
|
Set of all subclasses found recursively, not including the base class itself. |
Source code in src/holoviz_mcp/panel_mcp/data.py
get_components(parent=Viewable)
¶
Get detailed information about all Panel component subclasses.
Discovers all subclasses of the specified parent class (typically Viewable), filters out private classes, and collects comprehensive metadata for each. Results are sorted alphabetically by module path for consistency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
type
|
The parent class to search for subclasses. Defaults to panel.viewable.Viewable. |
Viewable
|
Returns:
| Type | Description |
|---|---|
list[ComponentDetails]
|
List of detailed component information models, sorted by module path. |
Source code in src/holoviz_mcp/panel_mcp/data.py
load_components(filepath)
¶
Load component data from a JSON file.
Reads and deserializes component data that was previously saved using save_components(). Validates the file exists before attempting to load.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to the saved component data JSON file. |
required |
Returns:
| Type | Description |
|---|---|
list[ComponentDetails]
|
Loaded component data as Pydantic model instances. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the specified file does not exist. |
Source code in src/holoviz_mcp/panel_mcp/data.py
save_components(data, filename)
¶
Save component data to a JSON file.
Serializes a list of ComponentDetails objects to JSON format for persistence. The JSON is formatted with indentation for human readability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
list[ComponentDetails]
|
Component data to save, typically from get_components(). |
required |
filename
|
str
|
Path where the JSON file should be created. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Absolute path to the created file. |
Source code in src/holoviz_mcp/panel_mcp/data.py
to_proxy_url(url, jupyter_server_proxy_url='')
¶
Convert localhost URLs to Jupyter server proxy URLs when applicable.
This function handles URL conversion for environments where localhost access needs to be proxied (like JupyterHub, Binder, etc.). It supports both 'localhost' and '127.0.0.1' addresses and preserves paths and query parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
The original URL to potentially convert. Can be any URL, but only localhost and 127.0.0.1 URLs will be converted. |
required |
jupyter_server_proxy_url
|
str
|
Base URL for the Jupyter server proxy. If None or empty, no conversion is performed. Defaults to the configured proxy URL. |
''
|
Returns:
| Type | Description |
|---|---|
str
|
The converted proxy URL if applicable, otherwise the original URL. Proxy URLs maintain the original port, path, and query parameters. |
Examples:
>>> to_proxy_url("https://external.com/page")
"https://external.com/page" # No conversion for external URLs
Source code in src/holoviz_mcp/panel_mcp/data.py
hvPlot MCP¶
Server¶
hvPlot MCP Server.
This MCP server provides tools, resources, and prompts for using hvPlot to develop quick, interactive plots in Python using best practices.
Use this server to: - List available hvPlot plot types (e.g., 'line', 'scatter', 'bar', ...) - Get docstrings and function signatures for hvPlot plot types
mcp = FastMCP(name='hvplot', instructions='\n [hvPlot](https://hvplot.holoviz.org/) MCP Server.\n\n This MCP server provides tools, resources, and prompts for using hvPlot to develop quick, interactive plots\n in Python using best practices. Use this server to:\n\n - List available hvPlot plot types\n - Get docstrings and function signatures for hvPlot plot types')
module-attribute
¶
get_docstring(ctx, plot_type, docstring=True, generic=True, style=True)
async
¶
Get the hvPlot docstring for a specific plot type, including available options and usage details.
Use this tool to retrieve the full docstring for a plot type, including generic and style options.
Equivalent to hvplot.help(plot_type) in the hvPlot API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
plot_type
|
str
|
The type of plot to provide help for (e.g., 'line', 'scatter'). |
required |
docstring
|
bool
|
Whether to include the docstring in the output. |
True
|
generic
|
bool
|
Whether to include generic plotting options shared by all plot types. |
True
|
style
|
str or bool
|
Plotting backend to use for style options. If True, automatically infers the backend. |
True
|
Returns:
| Type | Description |
|---|---|
str
|
The docstring for the specified plot type, including all relevant options and usage information. |
Examples:
Source code in src/holoviz_mcp/hvplot_mcp/server.py
get_signature(ctx, plot_type, style=True)
async
¶
Get the function signature for a specific hvPlot plot type.
Use this tool to retrieve the Python function signature for a plot type, showing all accepted arguments and their defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
plot_type
|
str
|
The type of plot to provide help for (e.g., 'line', 'scatter'). |
required |
style
|
str or bool
|
Plotting backend to use for style options. If True, automatically infers the backend (ignored here). |
True
|
Returns:
| Type | Description |
|---|---|
str
|
The function signature for the specified plot type. |
Examples:
Source code in src/holoviz_mcp/hvplot_mcp/server.py
list_plot_types(ctx)
async
¶
List all available hvPlot plot types supported in the current environment.
Use this tool to discover what plot types you can generate with hvPlot.
Note: The plot types are also called "kinds".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically provided by the MCP framework). |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted list of all plot type names (e.g., 'line', 'scatter', 'bar', ...). |
Examples:
Source code in src/holoviz_mcp/hvplot_mcp/server.py
Documentation MCP¶
Server¶
HoloViz Documentation MCP Server.
This server provides tools, resources and prompts for accessing documentation related to the HoloViz ecosystems and any user-defined/internal documentation you have configured.
Use this server to search and access documentation for HoloViz libraries (Panel, hvPlot, etc.) and your custom projects.
config = get_config()
module-attribute
¶
mcp = FastMCP(name='documentation', instructions='\n [HoloViz](https://holoviz.org/) Documentation MCP Server.\n\n This server provides tools, resources and prompts for accessing documentation related to the HoloViz ecosystems\n and any user-defined/internal documentation you have configured.\n\n Use this server to search and access documentation for HoloViz libraries (Panel, hvPlot, etc.) and your custom projects.\n ')
module-attribute
¶
app_lifespan(server)
async
¶
Lifespan context manager for HoloViz MCP server.
Source code in src/holoviz_mcp/holoviz_mcp/server.py
display(code, name='', description='', method='jupyter', ctx=None)
async
¶
Display Python code visualization in a browser.
This tool executes Python code and renders it in a Panel web interface, returning a URL where you can view the output. The code is validated before execution and any errors are reported immediately.
Use this tool to when ever the user asks to show, display, visualize data, plots, dashboards, and other Python objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
str
|
The Python code to execute. For "jupyter" method, the last line is displayed. For "panel" method, objects marked .servable() are displayed. |
required |
name
|
str
|
A name for the visualization (displayed in admin/feed views) |
''
|
description
|
str
|
A short description of the visualization |
''
|
method
|
(jupyter, panel)
|
Execution mode: - "jupyter": Execute code and display the last expression's result. The last expression must be dedented fully. DO use this for standard data visualizations like plots, dataframes, etc. that do not import and use Panel directly. - "panel": Execute code and and display Panel objects marked .servable() DO use this for code that imports and uses Panel to create dashboards, apps, and complex layouts. |
"jupyter"
|
Returns:
| Type | Description |
|---|---|
str
|
URL to view the rendered visualization (e.g., http://localhost:5005/view?id=abc123) |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the display server is not enabled or not running |
ValueError
|
If code execution fails (syntax error, runtime error) |
Examples:
Simple visualization with jupyter method:
>>> code = '''
... import pandas as pd
... df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]})
... df
... '''
>>> url = await display(code, name="Sample DataFrame")
Panel app with servable:
>>> code = '''
... import panel as pn
... pn.extension()
... pn.pane.Markdown("# Hello World").servable()
... '''
>>> url = await display(code, method="panel")
Source code in src/holoviz_mcp/holoviz_mcp/server.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | |
get_document(path, project, ctx)
async
¶
Retrieve a specific document by path and project.
Use this tool to look up a specific document within a project.
Args: path: The relative path to the source document (e.g., "index.md", "how_to/customize.md") project: the name of the project (e.g., "panel", "panel-material-ui", "hvplot", "my-custom-project")
Returns:
| Type | Description |
|---|---|
The markdown content of the specified document.
|
|
Source code in src/holoviz_mcp/holoviz_mcp/server.py
get_indexer()
¶
Get or create the global DocumentationIndexer instance.
get_reference_guide(component, project=None, content=True, ctx=None)
async
¶
Find reference guides for specific components in HoloViz or user-defined projects.
Reference guides are a subset of all documents that focus on specific UI components or plot types, such as:
panel: "Button", "TextInput", ...hvplot: "bar", "scatter", ...my-custom-project: custom components from your organization
DO use this tool to easily find reference guides for specific components in HoloViz libraries and your custom projects.
Args: component (str): Name of the component (e.g., "Button", "TextInput", "bar", "scatter") project (str, optional): Project name. Defaults to None (searches all projects). Options: "panel", "panel-material-ui", "hvplot", "param", "holoviews" content (bool, optional): Whether to include full content. Defaults to True. Set to False to only return metadata for faster responses.
Returns:
| Type | Description |
|---|---|
list[Document]: A list of reference guides for the component with full content.
|
|
Examples:
>>> get_reference_guide("Button") # Find Button component guide across all projects
>>> get_reference_guide("Button", "panel") # Find Panel Button component guide specifically
>>> get_reference_guide("TextInput", "panel-material-ui") # Find Material UI TextInput guide
>>> get_reference_guide("bar", "hvplot") # Find hvplot bar chart reference
>>> get_reference_guide("scatter", "hvplot") # Find hvplot scatter plot reference
>>> get_reference_guide("Audio", content=False) # Don't include Markdown content for faster response
Source code in src/holoviz_mcp/holoviz_mcp/server.py
get_skill(name)
¶
Get the specified skill for usage with LLMs.
Use list_skills tool to see available skills.
Args: name (str): The name of the skill to get. For example, "panel", "panel-material-ui", "panel-holoviews", "panel-custom-components" etc.
Returns:
| Type | Description |
|---|---|
str: A string containing the skill in Markdown format.
|
|
Examples:
>>> get_skill("holoviews") # Best practices for using HoloViews
>>> get_skill("hvplot") # Best practices for using hvPlot
>>> get_skill("panel-material-ui") # Best practices for using Panel Material UI
>>> get_skill("panel") # Best practices for using Panel
Source code in src/holoviz_mcp/holoviz_mcp/server.py
list_projects()
async
¶
List all HoloViz and user-defined projects with indexed documentation.
This includes both built-in HoloViz projects (panel, hvplot, etc.) and any custom/internal documentation projects you have configured.
Returns:
| Type | Description |
|---|---|
list[str]: A list of project names that have documentation available.
|
Names are returned in hyphenated format (e.g., "panel-material-ui", "my-custom-project"). |
Source code in src/holoviz_mcp/holoviz_mcp/server.py
list_skills()
¶
List all available skills.
Use get_skill tool to retrieve a specific skill.
Returns:
| Type | Description |
|---|---|
list[str]: A list of the skills available.
|
Names are returned in hyphenated format (e.g., "panel-material-ui", "panel-custom-components" and "a-custom-skill"). |
Source code in src/holoviz_mcp/holoviz_mcp/server.py
search(query, project=None, content='truncated', max_results=2, max_content_chars=10000, ctx=None)
async
¶
Search the HoloViz and any user defined project documentation using semantic similarity.
IMPORTANT: This is a general purpose search tool. Not just for searching the HoloViz documentation.
DO use this tool to search the HoloViz project documentation DO use this tool to search any additional user-defined project documentation. DO use the holoviz_list_projects tool to list the available projects.
BEST PRACTICES: - For initial exploration, use content=False to get an overview of available documents - Use content="chunk" for quick snippets, content="full" for complete documents - Adjust max_content_chars if you need more or less content per result - Set max_content_chars=None to get untruncated content (use with caution for large docs)
QUERY OPTIMIZATION: The search uses context-aware truncation that centers returned content on query keywords. To get the most relevant excerpts:
- Use SPECIFIC terms: "CheckboxEditor SelectEditor" > "editor dropdown"
- Use UNIQUE identifiers: "background_gradient text_gradient" > "styling colors"
- Avoid COMMON terms that appear everywhere: "pandas", "import", "data", "widget"
- Include CLASS/FUNCTION names: "add_filter RangeSlider" > "filtering with widgets"
- Use MULTIPLE specific terms: Helps the algorithm find the right section
- Target FEATURE-SPECIFIC vocabulary: Terms unique to the feature you're looking for
Example: Instead of "how to add pagination to a table", use "pagination page_size local remote" This ensures the truncated content focuses on the pagination section, not generic table info.
Args: query (str): Search query using natural language or specific keywords. Natural language works for finding documents, but specific terms work better for content truncation. See QUERY OPTIMIZATION above.
Good examples: "Button onClick on_click callback event", "hvPlot bar chart kind options"
Okay examples: "how to style Material UI components", "interactive plotting with widgets"
project (str, optional): Optional project filter. Defaults to None.
Examples: "panel", "hvplot", "my-custom-project""
content (str | bool, optional): Controls what content is returned. Defaults to "truncated".
- "truncated": Full document content, smart-truncated around query keywords (default)
- "chunk": Only the best-matching chunk from the document
- "full": Full document content with no truncation (can be very large)
- False: No content, metadata only (fastest)
For backward compat, True maps to "truncated".
max_results (int, optional): Maximum number of results to return. Defaults to 2.
Increase if you need more options, but be mindful of response size.
max_content_chars (int | None, optional): Maximum characters of content per result.
Defaults to 10000. Set to None for untruncated content (may cause token limit errors).
Content is truncated at word boundaries with an ellipsis indicator.
Returns:
| Type | Description |
|---|---|
list[Document]: A list of relevant documents ordered by relevance.
|
|
Examples:
>>> search("Button onClick on_click callback event", "panel-material-ui") # Optimized: specific class and methods
>>> search("hvPlot bar chart kind colormap", "hvplot") # Optimized: feature-specific terms
>>> search("FlexBox GridBox layout responsive sizing", "panel") # Optimized: specific layout classes
>>> search("Tabulator pagination page_size local remote", "panel", max_results=3) # Optimized with more results
>>> search("Param Parameter depends watch", content=False) # Quick metadata search with specific terms
>>> search("stream follow rollover patch", max_content_chars=5000) # Streaming-specific methods
>>> search("custom database connector SQL query", "my-custom-project") # User project with specific terms
>>> search("Tabulator formatters", content="full") # Full document content, no truncation
>>> search("Button widget", content="chunk") # Only the best-matching chunk
Source code in src/holoviz_mcp/holoviz_mcp/server.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |
update_index(ctx)
async
¶
Update the documentation index by re-cloning repositories and re-indexing content.
DO use this tool periodically (weekly) to ensure the documentation index is up-to-date with the latest changes in the HoloViz ecosystem.
Warning: This operation can take a long time (up to 5 minutes) depending on the number of repositories and their size!
Returns:
| Type | Description |
|---|---|
str: Status message indicating the result of the update operation.
|
|
Examples:
Source code in src/holoviz_mcp/holoviz_mcp/server.py
Models¶
Data models for the HoloViz Documentation MCP server.
Document
¶
Bases: BaseModel
Represents a document.
Source code in src/holoviz_mcp/holoviz_mcp/models.py
content = Field(default=None, description='The content of the documentation, if available. In Markdown format if possible.')
class-attribute
instance-attribute
¶
description = Field(default=None, description='A brief description of the document.')
class-attribute
instance-attribute
¶
is_reference = Field(..., description='Indicates if the document is a reference guide.')
class-attribute
instance-attribute
¶
project = Field(..., description='The project to which the document belongs.')
class-attribute
instance-attribute
¶
relevance_score = Field(default=None, description='Relevance score of the document, where 1 is the highest score indicating an exact match.')
class-attribute
instance-attribute
¶
source_path = Field(..., description='The path to the document within the project.')
class-attribute
instance-attribute
¶
source_url = Field(..., description='The URL to the source document.')
class-attribute
instance-attribute
¶
title = Field(..., description='The title of the document.')
class-attribute
instance-attribute
¶
url = Field(..., description='The URL of the rendered, target document.')
class-attribute
instance-attribute
¶
Data¶
Data handling for the HoloViz Documentation MCP server.
logger = logging.getLogger(__name__)
module-attribute
¶
DocumentationIndexer
¶
Handles cloning, processing, and indexing of documentation.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 | |
chroma_client = chromadb.PersistentClient(path=(str(self._vector_db_path)))
instance-attribute
¶
collection = self.chroma_client.get_or_create_collection('holoviz_docs', configuration=_CROMA_CONFIGURATION)
instance-attribute
¶
config = get_config().docs
instance-attribute
¶
data_dir = data_dir or config.user_dir
instance-attribute
¶
db_lock
property
¶
Lazy-initialize and return the database lock.
This ensures the lock is created in the correct event loop context.
repos_dir = repos_dir or config.repos_dir
instance-attribute
¶
clone_or_update_repo(repo_name, repo_config, ctx=None)
async
¶
Clone or update a single repository.
Delegates to the synchronous implementation via run_in_executor.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
convert_notebook_to_markdown(notebook_path)
¶
Convert a Jupyter notebook to markdown.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
ensure_indexed(ctx=None)
async
¶
Ensure documentation is indexed, creating if necessary.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
extract_docs_from_repo(repo_path, project, ctx=None)
async
¶
Extract documentation files from a repository.
Delegates to the synchronous implementation via run_in_executor.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
get_document(path, project, ctx=None)
async
¶
Get a specific document, reconstructing from chunks if needed.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
index_documentation(ctx=None, projects=None, full_rebuild=False)
async
¶
Index documentation, incrementally when possible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context | None
|
FastMCP context for logging. |
None
|
projects
|
list[str] | None
|
Only process these projects. None means all. |
None
|
full_rebuild
|
bool
|
Force full rebuild, ignoring cached hashes. |
False
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 | |
is_indexed()
¶
Check if documentation index exists and is valid.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
list_projects()
async
¶
List all available projects with documentation in the index.
Returns:
| Type | Description |
|---|---|
list[str]: A list of project names that have documentation available.
|
Names are returned in hyphenated format (e.g., "panel-material-ui"). |
Source code in src/holoviz_mcp/holoviz_mcp/data.py
process_file(file_path, project, repo_config, folder_name='')
¶
Process a file and extract metadata.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
run(projects=None, full_rebuild=False)
¶
Update the DocumentationIndexer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
projects
|
list[str] | None
|
Only process these projects. None means all. |
None
|
full_rebuild
|
bool
|
Force full rebuild, ignoring cached hashes. |
False
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
search(query, project=None, content='truncated', max_results=5, max_content_chars=10000, ctx=None)
async
¶
Search the documentation using semantic similarity.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 | |
search_get_reference_guide(component, project=None, content=True, ctx=None)
async
¶
Search for reference guides for a specific component.
Source code in src/holoviz_mcp/holoviz_mcp/data.py
1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 | |
build_excerpts(content, matches, max_chars, context_chars)
¶
Build excerpt string from matches with context windows.
Combines nearby matches, adds separators for distant sections.
Args: content: Full document content matches: List of (start_pos, end_pos, keyword) tuples max_chars: Maximum total characters to return context_chars: Characters to include before/after each match
Returns:
| Type | Description |
|---|---|
Excerpt(s) with [...] separators and truncation indicators
|
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | |
chunk_document(doc, min_chunk_chars=100)
¶
Split a document into chunks at H1/H2 markdown headers.
Only headers outside fenced code blocks are used as split points,
so Python comments (# ...) and decorative dividers inside code
blocks are left intact.
Each chunk stores two content fields:
content: the document title prepended to the raw section text ("Title\\n\\n## Section ...") so that ChromaDB's embedding model associates every chunk with its parent document context.raw_content: the original section text without the title prefix, used byget_document()andsearch_get_reference_guide()to reconstruct the full document without duplicating the title.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc
|
dict[str, Any]
|
Document dict with at least 'id', 'title', and 'content' keys, plus other metadata fields. |
required |
min_chunk_chars
|
int
|
Minimum character count for a chunk to be kept. Chunks below this threshold are discarded (e.g. empty sections). Default: 100. |
100
|
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List of chunk dicts. If no H1/H2 headers are found, returns a single chunk with chunk_index=0. |
Source code in src/holoviz_mcp/holoviz_mcp/data.py
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | |
convert_path_to_url(path, remove_first_part=True, url_transform='holoviz')
¶
Convert a relative file path to a URL path.
Converts file paths to web URLs by replacing file extensions with .html and optionally removing the first path component for legacy compatibility.
Args: path: The file path to convert remove_first_part: Whether to remove the first path component (legacy compatibility) url_transform: How to transform the file path into a URL:
- "holoviz": Replace file extension with .html (default)
- "plotly": Replace file extension with / (e.g., filename.md -> filename/)
- "datashader": Remove leading index and replace file extension with .html (e.g., 01_filename.md -> filename.html)
Returns:
| Type | Description |
|---|---|
URL path with .html extension
|
|
Examples:
>>> convert_path_to_url(Path("doc/getting_started.md"))
"getting_started.html"
>>> convert_path_to_url(Path("examples/reference/Button.ipynb"), False)
"examples/reference/Button.html"
>>> convert_path_to_url(Path("/doc/python/3d-axes.md"), False, "plotly")
"/doc/python/3d-axes/"
>>> convert_path_to_url(Path("/examples/user_guide/10_Performance.ipynb"), False, "datashader")
"/examples/user_guide/Performance.html"
Source code in src/holoviz_mcp/holoviz_mcp/data.py
extract_keywords(query)
¶
Extract meaningful keywords from search query.
Removes common stopwords and splits into terms.
Args: query: Search query string
Returns:
| Type | Description |
|---|---|
List of meaningful keywords (lowercase)
|
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
extract_pascal_terms(query)
¶
Extract single PascalCase words from a query, excluding stopwords.
Captures words like Scatter, Button, Tabulator that start with an
uppercase letter followed by at least one lowercase letter. Compound
CamelCase words (SelectEditor) are also captured — they overlap with
:func:extract_tech_terms and deduplication happens at the call site.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Deduplicated list of PascalCase terms preserving discovery order. Empty list when no terms are found. |
Source code in src/holoviz_mcp/holoviz_mcp/data.py
extract_relevant_excerpt(content, query, max_chars, context_chars=500)
¶
Extract relevant excerpt from content based on query keywords.
Args: content: Full document content query: Search query string max_chars: Maximum total characters to return context_chars: Characters to include before/after each match (default: 500)
Returns:
| Type | Description |
|---|---|
Excerpt(s) centered around query matches, or beginning if no matches
|
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
extract_tech_terms(query)
¶
Extract technical identifiers from a search query.
Identifies three categories of terms that benefit from exact substring matching rather than pure semantic similarity:
- Compound CamelCase (requires internal case transition):
SelectEditor,ReactiveHTML,TextInput— but NOT single-word PascalCase likeButton,Panel,Python. - snake_case:
add_filter,page_size - Dot-separated qualified names:
param.watch,pn.widgets.Button— excludes common abbreviations likee.g,i.evia a blocklist and minimum length filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Deduplicated list of technical terms preserving original case and discovery order. Empty list when no technical terms are found. |
Source code in src/holoviz_mcp/holoviz_mcp/data.py
find_keyword_matches(content, keywords)
¶
Find all positions where keywords appear in content.
Args: content: Document content to search keywords: List of keywords to find
Returns:
| Type | Description |
|---|---|
List of (start_pos, end_pos, matched_keyword) tuples, sorted by position
|
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
get_skill(name)
¶
Get skill for using a project with LLMs.
This function searches for skill resources in user and default directories, with user resources taking precedence over default ones.
Args: name (str): The name of the skill to get.
Returns:
| Type | Description |
|---|---|
str: A string containing the skill in Markdown format.
|
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError: If the specified skill is not found in either directory.
|
|
Source code in src/holoviz_mcp/holoviz_mcp/data.py
list_skills()
¶
List all available skills.
This function discovers available skills from both user and default directories, with user resources taking precedence over default ones.
Returns:
| Type | Description |
|---|---|
list[str]: A list of the skills available.
|
Names are returned in hyphenated format (e.g., "panel-material-ui"). |
Source code in src/holoviz_mcp/holoviz_mcp/data.py
log_exception(message, ctx=None)
async
¶
Log an error message to the context or logger.
log_info(message, ctx=None)
async
¶
log_warning(message, ctx=None)
async
¶
main()
¶
remove_leading_number_sep_from_path(p)
¶
Remove a leading number + underscore or hyphen from the last path component.
truncate_content(content, max_chars, query=None)
¶
Truncate content, optionally centering on query matches.
Args: content: The content to truncate max_chars: Maximum characters allowed. If None, no truncation is performed. query: Optional search query for context-aware truncation
Returns:
| Type | Description |
|---|---|
The original content if under limit, truncated content with ellipsis if over limit,
|
or None if content is None. |
Source code in src/holoviz_mcp/holoviz_mcp/data.py
Configuration¶
Configuration package for HoloViz MCP server.
ConfigLoader
¶
Loads and manages HoloViz MCP configuration.
Source code in src/holoviz_mcp/config/loader.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
clear_cache()
¶
create_default_user_config()
¶
Create a default user configuration file.
Source code in src/holoviz_mcp/config/loader.py
get_agents_dir()
¶
get_repos_dir()
¶
get_resources_dir()
¶
get_skills_dir()
¶
load_config()
¶
Load configuration from files and environment.
Returns:
| Type | Description |
|---|---|
Loaded configuration.
|
|
Raises:
| Type | Description |
|---|---|
ConfigurationError: If configuration cannot be loaded or is invalid.
|
|
Source code in src/holoviz_mcp/config/loader.py
reload_config()
¶
Reload configuration from files.
Returns:
| Type | Description |
|---|---|
Reloaded configuration.
|
|
ConfigurationError
¶
DocsConfig
¶
Bases: BaseModel
Configuration for documentation repositories.
Source code in src/holoviz_mcp/config/models.py
exclude_patterns = Field(default_factory=(lambda: ['**/node_modules/**', '**/.git/**', '**/build/**']), description='File patterns to exclude when indexing documentation')
class-attribute
instance-attribute
¶
index_patterns = Field(default_factory=(lambda: ['**/*.md', '**/*.rst', '**/*.txt']), description='File patterns to include when indexing documentation')
class-attribute
instance-attribute
¶
max_file_size = Field(default=(1024 * 1024), description='Maximum file size in bytes to index')
class-attribute
instance-attribute
¶
repositories = Field(default_factory=dict, description='Dictionary mapping package names to repository configurations')
class-attribute
instance-attribute
¶
update_interval = Field(default=86400, description='How often to check for updates in seconds')
class-attribute
instance-attribute
¶
GitRepository
¶
Bases: BaseModel
Configuration for a Git repository.
Source code in src/holoviz_mcp/config/models.py
base_url = Field(..., description='Base URL for documentation links')
class-attribute
instance-attribute
¶
branch = Field(default=None, description='Git branch to use')
class-attribute
instance-attribute
¶
commit = Field(default=None, description='Git commit hash to use')
class-attribute
instance-attribute
¶
folders = Field(default_factory=(lambda: {'doc': FolderConfig()}), description='Folders to index within the repository. Can be a list of folder names or a dict mapping folder names to FolderConfig objects')
class-attribute
instance-attribute
¶
reference_patterns = Field(default_factory=(lambda: ['examples/reference/**/*.md', 'examples/reference/**/*.ipynb']), description='Glob patterns for reference documentation files')
class-attribute
instance-attribute
¶
tag = Field(default=None, description="Git tag to use (e.g., '1.7.2')")
class-attribute
instance-attribute
¶
url = Field(..., description='Git repository URL')
class-attribute
instance-attribute
¶
url_transform = Field(default='holoviz', description='How to transform file path into URL:\n\n - holoViz transform suffix to .html: filename.md -> filename.html\n - plotly transform suffix to /: filename.md -> filename/\n - datashader removes leading index and transform suffix to .html: 01_filename.md -> filename.html\n ')
class-attribute
instance-attribute
¶
get_folder_names()
¶
Get list of folder names for backward compatibility.
get_folder_url_path(folder_name)
¶
Get URL path for a specific folder.
Source code in src/holoviz_mcp/config/models.py
validate_folders(v)
classmethod
¶
Validate and normalize folders configuration.
Source code in src/holoviz_mcp/config/models.py
validate_tag(v)
classmethod
¶
Validate git tag format, allowing both 'v1.2.3' and '1.2.3' formats.
Source code in src/holoviz_mcp/config/models.py
HoloVizMCPConfig
¶
Bases: BaseModel
Main configuration for HoloViz MCP server.
Source code in src/holoviz_mcp/config/models.py
default_dir = Field(default_factory=_holoviz_mcp_default_dir, description='Default configuration directory')
class-attribute
instance-attribute
¶
display = Field(default_factory=DisplayConfig)
class-attribute
instance-attribute
¶
docs = Field(default_factory=DocsConfig)
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='forbid', validate_assignment=True)
class-attribute
instance-attribute
¶
prompts = Field(default_factory=PromptConfig)
class-attribute
instance-attribute
¶
repos_dir = Field(default_factory=(lambda: _holoviz_mcp_user_dir() / 'repos'), description='Repository download directory')
class-attribute
instance-attribute
¶
resources = Field(default_factory=ResourceConfig)
class-attribute
instance-attribute
¶
server = Field(default_factory=ServerConfig)
class-attribute
instance-attribute
¶
user_dir = Field(default_factory=_holoviz_mcp_user_dir, description='User configuration directory')
class-attribute
instance-attribute
¶
agents_dir(location='user', tool=None)
¶
Get the path to the agents directory.
Args: location: Whether to get user or default agents directory tool: Optional tool-specific subdirectory (e.g., "copilot", "claude")
Returns:
| Type | Description |
|---|---|
Path to agents directory, optionally scoped to a specific tool
|
|
Source code in src/holoviz_mcp/config/models.py
config_file_path(location='user')
¶
Get the path to the configuration file.
Args: location: Whether to get user or default config file path
Source code in src/holoviz_mcp/config/models.py
resources_dir(location='user')
¶
Get the path to the resources directory.
Args: location: Whether to get user or default resources directory
Source code in src/holoviz_mcp/config/models.py
skills_dir(location='user')
¶
Get the path to the skills directory.
Args: location: Whether to get user or default skills directory
Source code in src/holoviz_mcp/config/models.py
PromptConfig
¶
Bases: BaseModel
Configuration for prompts.
Source code in src/holoviz_mcp/config/models.py
search_paths = Field(default_factory=list, description='Additional paths to search for prompts')
class-attribute
instance-attribute
¶
ResourceConfig
¶
Bases: BaseModel
Configuration for resources (agents, skills, etc.).
Source code in src/holoviz_mcp/config/models.py
search_paths = Field(default_factory=list, description='Additional paths to search for resources')
class-attribute
instance-attribute
¶
ServerConfig
¶
Bases: BaseModel
Configuration for the MCP server.
Source code in src/holoviz_mcp/config/models.py
anonymized_telemetry = Field(default=False, description='Enable anonymized telemetry')
class-attribute
instance-attribute
¶
description = Field(default='Model Context Protocol server for HoloViz ecosystem', description='Server description')
class-attribute
instance-attribute
¶
host = Field(default='127.0.0.1', description='Host address to bind to when using HTTP transport (use 0.0.0.0 for Docker)')
class-attribute
instance-attribute
¶
jupyter_server_proxy_url = Field(default='', description='Jupyter server proxy URL for Panel app integration')
class-attribute
instance-attribute
¶
log_level = Field(default='INFO', description='Logging level')
class-attribute
instance-attribute
¶
name = Field(default='holoviz-mcp', description='Server name')
class-attribute
instance-attribute
¶
port = Field(default=8000, description='Port to bind to when using HTTP transport')
class-attribute
instance-attribute
¶
screenshots_dir = Field(default_factory=(lambda: (_holoviz_mcp_user_dir() / 'screenshots').expanduser()), description='Directory for saving screenshots from panel_inspect_app tool.')
class-attribute
instance-attribute
¶
transport = Field(default='stdio', description='Transport protocol for MCP communication')
class-attribute
instance-attribute
¶
vector_db_path = Field(default_factory=(lambda: (_holoviz_mcp_user_dir() / 'vector_db' / 'chroma').expanduser()), description='Path to the Chroma vector database.')
class-attribute
instance-attribute
¶
version = Field(default='1.0.0', description='Server version')
class-attribute
instance-attribute
¶
get_config()
¶
get_config_loader()
¶
Get the global configuration loader instance.
Loader¶
Configuration loader for HoloViz MCP server.
logger = logging.getLogger(__name__)
module-attribute
¶
ConfigLoader
¶
Loads and manages HoloViz MCP configuration.
Source code in src/holoviz_mcp/config/loader.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
clear_cache()
¶
create_default_user_config()
¶
Create a default user configuration file.
Source code in src/holoviz_mcp/config/loader.py
get_agents_dir()
¶
get_repos_dir()
¶
get_resources_dir()
¶
get_skills_dir()
¶
load_config()
¶
Load configuration from files and environment.
Returns:
| Type | Description |
|---|---|
Loaded configuration.
|
|
Raises:
| Type | Description |
|---|---|
ConfigurationError: If configuration cannot be loaded or is invalid.
|
|
Source code in src/holoviz_mcp/config/loader.py
reload_config()
¶
Reload configuration from files.
Returns:
| Type | Description |
|---|---|
Reloaded configuration.
|
|
ConfigurationError
¶
get_config()
¶
get_config_loader()
¶
Get the global configuration loader instance.
Models¶
Configuration models for HoloViz MCP server.
DisplayConfig
¶
Bases: BaseModel
Configuration for the AI Visualizer display server.
Source code in src/holoviz_mcp/config/models.py
db_path = Field(default_factory=(lambda: _holoviz_mcp_user_dir() / 'snippets' / 'snippets.db'), description='Path to SQLite database for display requests')
class-attribute
instance-attribute
¶
enabled = Field(default=True, description='Enable the display server')
class-attribute
instance-attribute
¶
health_check_interval = Field(default=60, description='Health check interval in seconds')
class-attribute
instance-attribute
¶
host = Field(default='localhost', description='Host address for the display Panel server (subprocess mode only)')
class-attribute
instance-attribute
¶
max_restarts = Field(default=3, description='Maximum number of restart attempts for Panel server (subprocess mode only)')
class-attribute
instance-attribute
¶
mode = Field(default='subprocess', description="Display server mode: 'subprocess' to manage Panel server as subprocess, 'remote' to connect to existing server")
class-attribute
instance-attribute
¶
port = Field(default=5005, description='Port for the display Panel server (subprocess mode only)')
class-attribute
instance-attribute
¶
server_url = Field(default=None, description="URL of remote display server (e.g., 'http://localhost:5005'). Only used in 'remote' mode.")
class-attribute
instance-attribute
¶
DocsConfig
¶
Bases: BaseModel
Configuration for documentation repositories.
Source code in src/holoviz_mcp/config/models.py
exclude_patterns = Field(default_factory=(lambda: ['**/node_modules/**', '**/.git/**', '**/build/**']), description='File patterns to exclude when indexing documentation')
class-attribute
instance-attribute
¶
index_patterns = Field(default_factory=(lambda: ['**/*.md', '**/*.rst', '**/*.txt']), description='File patterns to include when indexing documentation')
class-attribute
instance-attribute
¶
max_file_size = Field(default=(1024 * 1024), description='Maximum file size in bytes to index')
class-attribute
instance-attribute
¶
repositories = Field(default_factory=dict, description='Dictionary mapping package names to repository configurations')
class-attribute
instance-attribute
¶
update_interval = Field(default=86400, description='How often to check for updates in seconds')
class-attribute
instance-attribute
¶
FolderConfig
¶
Bases: BaseModel
Configuration for a folder within a repository.
Source code in src/holoviz_mcp/config/models.py
url_path = Field(default='', description="URL path mapping for this folder (e.g., '' for root, '/reference' for reference docs)")
class-attribute
instance-attribute
¶
GitRepository
¶
Bases: BaseModel
Configuration for a Git repository.
Source code in src/holoviz_mcp/config/models.py
base_url = Field(..., description='Base URL for documentation links')
class-attribute
instance-attribute
¶
branch = Field(default=None, description='Git branch to use')
class-attribute
instance-attribute
¶
commit = Field(default=None, description='Git commit hash to use')
class-attribute
instance-attribute
¶
folders = Field(default_factory=(lambda: {'doc': FolderConfig()}), description='Folders to index within the repository. Can be a list of folder names or a dict mapping folder names to FolderConfig objects')
class-attribute
instance-attribute
¶
reference_patterns = Field(default_factory=(lambda: ['examples/reference/**/*.md', 'examples/reference/**/*.ipynb']), description='Glob patterns for reference documentation files')
class-attribute
instance-attribute
¶
tag = Field(default=None, description="Git tag to use (e.g., '1.7.2')")
class-attribute
instance-attribute
¶
url = Field(..., description='Git repository URL')
class-attribute
instance-attribute
¶
url_transform = Field(default='holoviz', description='How to transform file path into URL:\n\n - holoViz transform suffix to .html: filename.md -> filename.html\n - plotly transform suffix to /: filename.md -> filename/\n - datashader removes leading index and transform suffix to .html: 01_filename.md -> filename.html\n ')
class-attribute
instance-attribute
¶
get_folder_names()
¶
Get list of folder names for backward compatibility.
get_folder_url_path(folder_name)
¶
Get URL path for a specific folder.
Source code in src/holoviz_mcp/config/models.py
validate_folders(v)
classmethod
¶
Validate and normalize folders configuration.
Source code in src/holoviz_mcp/config/models.py
validate_tag(v)
classmethod
¶
Validate git tag format, allowing both 'v1.2.3' and '1.2.3' formats.
Source code in src/holoviz_mcp/config/models.py
HoloVizMCPConfig
¶
Bases: BaseModel
Main configuration for HoloViz MCP server.
Source code in src/holoviz_mcp/config/models.py
default_dir = Field(default_factory=_holoviz_mcp_default_dir, description='Default configuration directory')
class-attribute
instance-attribute
¶
display = Field(default_factory=DisplayConfig)
class-attribute
instance-attribute
¶
docs = Field(default_factory=DocsConfig)
class-attribute
instance-attribute
¶
model_config = ConfigDict(extra='forbid', validate_assignment=True)
class-attribute
instance-attribute
¶
prompts = Field(default_factory=PromptConfig)
class-attribute
instance-attribute
¶
repos_dir = Field(default_factory=(lambda: _holoviz_mcp_user_dir() / 'repos'), description='Repository download directory')
class-attribute
instance-attribute
¶
resources = Field(default_factory=ResourceConfig)
class-attribute
instance-attribute
¶
server = Field(default_factory=ServerConfig)
class-attribute
instance-attribute
¶
user_dir = Field(default_factory=_holoviz_mcp_user_dir, description='User configuration directory')
class-attribute
instance-attribute
¶
agents_dir(location='user', tool=None)
¶
Get the path to the agents directory.
Args: location: Whether to get user or default agents directory tool: Optional tool-specific subdirectory (e.g., "copilot", "claude")
Returns:
| Type | Description |
|---|---|
Path to agents directory, optionally scoped to a specific tool
|
|
Source code in src/holoviz_mcp/config/models.py
config_file_path(location='user')
¶
Get the path to the configuration file.
Args: location: Whether to get user or default config file path
Source code in src/holoviz_mcp/config/models.py
resources_dir(location='user')
¶
Get the path to the resources directory.
Args: location: Whether to get user or default resources directory
Source code in src/holoviz_mcp/config/models.py
skills_dir(location='user')
¶
Get the path to the skills directory.
Args: location: Whether to get user or default skills directory
Source code in src/holoviz_mcp/config/models.py
PromptConfig
¶
Bases: BaseModel
Configuration for prompts.
Source code in src/holoviz_mcp/config/models.py
search_paths = Field(default_factory=list, description='Additional paths to search for prompts')
class-attribute
instance-attribute
¶
ResourceConfig
¶
Bases: BaseModel
Configuration for resources (agents, skills, etc.).
Source code in src/holoviz_mcp/config/models.py
search_paths = Field(default_factory=list, description='Additional paths to search for resources')
class-attribute
instance-attribute
¶
ServerConfig
¶
Bases: BaseModel
Configuration for the MCP server.