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.0.tar.gz (563.9 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.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_d3_server-1.0.0.tar.gz
  • Upload date:
  • Size: 563.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for mcp_d3_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 76ef0720eb2286d401d3d9b1bd66544dca85248d8e5e5c8072255b37feb78b16
MD5 d8703c8fa1a27880f3bc602818e6afcb
BLAKE2b-256 83a1b5734b1840943990204d9dc5c99865d6113a8136283df787b4825bb6c2f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcp_d3_server-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for mcp_d3_server-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8346a7e8bb882f91991d1d2dc3d742600f0477dab22713204d6eaeae5395faa
MD5 8ae0d8ecaed954c70f07af7bb5292af7
BLAKE2b-256 03e44e6f3b9ddc07438920690ac39ff9e35d01cfe27f62be1d68811ca8d00667

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