vizro-mcp 0.1.1__tar.gz → 0.1.2__tar.gz

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.
Files changed (32) hide show
  1. vizro_mcp-0.1.2/.dockerignore +10 -0
  2. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/CHANGELOG.md +16 -0
  3. vizro_mcp-0.1.2/Dockerfile +10 -0
  4. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/PKG-INFO +75 -52
  5. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/README.md +73 -50
  6. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/assets/vizro-mcp.gif +0 -0
  7. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/pyproject.toml +1 -1
  8. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/src/vizro_mcp/__init__.py +1 -1
  9. vizro_mcp-0.1.2/src/vizro_mcp/_schemas/__init__.py +11 -0
  10. vizro_mcp-0.1.2/src/vizro_mcp/_schemas/schemas.py +214 -0
  11. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/src/vizro_mcp/_utils/__init__.py +24 -5
  12. vizro_mcp-0.1.2/src/vizro_mcp/_utils/configs.py +142 -0
  13. vizro_mcp-0.1.2/src/vizro_mcp/_utils/prompts.py +180 -0
  14. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/src/vizro_mcp/_utils/utils.py +63 -146
  15. vizro_mcp-0.1.2/src/vizro_mcp/server.py +364 -0
  16. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/tests/unit/vizro_mcp/test_server.py +141 -65
  17. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/uv.lock +713 -743
  18. vizro_mcp-0.1.1/src/vizro_mcp/_schemas/__init__.py +0 -29
  19. vizro_mcp-0.1.1/src/vizro_mcp/_schemas/schemas.py +0 -297
  20. vizro_mcp-0.1.1/src/vizro_mcp/server.py +0 -400
  21. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/.gitignore +0 -0
  22. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/LICENSE.txt +0 -0
  23. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/assets/claude_prompt.png +0 -0
  24. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/assets/claude_validate.png +0 -0
  25. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/assets/claude_working.png +0 -0
  26. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/assets/cursor_working.png +0 -0
  27. /vizro_mcp-0.1.1/changelog.d/20250515_115815_lingyi_zhang_0_1_1.md → /vizro_mcp-0.1.2/changelog.d/20250630_120648_maximilian_schulz_mcp.md +0 -0
  28. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/changelog.d/new_fragment.md.j2 +0 -0
  29. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/changelog.d/scriv.ini +0 -0
  30. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/glama.json +0 -0
  31. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/hatch.toml +0 -0
  32. {vizro_mcp-0.1.1 → vizro_mcp-0.1.2}/src/vizro_mcp/py.typed +0 -0
@@ -0,0 +1,10 @@
1
+ assets
2
+ changelog.d
3
+ tests
4
+ .venv
5
+ .pytest_cache
6
+ __pycache__
7
+ *.pyc
8
+ *.pkl
9
+ *.ipynb
10
+ *.log
@@ -1,3 +1,19 @@
1
+ <a id='changelog-0.1.2'></a>
2
+
3
+ # 0.1.2 — 2025-06-30
4
+
5
+ ## Added
6
+
7
+ - Add Dockerfile for Vizro MCP server to enable containerized local setup. ([#1184](https://github.com/mckinsey/vizro/pull/1184))
8
+
9
+ - Add capability to create custom charts (beyond Plotly Express) with Vizro-MCP. ([#1227](https://github.com/mckinsey/vizro/pull/1227))
10
+
11
+ ## Changed
12
+
13
+ - Update Vizro version to `>=0.1.42`. ([#1227](https://github.com/mckinsey/vizro/pull/1227))
14
+
15
+ - Improve usability of MCP server in IDE environments like Cursor. ([#1227](https://github.com/mckinsey/vizro/pull/1227))
16
+
1
17
  <a id='changelog-0.1.1'></a>
2
18
 
3
19
  # 0.1.1 — 2025-05-15
@@ -0,0 +1,10 @@
1
+ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2
+
3
+ WORKDIR /app
4
+
5
+ COPY pyproject.toml uv.lock ./
6
+ RUN uv sync --frozen --no-install-project --no-dev --no-editable
7
+
8
+ COPY . /app
9
+
10
+ ENTRYPOINT ["uv", "run", "vizro-mcp"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vizro-mcp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: MCP server to help create Vizro dashboards and charts
5
5
  Author: Vizro Team
6
6
  License-File: LICENSE.txt
@@ -14,18 +14,27 @@ Requires-Dist: click>=8.1.7
14
14
  Requires-Dist: httpx>=0.28.1
15
15
  Requires-Dist: mcp[cli]>=1.6.0
16
16
  Requires-Dist: pandas[excel,html,parquet]
17
- Requires-Dist: vizro==0.1.38
17
+ Requires-Dist: vizro>=0.1.42
18
18
  Description-Content-Type: text/markdown
19
19
 
20
- <a href="https://glama.ai/mcp/servers/@mckinsey/vizro">
20
+ <!-- <a href="https://glama.ai/mcp/servers/@mckinsey/vizro">
21
21
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@mckinsey/vizro/badge" />
22
- </a>
22
+ </a> -->
23
23
 
24
24
  # Vizro MCP server
25
25
 
26
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.
27
27
 
28
- ![Vizro MCP Demo](assets/vizro-mcp.gif)
28
+ <img src="assets/vizro-mcp.gif" width="600" alt="Vizro MCP Demo">
29
+
30
+ ### Quick install
31
+
32
+ | Host | Prerequisite | Link | Notes |
33
+ | ----------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
34
+ | [Cursor](https://www.cursor.com/) | [uv](https://docs.astral.sh/uv/getting-started/installation/) | [![Install with UVX in Cursor](https://img.shields.io/badge/Cursor-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://cursor.com/install-mcp?name=vizro-mcp&config=eyJjb21tYW5kIjoidXZ4IHZpenJvLW1jcCJ9) | |
35
+ | [VS Code](https://code.visualstudio.com/) | [uv](https://docs.astral.sh/uv/guides/tools/) | [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=vizro-mcp&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22vizro-mcp%22%5D%7D) | |
36
+ | [Cursor](https://www.cursor.com/) | [Docker](https://www.docker.com/get-started/) | [![Install with Docker in Cursor](https://img.shields.io/badge/Cursor-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://cursor.com/install-mcp?name=vizro-mcp&config=eyJjb21tYW5kIjoiZG9ja2VyIHJ1biAtaSAtLXJtIG1jcC92aXpybyJ9) | For local data access, [mount your data directory](#setup-instructions) |
37
+ | [VS Code](https://code.visualstudio.com/) | [Docker](https://www.docker.com/get-started/) | [![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=vizro-mcp&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Fvizro%22%5D%7D) | For local data access, [mount your data directory](#setup-instructions) |
29
38
 
30
39
  ## Features of Vizro-MCP
31
40
 
@@ -53,23 +62,23 @@ Without Vizro-MCP, if you try to make a dashboard using an LLM, it could choose
53
62
 
54
63
  ## 🛠️ Get started
55
64
 
56
- If you are a **developer** and need instructions for running Vizro-MCP from source, skip to the end of this page to [Development or running from source](#development-or-running-from-source).
57
-
58
- ### Prerequisites
59
-
60
- - [uv](https://docs.astral.sh/uv/getting-started/installation/)
61
- - [Claude Desktop](https://claude.ai/download) or [Cursor](https://www.cursor.com/downloads)
65
+ Vizro-MCP can be run in two ways: using [`uvx`](https://docs.astral.sh/uv/guides/tools/) or using [`Docker`](https://www.docker.com/get-started/). It works with any MCP-enabled LLM client such as Cursor or Claude Desktop.
62
66
 
63
- In principle, the Vizro MCP server works with _any_ MCP enabled LLM applications but we recommend Claude Desktop or Cursor as popular choices.
67
+ If you want to run Vizro-MCP directly from source, skip to the end of this page to [Development or running from source](#development-or-running-from-source).
64
68
 
65
- > 🐛 **Note:** There are currently some known issues with [VS Code](https://code.visualstudio.com/) but we are working on this and hope to have Copilot working soon.
69
+ ### Prerequisites
66
70
 
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.
71
+ - [uv](https://docs.astral.sh/uv/getting-started/installation/) **or** [Docker](https://www.docker.com/get-started/)
72
+ - Any LLM application that supports MCP, such as [Claude Desktop](https://claude.ai/download) or [Cursor](https://www.cursor.com/downloads)
68
73
 
69
74
  ### Setup Instructions
70
75
 
71
76
  The general server config is mostly the same for all hosts:
72
77
 
78
+ #### 1. Set up configuration
79
+
80
+ **Using `uvx`**
81
+
73
82
  ```json
74
83
  {
75
84
  "mcpServers": {
@@ -83,62 +92,78 @@ The general server config is mostly the same for all hosts:
83
92
  }
84
93
  ```
85
94
 
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.
87
-
88
- <details>
89
- <summary><strong>Claude Desktop</strong></summary>
90
-
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).
95
+ **Using `Docker`**
92
96
 
93
97
  ```json
94
98
  {
95
99
  "mcpServers": {
96
100
  "vizro-mcp": {
97
- "command": "uvx",
101
+ "command": "docker",
98
102
  "args": [
99
- "vizro-mcp"
103
+ "run",
104
+ "-i",
105
+ "--rm",
106
+ "--mount",
107
+ "type=bind,src=</absolute/path/to/allowed/dir>,dst=</absolute/path/to/allowed/dir>",
108
+ "--mount",
109
+ "type=bind,src=</absolute/path/to/data.csv>,dst=</absolute/path/to/data.csv>",
110
+ "mcp/vizro"
100
111
  ]
101
112
  }
102
113
  }
103
114
  }
104
115
  ```
105
116
 
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`.
117
+ > To use local data with Vizro-MCP, mount your data directory or directories into the container. Replace `</absolute/path/to/allowed/dir>` (syntax for folders) or `</absolute/path/to/data.csv>` (syntax for files) with the absolute path to your data on your machine. For consistency, it is recommended that the `dst` path matches the `src` path.
118
+
119
+ #### 2. Add the Configuration to MCP enabled LLM applications
120
+
121
+ 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.
122
+
123
+ <details>
124
+ <summary><strong>Claude Desktop</strong></summary>
125
+
126
+ - Add the configuration to your `claude_desktop_config.json` ([found via Developer Settings](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server)).
107
127
 
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:
128
+ - Restart Claude Desktop. After a few moments, you should see the vizro-mcp menu in the settings/context menu:
109
129
 
110
- <img src="assets/claude_working.png" alt="Claude Desktop MCP Server Icon" width="150"/>
130
+ <img src="assets/claude_working.png" alt="Claude Desktop MCP Server Icon" width="300"/>
131
+
132
+ > ⚠️ **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.
111
133
 
112
134
  </details>
113
135
 
114
136
  <details>
115
137
  <summary><strong>Cursor</strong></summary>
138
+ <br >
116
139
 
117
- Add the following to `mcp.json` [found via the Cursor Settings](https://docs.cursor.com/context/model-context-protocol#configuration-locations).
140
+ [![Install with UVX in Cursor](https://img.shields.io/badge/Cursor-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://cursor.com/install-mcp?name=vizro-mcp&config=eyJjb21tYW5kIjoidXZ4IHZpenJvLW1jcCJ9)
118
141
 
119
- ```json
120
- {
121
- "mcpServers": {
122
- "vizro-mcp": {
123
- "command": "uvx",
124
- "args": [
125
- "vizro-mcp"
126
- ]
127
- }
128
- }
129
- }
130
- ```
142
+ - Add the above configuration to your `mcp.json` ([see Cursor Settings](https://docs.cursor.com/context/model-context-protocol#configuration-locations)) or click the button above.
143
+
144
+ - After a short pause, you should see a green light in the MCP menu:
131
145
 
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`.
146
+ ![Cursor MCP Server Icon](assets/cursor_working.png)
133
147
 
134
- Similarly, when using Cursor, after a short pause, you should see a green light in the MCP menu:
148
+ </details>
149
+
150
+ <details>
151
+ <summary><strong>Other MCP Clients</strong></summary>
135
152
 
136
- <img src="assets/cursor_working.png" alt="Cursor MCP Server Icon" width="400"/>
153
+ <br />
154
+
155
+ [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-Install_all-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=vizro-mcp&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22vizro-mcp%22%5D%7D)
156
+
157
+ - Add the configuration as per your client's documentation.
158
+
159
+ - Check your client's documentation for where to place the config and how to verify the server is running.
137
160
 
138
161
  </details>
139
162
 
140
163
  ## 💻 Usage
141
164
 
165
+ The MCP server is designed to get you started on Vizro dashboards and charts by creating beautiful working dashboards based on the core Vizro features. It is not designed to replace a human developer when going beyond the core features, e.g. when building an application that requires custom CSS or bespoke Dash components.
166
+
142
167
  ### Use prompt templates to get specific dashboards quickly
143
168
 
144
169
  Prompt templates are not available in all MCP hosts, but when they are, you can use them to get specific dashboards quickly. To access them (e.g. in Claude Desktop), click on the plus icon below the chat, and choose _`Add from vizro-mcp`_.
@@ -165,7 +190,7 @@ In general, it helps to specify Vizro in the prompt and to keep it as precise (a
165
190
 
166
191
  ### Get a live preview of your dashboard
167
192
 
168
- When the LLM chooses to use the tool `validate_model_config`, and the tool executes successfully, the LLM will return a link to a live preview of the dashboard if only public data accessed via URL is used. By default, the LLM will even open the link in your browser for you unless you tell it not to. In Claude Desktop, you can see the output of the tool by opening the tool collapsible and scrolling down to the very bottom.
193
+ When the LLM chooses to use the tool `validate_dashboard_config`, and the tool executes successfully, the LLM will return a link to a live preview of the dashboard if only public data accessed via URL is used. By default, the LLM will even open the link in your browser for you unless you tell it not to. In Claude Desktop, you can see the output of the tool by opening the tool collapsible and scrolling down to the very bottom.
169
194
 
170
195
  <img src="assets/claude_validate.png" width="300"/>
171
196
 
@@ -187,34 +212,32 @@ Alternatively, you can just ask in the chat, for example:
187
212
 
188
213
  MCP servers are a relatively new concept, and it is important to be transparent about what the tools are capable of so you can make an informed choice as a user. Overall, the Vizro MCP server only reads data, and never writes, deletes or modifies any data on your machine.
189
214
 
190
- In general the most critical part of the process is the `load_and_analyze_data` tool. This tool, running on your machine, will load local or remote data into a pandas DataFrame and provide a detailed analysis of its structure and content. It only uses `pd.read_xxx`, so in general there is no need to worry about privacy or data security.
215
+ In general the most critical part of the process is the `load_and_analyze_data` tool. This tool, running on your machine, will load local or remote data into a pandas DataFrame and provide a detailed analysis of its structure and content. It only uses `pd.read_xxx`, so in general there is no need to worry about privacy or data security. However, you should only run Vizro-MCP locally, not as a hosted server, because there is currently no authentication to manage access.
191
216
 
192
- The second most critical part is the `validate_model_config` tool. This tool will attempt to instantiate the Vizro model configuration and return the Python code and visualization link for valid configurations. If the configuration is valid, it will also return and attempt to open a link to a live preview of the dashboard, which will take you to [PyCafe](https://py.cafe). If you don't want to open the link, you can tell the LLM to not do so.
217
+ The second most critical part is the `validate_dashboard_config` tool. This tool will attempt to instantiate the Vizro model configuration and return the Python code and visualization link for valid configurations. If the configuration is valid, it will also return and attempt to open a link to a live preview of the dashboard, which will take you to [PyCafe](https://py.cafe). If you don't want to open the link, you can tell the LLM to not do so.
193
218
 
194
219
  ## Available Tools (if client allows)
195
220
 
196
221
  The Vizro MCP server provides the following tools. In general you should not need to use them directly, but in special cases you could ask the LLM to call them directly to help it find its way.
197
222
 
198
223
  - `get_vizro_chart_or_dashboard_plan` - Get a structured step-by-step plan for creating either a chart or dashboard. Provides guidance on the entire creation process.
199
- - `get_model_JSON_schema` - Retrieves the complete JSON schema for any specified Vizro model, useful for understanding required and optional parameters.
200
- - `validate_model_config` - Tests Vizro model configurations by attempting to instantiate them. Returns Python code and visualization links for valid configurations.
201
- - `load_and_analyze_csv` - Loads a CSV file from a local path or URL into a pandas DataFrame and provides detailed analysis of its structure and content.
224
+ - `get_model_json_schema` - Retrieves the complete JSON schema for any specified Vizro model, useful for understanding required and optional parameters.
225
+ - `validate_dashboard_config` - Tests Vizro model configurations by attempting to instantiate them. Returns Python code and visualization links for valid configurations.
226
+ - `load_and_analyze_data` - Loads a CSV file from a local path or URL into a pandas DataFrame and provides detailed analysis of its structure and content.
202
227
  - `validate_chart_code` - Validates the code created for a chart and returns feedback on its correctness.
203
228
  - `get_sample_data_info` - Provides information about sample datasets that can be used for testing and development.
204
229
 
205
230
  ## Available Prompts (if client allows)
206
231
 
207
232
  - `create_starter_dashboard` - Use this prompt template to get started with Vizro dashboards.
208
- - `create_EDA_dashboard` - Use this prompt template to create an Exploratory Data Analysis (EDA) dashboard based on a local or remote CSV dataset.
233
+ - `create_dashboard` - Use this prompt template to create a dashboard based on a local or remote CSV dataset.
209
234
  - `create_vizro_chart` - Use this prompt template to create a Vizro styled plotly chart based on a local or remote CSV dataset.
210
235
 
211
236
  ## Development or running from source
212
237
 
213
- If you are a developer, or if you are running Vizro-MCP from source, you need to clone the Vizro repo. To configure the Vizro MCP server details:
214
-
215
- **For Claude**: Add the following to your `claude_desktop_config.json` [found via Developer Settings](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server):
238
+ If you are a developer, or if you are running Vizro-MCP from source, you need to clone the Vizro repo. To configure the Vizro-MCP server details:
216
239
 
217
- **For Cursor**: Add the following to `mcp.json` [found via the Cursor Settings](https://docs.cursor.com/context/model-context-protocol#configuration-locations):
240
+ Add the following to your MCP configuration:
218
241
 
219
242
  ```json
220
243
  {
@@ -1,12 +1,21 @@
1
- <a href="https://glama.ai/mcp/servers/@mckinsey/vizro">
1
+ <!-- <a href="https://glama.ai/mcp/servers/@mckinsey/vizro">
2
2
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@mckinsey/vizro/badge" />
3
- </a>
3
+ </a> -->
4
4
 
5
5
  # Vizro MCP server
6
6
 
7
7
  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.
8
8
 
9
- ![Vizro MCP Demo](assets/vizro-mcp.gif)
9
+ <img src="assets/vizro-mcp.gif" width="600" alt="Vizro MCP Demo">
10
+
11
+ ### Quick install
12
+
13
+ | Host | Prerequisite | Link | Notes |
14
+ | ----------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
15
+ | [Cursor](https://www.cursor.com/) | [uv](https://docs.astral.sh/uv/getting-started/installation/) | [![Install with UVX in Cursor](https://img.shields.io/badge/Cursor-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://cursor.com/install-mcp?name=vizro-mcp&config=eyJjb21tYW5kIjoidXZ4IHZpenJvLW1jcCJ9) | |
16
+ | [VS Code](https://code.visualstudio.com/) | [uv](https://docs.astral.sh/uv/guides/tools/) | [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=vizro-mcp&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22vizro-mcp%22%5D%7D) | |
17
+ | [Cursor](https://www.cursor.com/) | [Docker](https://www.docker.com/get-started/) | [![Install with Docker in Cursor](https://img.shields.io/badge/Cursor-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://cursor.com/install-mcp?name=vizro-mcp&config=eyJjb21tYW5kIjoiZG9ja2VyIHJ1biAtaSAtLXJtIG1jcC92aXpybyJ9) | For local data access, [mount your data directory](#setup-instructions) |
18
+ | [VS Code](https://code.visualstudio.com/) | [Docker](https://www.docker.com/get-started/) | [![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=vizro-mcp&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Fvizro%22%5D%7D) | For local data access, [mount your data directory](#setup-instructions) |
10
19
 
11
20
  ## Features of Vizro-MCP
12
21
 
@@ -34,23 +43,23 @@ Without Vizro-MCP, if you try to make a dashboard using an LLM, it could choose
34
43
 
35
44
  ## 🛠️ Get started
36
45
 
37
- If you are a **developer** and need instructions for running Vizro-MCP from source, skip to the end of this page to [Development or running from source](#development-or-running-from-source).
38
-
39
- ### Prerequisites
40
-
41
- - [uv](https://docs.astral.sh/uv/getting-started/installation/)
42
- - [Claude Desktop](https://claude.ai/download) or [Cursor](https://www.cursor.com/downloads)
46
+ Vizro-MCP can be run in two ways: using [`uvx`](https://docs.astral.sh/uv/guides/tools/) or using [`Docker`](https://www.docker.com/get-started/). It works with any MCP-enabled LLM client such as Cursor or Claude Desktop.
43
47
 
44
- In principle, the Vizro MCP server works with _any_ MCP enabled LLM applications but we recommend Claude Desktop or Cursor as popular choices.
48
+ If you want to run Vizro-MCP directly from source, skip to the end of this page to [Development or running from source](#development-or-running-from-source).
45
49
 
46
- > 🐛 **Note:** There are currently some known issues with [VS Code](https://code.visualstudio.com/) but we are working on this and hope to have Copilot working soon.
50
+ ### Prerequisites
47
51
 
48
- > ⚠️ **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.
52
+ - [uv](https://docs.astral.sh/uv/getting-started/installation/) **or** [Docker](https://www.docker.com/get-started/)
53
+ - Any LLM application that supports MCP, such as [Claude Desktop](https://claude.ai/download) or [Cursor](https://www.cursor.com/downloads)
49
54
 
50
55
  ### Setup Instructions
51
56
 
52
57
  The general server config is mostly the same for all hosts:
53
58
 
59
+ #### 1. Set up configuration
60
+
61
+ **Using `uvx`**
62
+
54
63
  ```json
55
64
  {
56
65
  "mcpServers": {
@@ -64,62 +73,78 @@ The general server config is mostly the same for all hosts:
64
73
  }
65
74
  ```
66
75
 
67
- 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.
68
-
69
- <details>
70
- <summary><strong>Claude Desktop</strong></summary>
71
-
72
- Add the following to your `claude_desktop_config.json` [found via Developer Settings](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server).
76
+ **Using `Docker`**
73
77
 
74
78
  ```json
75
79
  {
76
80
  "mcpServers": {
77
81
  "vizro-mcp": {
78
- "command": "uvx",
82
+ "command": "docker",
79
83
  "args": [
80
- "vizro-mcp"
84
+ "run",
85
+ "-i",
86
+ "--rm",
87
+ "--mount",
88
+ "type=bind,src=</absolute/path/to/allowed/dir>,dst=</absolute/path/to/allowed/dir>",
89
+ "--mount",
90
+ "type=bind,src=</absolute/path/to/data.csv>,dst=</absolute/path/to/data.csv>",
91
+ "mcp/vizro"
81
92
  ]
82
93
  }
83
94
  }
84
95
  }
85
96
  ```
86
97
 
87
- > ⚠️ **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
+ > To use local data with Vizro-MCP, mount your data directory or directories into the container. Replace `</absolute/path/to/allowed/dir>` (syntax for folders) or `</absolute/path/to/data.csv>` (syntax for files) with the absolute path to your data on your machine. For consistency, it is recommended that the `dst` path matches the `src` path.
99
+
100
+ #### 2. Add the Configuration to MCP enabled LLM applications
101
+
102
+ 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.
103
+
104
+ <details>
105
+ <summary><strong>Claude Desktop</strong></summary>
106
+
107
+ - Add the configuration to your `claude_desktop_config.json` ([found via Developer Settings](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server)).
88
108
 
89
- 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:
109
+ - Restart Claude Desktop. After a few moments, you should see the vizro-mcp menu in the settings/context menu:
90
110
 
91
- <img src="assets/claude_working.png" alt="Claude Desktop MCP Server Icon" width="150"/>
111
+ <img src="assets/claude_working.png" alt="Claude Desktop MCP Server Icon" width="300"/>
112
+
113
+ > ⚠️ **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.
92
114
 
93
115
  </details>
94
116
 
95
117
  <details>
96
118
  <summary><strong>Cursor</strong></summary>
119
+ <br >
97
120
 
98
- Add the following to `mcp.json` [found via the Cursor Settings](https://docs.cursor.com/context/model-context-protocol#configuration-locations).
121
+ [![Install with UVX in Cursor](https://img.shields.io/badge/Cursor-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://cursor.com/install-mcp?name=vizro-mcp&config=eyJjb21tYW5kIjoidXZ4IHZpenJvLW1jcCJ9)
99
122
 
100
- ```json
101
- {
102
- "mcpServers": {
103
- "vizro-mcp": {
104
- "command": "uvx",
105
- "args": [
106
- "vizro-mcp"
107
- ]
108
- }
109
- }
110
- }
111
- ```
123
+ - Add the above configuration to your `mcp.json` ([see Cursor Settings](https://docs.cursor.com/context/model-context-protocol#configuration-locations)) or click the button above.
124
+
125
+ - After a short pause, you should see a green light in the MCP menu:
112
126
 
113
- > ⚠️ **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`.
127
+ ![Cursor MCP Server Icon](assets/cursor_working.png)
114
128
 
115
- Similarly, when using Cursor, after a short pause, you should see a green light in the MCP menu:
129
+ </details>
130
+
131
+ <details>
132
+ <summary><strong>Other MCP Clients</strong></summary>
116
133
 
117
- <img src="assets/cursor_working.png" alt="Cursor MCP Server Icon" width="400"/>
134
+ <br />
135
+
136
+ [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-Install_all-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=vizro-mcp&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22vizro-mcp%22%5D%7D)
137
+
138
+ - Add the configuration as per your client's documentation.
139
+
140
+ - Check your client's documentation for where to place the config and how to verify the server is running.
118
141
 
119
142
  </details>
120
143
 
121
144
  ## 💻 Usage
122
145
 
146
+ The MCP server is designed to get you started on Vizro dashboards and charts by creating beautiful working dashboards based on the core Vizro features. It is not designed to replace a human developer when going beyond the core features, e.g. when building an application that requires custom CSS or bespoke Dash components.
147
+
123
148
  ### Use prompt templates to get specific dashboards quickly
124
149
 
125
150
  Prompt templates are not available in all MCP hosts, but when they are, you can use them to get specific dashboards quickly. To access them (e.g. in Claude Desktop), click on the plus icon below the chat, and choose _`Add from vizro-mcp`_.
@@ -146,7 +171,7 @@ In general, it helps to specify Vizro in the prompt and to keep it as precise (a
146
171
 
147
172
  ### Get a live preview of your dashboard
148
173
 
149
- When the LLM chooses to use the tool `validate_model_config`, and the tool executes successfully, the LLM will return a link to a live preview of the dashboard if only public data accessed via URL is used. By default, the LLM will even open the link in your browser for you unless you tell it not to. In Claude Desktop, you can see the output of the tool by opening the tool collapsible and scrolling down to the very bottom.
174
+ When the LLM chooses to use the tool `validate_dashboard_config`, and the tool executes successfully, the LLM will return a link to a live preview of the dashboard if only public data accessed via URL is used. By default, the LLM will even open the link in your browser for you unless you tell it not to. In Claude Desktop, you can see the output of the tool by opening the tool collapsible and scrolling down to the very bottom.
150
175
 
151
176
  <img src="assets/claude_validate.png" width="300"/>
152
177
 
@@ -168,34 +193,32 @@ Alternatively, you can just ask in the chat, for example:
168
193
 
169
194
  MCP servers are a relatively new concept, and it is important to be transparent about what the tools are capable of so you can make an informed choice as a user. Overall, the Vizro MCP server only reads data, and never writes, deletes or modifies any data on your machine.
170
195
 
171
- In general the most critical part of the process is the `load_and_analyze_data` tool. This tool, running on your machine, will load local or remote data into a pandas DataFrame and provide a detailed analysis of its structure and content. It only uses `pd.read_xxx`, so in general there is no need to worry about privacy or data security.
196
+ In general the most critical part of the process is the `load_and_analyze_data` tool. This tool, running on your machine, will load local or remote data into a pandas DataFrame and provide a detailed analysis of its structure and content. It only uses `pd.read_xxx`, so in general there is no need to worry about privacy or data security. However, you should only run Vizro-MCP locally, not as a hosted server, because there is currently no authentication to manage access.
172
197
 
173
- The second most critical part is the `validate_model_config` tool. This tool will attempt to instantiate the Vizro model configuration and return the Python code and visualization link for valid configurations. If the configuration is valid, it will also return and attempt to open a link to a live preview of the dashboard, which will take you to [PyCafe](https://py.cafe). If you don't want to open the link, you can tell the LLM to not do so.
198
+ The second most critical part is the `validate_dashboard_config` tool. This tool will attempt to instantiate the Vizro model configuration and return the Python code and visualization link for valid configurations. If the configuration is valid, it will also return and attempt to open a link to a live preview of the dashboard, which will take you to [PyCafe](https://py.cafe). If you don't want to open the link, you can tell the LLM to not do so.
174
199
 
175
200
  ## Available Tools (if client allows)
176
201
 
177
202
  The Vizro MCP server provides the following tools. In general you should not need to use them directly, but in special cases you could ask the LLM to call them directly to help it find its way.
178
203
 
179
204
  - `get_vizro_chart_or_dashboard_plan` - Get a structured step-by-step plan for creating either a chart or dashboard. Provides guidance on the entire creation process.
180
- - `get_model_JSON_schema` - Retrieves the complete JSON schema for any specified Vizro model, useful for understanding required and optional parameters.
181
- - `validate_model_config` - Tests Vizro model configurations by attempting to instantiate them. Returns Python code and visualization links for valid configurations.
182
- - `load_and_analyze_csv` - Loads a CSV file from a local path or URL into a pandas DataFrame and provides detailed analysis of its structure and content.
205
+ - `get_model_json_schema` - Retrieves the complete JSON schema for any specified Vizro model, useful for understanding required and optional parameters.
206
+ - `validate_dashboard_config` - Tests Vizro model configurations by attempting to instantiate them. Returns Python code and visualization links for valid configurations.
207
+ - `load_and_analyze_data` - Loads a CSV file from a local path or URL into a pandas DataFrame and provides detailed analysis of its structure and content.
183
208
  - `validate_chart_code` - Validates the code created for a chart and returns feedback on its correctness.
184
209
  - `get_sample_data_info` - Provides information about sample datasets that can be used for testing and development.
185
210
 
186
211
  ## Available Prompts (if client allows)
187
212
 
188
213
  - `create_starter_dashboard` - Use this prompt template to get started with Vizro dashboards.
189
- - `create_EDA_dashboard` - Use this prompt template to create an Exploratory Data Analysis (EDA) dashboard based on a local or remote CSV dataset.
214
+ - `create_dashboard` - Use this prompt template to create a dashboard based on a local or remote CSV dataset.
190
215
  - `create_vizro_chart` - Use this prompt template to create a Vizro styled plotly chart based on a local or remote CSV dataset.
191
216
 
192
217
  ## Development or running from source
193
218
 
194
- If you are a developer, or if you are running Vizro-MCP from source, you need to clone the Vizro repo. To configure the Vizro MCP server details:
195
-
196
- **For Claude**: Add the following to your `claude_desktop_config.json` [found via Developer Settings](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server):
219
+ If you are a developer, or if you are running Vizro-MCP from source, you need to clone the Vizro repo. To configure the Vizro-MCP server details:
197
220
 
198
- **For Cursor**: Add the following to `mcp.json` [found via the Cursor Settings](https://docs.cursor.com/context/model-context-protocol#configuration-locations):
221
+ Add the following to your MCP configuration:
199
222
 
200
223
  ```json
201
224
  {
@@ -16,7 +16,7 @@ classifiers = [
16
16
  dependencies = [
17
17
  "httpx>=0.28.1",
18
18
  "mcp[cli]>=1.6.0",
19
- "vizro==0.1.38", # keep in sync with version in create_pycafe_url in utils.py
19
+ "vizro>=0.1.42",
20
20
  "click>=8.1.7",
21
21
  "pandas[html,parquet,excel]"
22
22
  ]
@@ -3,7 +3,7 @@ import sys
3
3
 
4
4
  from .server import mcp
5
5
 
6
- __version__ = "0.1.1"
6
+ __version__ = "0.1.2"
7
7
 
8
8
 
9
9
  def main():
@@ -0,0 +1,11 @@
1
+ from .schemas import (
2
+ AgGridEnhanced,
3
+ ChartPlan,
4
+ GraphEnhanced,
5
+ )
6
+
7
+ __all__ = [
8
+ "AgGridEnhanced",
9
+ "ChartPlan",
10
+ "GraphEnhanced",
11
+ ]