vizro-mcp 0.0.1.dev0__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vizro_mcp/__init__.py CHANGED
@@ -3,7 +3,7 @@ import sys
3
3
 
4
4
  from .server import mcp
5
5
 
6
- __version__ = "0.0.1.dev0"
6
+ __version__ = "0.1.1"
7
7
 
8
8
 
9
9
  def main():
vizro_mcp/server.py CHANGED
@@ -99,7 +99,7 @@ def get_sample_data_info(data_name: Literal["iris", "tips", "stocks", "gapminder
99
99
 
100
100
  @mcp.tool()
101
101
  def validate_model_config(
102
- config: dict[str, Any],
102
+ dashboard_config: dict[str, Any],
103
103
  data_infos: list[DFMetaData], # Should be Optional[..]=None, but Cursor complains..
104
104
  auto_open: bool = True,
105
105
  ) -> ValidationResults:
@@ -109,7 +109,7 @@ def validate_model_config(
109
109
  The PyCafe link will be automatically opened in your default browser if auto_open is True.
110
110
 
111
111
  Args:
112
- config: Either a JSON string or a dictionary representing a Vizro model configuration
112
+ dashboard_config: Either a JSON string or a dictionary representing a Vizro dashboard model configuration
113
113
  data_infos: List of DFMetaData objects containing information about the data files
114
114
  auto_open: Whether to automatically open the PyCafe link in a browser
115
115
 
@@ -119,7 +119,7 @@ def validate_model_config(
119
119
  Vizro._reset()
120
120
 
121
121
  try:
122
- dashboard = vm.Dashboard.model_validate(config)
122
+ dashboard = vm.Dashboard.model_validate(dashboard_config)
123
123
  except ValidationError as e:
124
124
  return ValidationResults(
125
125
  valid=False,
@@ -333,14 +333,14 @@ Create an EDA dashboard based on the following dataset:{file_path_or_url}. Proce
333
333
 
334
334
  @mcp.tool()
335
335
  def validate_chart_code(
336
- config: ChartPlan,
336
+ chart_config: ChartPlan,
337
337
  data_info: DFMetaData,
338
338
  auto_open: bool = True,
339
339
  ) -> ValidationResults:
340
340
  """Validate the chart code created by the user and optionally open the PyCafe link in a browser.
341
341
 
342
342
  Args:
343
- config: A ChartPlan object with the chart configuration
343
+ chart_config: A ChartPlan object with the chart configuration
344
344
  data_info: Metadata for the dataset to be used in the chart
345
345
  auto_open: Whether to automatically open the PyCafe link in a browser
346
346
 
@@ -350,7 +350,7 @@ def validate_chart_code(
350
350
  Vizro._reset()
351
351
 
352
352
  try:
353
- chart_plan_obj = ChartPlan.model_validate(config)
353
+ chart_plan_obj = ChartPlan.model_validate(chart_config)
354
354
  except ValidationError as e:
355
355
  return ValidationResults(
356
356
  valid=False,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vizro-mcp
3
- Version: 0.0.1.dev0
3
+ Version: 0.1.1
4
4
  Summary: MCP server to help create Vizro dashboards and charts
5
5
  Author: Vizro Team
6
6
  License-File: LICENSE.txt
@@ -17,21 +17,39 @@ Requires-Dist: pandas[excel,html,parquet]
17
17
  Requires-Dist: vizro==0.1.38
18
18
  Description-Content-Type: text/markdown
19
19
 
20
+ <a href="https://glama.ai/mcp/servers/@mckinsey/vizro">
21
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@mckinsey/vizro/badge" />
22
+ </a>
23
+
20
24
  # Vizro MCP server
21
25
 
22
26
  Vizro-MCP is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server, which works alongside a LLM to help you create Vizro dashboards and charts.
23
27
 
28
+ ![Vizro MCP Demo](assets/vizro-mcp.gif)
29
+
24
30
  ## Features of Vizro-MCP
25
31
 
26
32
  Vizro-MCP provides tools and templates to create a functioning Vizro chart or dashboard step by step. Benefits include:
27
33
 
28
- ✅ One consistent framework for charts and dashboards with one common design language. ✅ Validated config output that is readable and easy to alter or maintain. ✅ Live preview of the dashboard to iterate the design until the dashboard is perfect. ✅ Use of local or remote datasets simply by providing a path or URL.
34
+ ✅ One consistent framework for charts and dashboards with one common design language.
35
+
36
+ ✅ Validated config output that is readable and easy to alter or maintain.
37
+
38
+ ✅ Live preview of the dashboard to iterate the design until the dashboard is perfect.
39
+
40
+ ✅ Use of local or remote datasets simply by providing a path or URL.
29
41
 
30
42
  ### Without Vizro-MCP
31
43
 
32
44
  Without Vizro-MCP, if you try to make a dashboard using an LLM, it could choose any framework, and use it without specific guidance, design principles, or consistency. The results are:
33
45
 
34
- ❌ A random choice of frontend framework or charting library. ❌ A vibe-coded mess that may or may not run, but certainly is not very maintainable. ❌ No way to easily preview the dashboard. ❌ No easy way to connect to real data.
46
+ ❌ A random choice of frontend framework or charting library.
47
+
48
+ ❌ A vibe-coded mess that may or may not run, but certainly is not very maintainable.
49
+
50
+ ❌ No way to easily preview the dashboard.
51
+
52
+ ❌ No easy way to connect to real data.
35
53
 
36
54
  ## 🛠️ Get started
37
55
 
@@ -48,10 +66,27 @@ In principle, the Vizro MCP server works with _any_ MCP enabled LLM applications
48
66
 
49
67
  > ⚠️ **Warning:** In some hosts (like Claude Desktop) the free plan might be less performant, which may cause issues when the request is too complex. In cases where the request causes the UI to crash, opt for using a paid plan, or reduce your request's complexity.
50
68
 
51
- ## Setup Instructions
69
+ ### Setup Instructions
70
+
71
+ The general server config is mostly the same for all hosts:
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "vizro-mcp": {
77
+ "command": "uvx",
78
+ "args": [
79
+ "vizro-mcp"
80
+ ]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ In principle, the Vizro MCP server works with _any_ MCP enabled LLM applications but we recommend Claude Desktop or Cursor as popular choices (see more detailed instructions below). Different AI tools may use different setup methods or connection settings. Check each tool's docs for details.
52
87
 
53
88
  <details>
54
- <summary><strong>Claude</strong></summary>
89
+ <summary><strong>Claude Desktop</strong></summary>
55
90
 
56
91
  Add the following to your `claude_desktop_config.json` [found via Developer Settings](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server).
57
92
 
@@ -68,7 +103,7 @@ Add the following to your `claude_desktop_config.json` [found via Developer Sett
68
103
  }
69
104
  ```
70
105
 
71
- > ⚠️ **Warning:** In some cases you may need to provide the full path to your `uv` executable, so instead of `uv` would use something like `/Users/<your-username>/.local/bin/uv`. To discover the path of `uv` on your machine, in your terminal app, type `which uv`.
106
+ > ⚠️ **Warning:** In some cases you may need to provide the full path to your `uvx` executable, so instead of `uvx` would use something like `/Users/<your-username>/.local/bin/uvx`. To discover the path of `uvx` on your machine, in your terminal app, type `which uvx`.
72
107
 
73
108
  If you are using Claude Desktop, restart it, and after a few moments, you should see the vizro-mcp menu when opening the settings/context menu:
74
109
 
@@ -94,7 +129,7 @@ Add the following to `mcp.json` [found via the Cursor Settings](https://docs.cur
94
129
  }
95
130
  ```
96
131
 
97
- > ⚠️ **Warning:** In some cases you may need to provide the full path to your `uv` executable, so instead of `uv` would use something like `/Users/<your-username>/.local/bin/uv`. To discover the path of `uv` on your machine, in your terminal app, type `which uv`.
132
+ > ⚠️ **Warning:** In some cases you may need to provide the full path to your `uvx` executable, so instead of `uvx` would use something like `/Users/<your-username>/.local/bin/uvx`. To discover the path of `uvx` on your machine, in your terminal app, type `which uvx`.
98
133
 
99
134
  Similarly, when using Cursor, after a short pause, you should see a green light in the MCP menu:
100
135
 
@@ -102,8 +137,6 @@ Similarly, when using Cursor, after a short pause, you should see a green light
102
137
 
103
138
  </details>
104
139
 
105
- In principle, the Vizro MCP server works with _any_ MCP enabled LLM applications but we recommend Claude Desktop or Cursor as popular choices. Different AI tools may use different setup methods or connection settings. Check each tool's docs for details.
106
-
107
140
  ## 💻 Usage
108
141
 
109
142
  ### Use prompt templates to get specific dashboards quickly
@@ -122,6 +155,8 @@ You can also ask the LLM to create specific dashboards based on local or remote
122
155
 
123
156
  > _Create a simple two page Vizro dashboard, with first page being a correlation analysis of `<insert absolute file path or public URL>` data, and the second page being a map plot of `<insert absolute file path or public URL>` data_
124
157
 
158
+ You can find a set of sample CSVs to try out in the [Plotly repository](https://github.com/plotly/datasets/tree/master).
159
+
125
160
  You can even ask for a dashboard without providing data:
126
161
 
127
162
  > _Create a Vizro dashboard with one page, a scatter chart, and a filter._
@@ -138,9 +173,11 @@ You can also ask the model to give you the link, but it will attempt to regenera
138
173
 
139
174
  ### Create Vizro charts
140
175
 
141
- The **easiest** way to get started with Vizro charts is to choose the template `create_vizro_chart` and just send the prompt. This will create a simple chart that you can alter. Take it from there!
176
+ If you don't want to create an entire Vizro dashboard, you can still use Vizro-MCP to create the code for a single chart. If you're not sure what kind of chart you want, check out the [Vizro Visual Vocabulary](https://huggingface.co/spaces/vizro/demo-visual-vocabulary) for ideas.
142
177
 
143
- Alternatively, you can just ask in the chat things like:
178
+ The **easiest** way to create a Vizro chart is to choose the template `create_vizro_chart` and just send the prompt. This will create a simple chart that you can alter. Take it from there!
179
+
180
+ Alternatively, you can just ask in the chat, for example:
144
181
 
145
182
  > _Create a scatter based on the iris dataset._
146
183
 
@@ -168,12 +205,8 @@ The Vizro MCP server provides the following tools. In general you should not nee
168
205
  ## Available Prompts (if client allows)
169
206
 
170
207
  - `create_starter_dashboard` - Use this prompt template to get started with Vizro dashboards.
171
- - `create_EDA_dashboard` - Use this prompt template to create an Exploratory Data Analysis (EDA) dashboard based on a local or remote CSV dataset
172
- - `create_vizro_chart` - Use this prompt template to create a Vizro styled plotly chart based on a local or remote CSV dataset
173
-
174
- ## Sample data
175
-
176
- You can find a set of sample CSVs to try out in the [Plotly repository](https://github.com/plotly/datasets/tree/master).
208
+ - `create_EDA_dashboard` - Use this prompt template to create an Exploratory Data Analysis (EDA) dashboard based on a local or remote CSV dataset.
209
+ - `create_vizro_chart` - Use this prompt template to create a Vizro styled plotly chart based on a local or remote CSV dataset.
177
210
 
178
211
  ## Development or running from source
179
212
 
@@ -201,12 +234,67 @@ If you are a developer, or if you are running Vizro-MCP from source, you need to
201
234
 
202
235
  Replace `<PATH TO VIZRO>` with the actual path to your Vizro repository. You may also need to provide the full path to your `uv` executable, so instead of `"uv"` you would use something like `"/Users/<your-username>/.local/bin/uv"`. To discover the path of `uv` on your machine, in your terminal app, type `which uv`.
203
236
 
204
- ## Other cool MCP Servers
237
+ ## Disclaimers
238
+
239
+ <details>
240
+ <summary><strong>Third party API</strong></summary>
241
+
242
+ Users are responsible for anything done via their host LLM application.
243
+
244
+ Users are responsible for procuring any and all rights necessary to access any third-party generative AI tools and for complying with any applicable terms or conditions thereof.
245
+
246
+ Users are wholly responsible for the use and security of the third-party generative AI tools and of Vizro.
247
+
248
+ </details>
249
+
250
+ <details>
251
+ <summary><strong>User acknowledgments</strong></summary>
252
+
253
+ Users acknowledge and agree that:
254
+
255
+ Any results, options, data, recommendations, analyses, code, or other information (“Outputs”) generated by any third-party generative AI tools (“GenAI Tools”) may contain some inaccuracies, biases, illegitimate, potentially infringing, or otherwise inappropriate content that may be mistaken, discriminatory, or misleading.
256
+
257
+ McKinsey & Company:
258
+
259
+ (i) expressly disclaims the accuracy, adequacy, timeliness, reliability, merchantability, fitness for a particular purpose, non-infringement, safety or completeness of any Outputs,
260
+
261
+ (ii) shall not be liable for any errors, omissions, or other defects in, delays or interruptions in such Outputs, or for any actions taken in reliance thereon, and
205
262
 
206
- Here are some other awesome MCP servers you might want to check out:
263
+ (iii) shall not be liable for any alleged violation or infringement of any right of any third party resulting from the users’ use of the GenAI Tools and the Outputs.
207
264
 
208
- - [Context7](https://github.com/upstash/context7) - Provides up-to-date code documentation for any library directly in your prompts. Great for getting the latest API references and examples without relying on outdated training data.
265
+ The Outputs shall be verified and validated by the users and shall not be used without human oversight and as a sole basis for making decisions impacting individuals.
209
266
 
210
- - [Everything MCP](https://github.com/modelcontextprotocol/servers/tree/main/src/everything) - A development-focused MCP server that combines multiple capabilities including web search, code search, and more. Useful for testing and prototyping MCP features. Part of the official MCP servers collection.
267
+ Users remain solely responsible for the use of the Output, in particular, the users will need to determine the level of human oversight needed to be given the context and use case, as well as for informing the users’ personnel and other affected users about the nature of the GenAI Output. Users are also fully responsible for their decisions, actions, use of Vizro and Vizro-MCP and compliance with applicable laws, rules, and regulations, including but not limited to confirming that the Outputs do not infringe any third-party rights.
211
268
 
212
- You can find more MCP servers in the [official MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main).
269
+ </details>
270
+
271
+ <details>
272
+ <summary><strong>Warning and safety usage for generative AI models</strong></summary>
273
+
274
+ Vizro-MCP is used by generative AI models because large language models (LLMs) represent significant advancements in the AI field. However, as with any powerful tool, there are potential risks associated with connecting to a generative AI model.
275
+
276
+ We recommend users research and understand the selected model before using Vizro-MCP.
277
+
278
+ Users are encouraged to treat AI-generated content as supplementary, always apply human judgment, approach with caution, review the relevant disclaimer page, and consider the following:
279
+
280
+ <ol>
281
+ <li>Hallucination and misrepresentation</li>
282
+ Generative models can potentially generate information while appearing factual, being entirely fictitious or misleading.
283
+
284
+ The vendor models might lack real-time knowledge or events beyond its last updates. Vizro-MCP output may vary and you should always verify critical information. It is the user's responsibility to discern the accuracy, consistent, and reliability of the generated content.
285
+
286
+ <li>Unintended and sensitive output</li>
287
+ The outputs from these models can be unexpected, inappropriate, or even harmful. Users as human in the loop is an essential part. Users must check and interpret the final output. It is necessary to approach the generated content with caution, especially when shared or applied in various contexts.
288
+
289
+ <li>Data privacy</li>
290
+ Your data is sent to model vendors if you connect to LLMs via their APIs. For example, if you connect to the model from OpenAI, your data will be sent to OpenAI via their API. Users should be cautious about sharing or inputting any personal or sensitive information.
291
+
292
+ <li>Bias and fairness</li>
293
+ Generative AI can exhibit biases present in their training data. Users need to be aware of and navigate potential biases in generated outputs and be cautious when interpreting the generated content.
294
+
295
+ <li>Malicious use</li>
296
+ These models can be exploited for various malicious activities. Users should be cautious about how and where they deploy and access such models.
297
+ </ol>
298
+ It's crucial for users to remain informed, cautious, and ethical in their applications.
299
+
300
+ </details>
@@ -0,0 +1,12 @@
1
+ vizro_mcp/__init__.py,sha256=nZUsEUDlifJKJw3pG-tvzH7nFxmoPTn85wrORwWWYjs,379
2
+ vizro_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ vizro_mcp/server.py,sha256=mQEyb8MS0L_WVtIhee7oknLZzl2N5QIXsxUiiKHM6Dc,14871
4
+ vizro_mcp/_schemas/__init__.py,sha256=przXt7ukurnDlj3SLRW-K0VO1ksnDDFuS8Njf80xepo,610
5
+ vizro_mcp/_schemas/schemas.py,sha256=r_0i9fRtyMh7W3q3KgnpCbRUDlBaFjG6XQjCtahgEXc,11625
6
+ vizro_mcp/_utils/__init__.py,sha256=q-xdwiyRCaOWWTeG5NC_1CzHWXBH4sUKpIBXbUaKg_Y,670
7
+ vizro_mcp/_utils/utils.py,sha256=gIuKXONR2SvOgA3Vo3ONnkh8Qcc-RLfrexJAjan12zk,9217
8
+ vizro_mcp-0.1.1.dist-info/METADATA,sha256=CmPmKTtiJHsANF4eYGNFJrRiLLiGMM6Odgrv3XHC12w,16027
9
+ vizro_mcp-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ vizro_mcp-0.1.1.dist-info/entry_points.txt,sha256=iSUzPHvx4Ogsn91tK2C0OHxI44SNCHT1F1zUqbTj5O0,45
11
+ vizro_mcp-0.1.1.dist-info/licenses/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
12
+ vizro_mcp-0.1.1.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- vizro_mcp/__init__.py,sha256=rARL6i447w01mUjVtn3WBb3noEgTzbrNqBinR5SUyrs,384
2
- vizro_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- vizro_mcp/server.py,sha256=cINRBPr0hkN5S5tD_Gf6dYu8vC7QviYCOrCtiAxYYwU,14813
4
- vizro_mcp/_schemas/__init__.py,sha256=przXt7ukurnDlj3SLRW-K0VO1ksnDDFuS8Njf80xepo,610
5
- vizro_mcp/_schemas/schemas.py,sha256=r_0i9fRtyMh7W3q3KgnpCbRUDlBaFjG6XQjCtahgEXc,11625
6
- vizro_mcp/_utils/__init__.py,sha256=q-xdwiyRCaOWWTeG5NC_1CzHWXBH4sUKpIBXbUaKg_Y,670
7
- vizro_mcp/_utils/utils.py,sha256=gIuKXONR2SvOgA3Vo3ONnkh8Qcc-RLfrexJAjan12zk,9217
8
- vizro_mcp-0.0.1.dev0.dist-info/METADATA,sha256=nCTKmpfHmHJ6h5TjlZ5zKVqk-CMhal9Ca1QhakaJITo,11747
9
- vizro_mcp-0.0.1.dev0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- vizro_mcp-0.0.1.dev0.dist-info/entry_points.txt,sha256=iSUzPHvx4Ogsn91tK2C0OHxI44SNCHT1F1zUqbTj5O0,45
11
- vizro_mcp-0.0.1.dev0.dist-info/licenses/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
12
- vizro_mcp-0.0.1.dev0.dist-info/RECORD,,