Skip to main content

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 examples
  • d3-docs://d3-indepth - In-depth D3.js guide and documentation
  • d3-docs://d3-org - Official D3.js documentation
  • d3-search://query - Search across all D3 documentation
  • d3-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 format
  • features (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 data
  • purpose (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 want
  • dataExample (string): Example of your data structure

analyze-data

Analyze data and get visualization suggestions.

Parameters:

  • data (string): Your data in JSON or CSV format
  • goal (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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_d3_server-1.0.2.tar.gz (563.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_d3_server-1.0.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_d3_server-1.0.2.tar.gz.

File metadata

  • Download URL: mcp_d3_server-1.0.2.tar.gz
  • Upload date:
  • Size: 563.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for mcp_d3_server-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f9681cc95bd2c574bca77307c34d348757ea5d82053464d8bd66453365ae3232
MD5 ff316d2756ebe506b9f50ed8a22c4576
BLAKE2b-256 5ae1113c1c0ca33789bb700ea953653ac19d425bb0b3ca10e611e405384d500b

See more details on using hashes here.

File details

Details for the file mcp_d3_server-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_d3_server-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d199e338be917a6288ad20e5aa860cbbf3a04bf78d0bb4e438241bb62411598c
MD5 d0f08179583409260543f0be7c75d85a
BLAKE2b-256 bf8bd7baeaa3c65cf8fa639563e3834b0449ae003628682183eec9c3d9533726

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page