A Python MCP server for D3.js visualization information and chart generation
Project description
MCP D3 Server (Python)
A Python-based MCP (Model Context Protocol) server that provides D3.js visualization information, chart generation, and documentation resources. This is a Python port of the original Node.js MCP D3 server with STDIO support for use with uv and other Python package managers.
Features
- D3.js Documentation Resources: Access to curated D3.js documentation and examples
- Chart Generation Tools: Generate D3.js chart code for various chart types (bar, line, etc.)
- AI-Powered Chart Creation: Use AI to generate custom D3 visualizations based on descriptions
- Data Analysis: Analyze data and get visualization recommendations
- STDIO Transport: Compatible with MCP clients using stdio transport
Installation
Using uv (recommended)
cd mcp-d3-server-python
uv sync
Using pip
cd mcp-d3-server-python
pip install -e .
Usage
Running as STDIO MCP Server
# Using uv
uv run mcp-d3-server
# Using pip-installed package
mcp-d3-server
Configuration for MCP Clients
Add to your MCP client configuration:
{
"mcpServers": {
"d3-visualization": {
"command": "uv",
"args": ["run", "mcp-d3-server"],
"cwd": "/path/to/mcp-d3-server-python"
}
}
}
Available Resources
d3-docs://d3-gallery- D3.js gallery and examplesd3-docs://d3-indepth- In-depth D3.js guide and documentationd3-docs://d3-org- Official D3.js documentationd3-search://query- Search across all D3 documentationd3-topic://topic[/section]- Get information about specific D3 topics
Available Tools
generate-d3-chart
Generate D3.js chart code based on chart type and data format.
Parameters:
chartType(string): Type of chart (bar, line, pie, etc.)dataFormat(string): Description of your data formatfeatures(array, optional): Additional features to include
recommend-chart
Get chart type recommendations based on your data and visualization goals.
Parameters:
dataDescription(string): Description of your datapurpose(string): What insights you want to gain
ai-generate-d3
Use AI to generate custom D3.js visualizations.
Parameters:
description(string): Describe the chart you wantdataExample(string): Example of your data structure
analyze-data
Analyze data and get visualization suggestions.
Parameters:
data(string): Your data in JSON or CSV formatgoal(string): What you want to learn from the data
Development
Setup Development Environment
cd mcp-d3-server-python
uv sync --extra dev
Running Tests
uv run pytest
Code Formatting
uv run black src/
uv run ruff check src/
Type Checking
uv run mypy src/
Project Structure
mcp-d3-server-python/
├── src/
│ └── mcp_d3_server/
│ ├── __init__.py
│ ├── server.py # Main MCP server with STDIO support
│ ├── services.py # Service implementations
│ └── types.py # Type definitions
├── assets/
│ └── llm-full/ # D3 documentation files
├── pyproject.toml # Python package configuration
└── README.md
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_d3_server-1.0.1.tar.gz.
File metadata
- Download URL: mcp_d3_server-1.0.1.tar.gz
- Upload date:
- Size: 563.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f11fb61ddad2bcda67d608842f70b5d7ebad8d456e3730dd15f4f42601570c9d
|
|
| MD5 |
9ec32d376606d766579f9a3c70a36138
|
|
| BLAKE2b-256 |
371f9df1275ed60c7610980f1c1518267e8cb065c9dd66068b0b4ddedfd25f0b
|
File details
Details for the file mcp_d3_server-1.0.1-py3-none-any.whl.
File metadata
- Download URL: mcp_d3_server-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac9655f053f982333bf44f5fe931284150d2057110f3f898de8ba22d621777ca
|
|
| MD5 |
8cfde4b43ec10e3523f7a456d5088b43
|
|
| BLAKE2b-256 |
d10039026d5cc23629d5c8907e55140a4b14b8e5b68c80abe0856b0b9559db25
|