Token导航 LogoToken导航

MCP Server · 文档知识

D3 MCP Server

提供D3.js API文档和示例代码的搜索服务,帮助AI代理快速获取D3.js相关资源。

stdio官方级别未说明来源级核验工具 5
API文档PythonClaude搜索工具

快速开始

作者 / 组织
jakeb-grant
提供方
jakeb-grant
运行时
Python

工具数量

5

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

1

仓库热度

收录来源

1 个

MCP World

选型结论

D3 MCP Server 属于文档知识类 MCP Server,公开资料标注 5 个工具,通过stdio 本地进程接入,适配 Claude,有可以直接复制的安装命令;接入前先确认权限范围。

分类

文档知识

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

uv run fastmcp dev inspector d3_mcp_server/server.py --with-editable .

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 5 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

d3 mcp服务器

MCP服务器,为AI代理提供D3.js API文档和示例代码。从以下位置获取文档 d3js.org 以及来自 可观察的D3画廊,通过可搜索的工具为他们提供服务。

设置

需要Python 3.14+和 紫外线.

克劳德代码

claude mcp add -t stdio -s user d3 -- uvx --from git+https://github.com/jakeb-grant/d3-mcp-server d3-mcp-server

克劳德桌面/光标等。

{
  "mcpServers": {
    "d3": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/jakeb-grant/d3-mcp-server", "d3-mcp-server"]
    }
  }
}

更新中

uvx 缓存已安装的版本。要获取最新数据,请清除缓存并重新运行:

uv cache clean d3-mcp-server

MCP检查员

uv run fastmcp dev inspector d3_mcp_server/server.py --with-editable .

工具

find_module(query?)

探索D3模块。不带查询,列出所有30个模块。通过查询,返回按名称、标签和描述相关性排名的前5个匹配项。

find_module()                → list all modules
find_module("scale")         → modules related to scales
find_module("color")         → d3-color, d3-scale-chromatic, d3-interpolate

get_docs(module_name, page?)

获取模块的文档。默认情况下返回模块概述或特定子页面。

get_docs("d3-scale")              → scale overview + list of sub-pages
get_docs("scale")                 → same (short names work)
get_docs("d3-scale", "linear")    → linear scales sub-page
get_docs("d3-array", "ticks")     → ticks sub-page

search_docs(query, module_name?)

在文档内容中搜索特定主题或方法。可选范围为单个模块。

search_docs("scaleLinear")              → searches across relevant modules
search_docs("domain", "d3-scale")       → searches within d3-scale only

find_example(query?, category?)

从Observable库中浏览和搜索14个类别(条形图、线条、地图、层次结构等)的约170个D3示例。

find_example()                    → list all categories with counts
find_example(query="treemap")     → search examples by keyword
find_example(category="Bars")     → list all examples in a category

get_example(path)

从Observable笔记本中获取示例源代码。从笔记本格式中提取干净、独立的D3代码,以及描述和数据文件URL。

get_example("@d3/bar-chart/2")           → bar chart source code
get_example("@d3/force-directed-graph/2") → force-directed graph source

建筑

d3_mcp_server/
├── __init__.py    # Entry point (main)
├── server.py      # FastMCP server, tools, resource template
├── modules.py     # D3Module model + 30-module registry
├── examples.py    # Observable gallery scraping + notebook code extraction
├── cache.py       # File cache (~/.cache/d3-mcp-server/) + HTML→markdown
├── search.py      # Module scoring + markdown section parsing/search
└── sync.py        # Registry drift detection (see below)
tests/
├── test_examples.py # Gallery parsing, scoring, notebook extraction tests
├── test_search.py   # Search, parsing, module resolution tests
├── test_cache.py    # HTML conversion, caching, fetch error handling
└── test_server.py   # Tool integration tests

文档页面从d3js.org获取,剥离到 `` 内容,通过markdownify转换为markdown,并以24小时TTL缓存到磁盘。

注册表同步

中的模块注册表 modules.py 是硬编码的。如果d3js.org添加、删除或重命名模块或页面,注册表将漂移。同步实用程序检测到这一点。

检查漂移情况

uv run python -m d3_mcp_server.sync

这会抓取d3js.org/api侧边栏,并将其与硬编码的进行比较 D3_MODULES 列表、报告:

  • d3js.org上的新模块不在注册表中
  • 注册表中不再存在于d3js.org上的模块
  • 添加到现有模块的新子页面
  • d3js.org上不再存在的注册表子页

更新注册表

当检测到漂移时,更新 d3_mcp_server/modules.py 遵循这些规则:

D3_MODULES 是要编辑的列表。 每个条目都是一个 D3Module 与:

  • name --模块名称与d3js.org上显示的完全一致(例如。 "d3-array")
  • description --简短摘要(从d3js.org侧栏或模块索引页面复制)
  • tags -用于搜索评分的小写关键字(包括简短名称、API关键术语和相关概念)
  • pages --页面路径的有序列表;第一个条目始终是模块索引页("/d3-array"),后面是子页面("/d3-array/ticks")

对于新模块,添加a D3Module 进入 D3_MODULES。将其按字母顺序放置在现有条目中,或将其与相关模块分组。填充 tags 具有简短的模块名称和来自模块描述和API方法的3-8个相关关键字。

对于已拆卸的模块,删除整个 D3Module 进入。

对于新页面,将页面路径附加到模块的 pages 列表。路径格式为 "/{module_name}/{page_slug}" 其中slug与d3js.org URL匹配。

对于已删除的页面,从模块中删除页面路径 pages 列表。

编辑后,验证:

uv run python -m d3_mcp_server.sync   # should report no drift
uv run pytest tests/ -v               # all tests should pass
uvx ruff check d3_mcp_server/ tests/  # no lint errors

发展

uv run pytest tests/ -v                              # run tests
uvx ruff check d3_mcp_server/ tests/                 # lint
uvx ruff format d3_mcp_server/ tests/                # format
uv run python -m d3_mcp_server.sync                  # check registry drift
uv run fastmcp dev inspector d3_mcp_server/server.py --with-editable .  # MCP inspector

工具与能力

工具数量

5

资源数量

0

提示词数量

0

能力标签

API文档Python本地部署D3.js示例代码搜索工具AI辅助

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

读长文档提问

把 PDF、Markdown 和笔记交给模型,按章节追问细节。

整理知识库

把零散资料归档、打标签,检索时更容易命中。

批量出摘要

提取要点,输出能直接引用的段落。

选择建议

值得选的地方

  • 只提供 5 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在文档知识场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
D3 MCP Server

MCP World · 本页

5stdio有1 个2026-05-17
Cherry Studio

MCP World

0未说明未标注1 个2026-05-17
Pdf Math Translate

MCP World

0stdio有1 个2026-05-17
report generation

MCP World

0stdio有1 个2026-05-17
Anything To Notebooklm

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

D3 MCP Server 怎么安装?

公开资料给出的安装命令是 uv run fastmcp dev inspector d3_mcp_server/server.py --with-editable .,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

D3 MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

D3 MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

D3 MCP Server 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

D3 MCP Server 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP