dimctx
dimctx = dimensional modeling context provider 一个本地 MCP server,让你的 AI 编码助手在写数仓代码时拥有维度建模的判断力。
它解决什么
AI 写 SQL/DDL 时会瞎编建模决策:分不清事实和维度、猜不准粒度、不知道哪些维度该跨表一致。
dimctx 把这些判断交给确定性引擎 + 你自己的方法论语料。
四个工具:
| 工具 | 作用 |
|---|---|
analyze_table |
判定表角色(fact/dimension)、粒度键、SCD 建议、总线矩阵格值 |
search_canon |
检索你自备的建模语料(本地 markdown) |
bus_matrix |
总线矩阵查询(单表格值 / 单维度实现 / 全库概览) |
measure_sql |
度量下游取数复杂度(CASE WHEN / JOIN 深度 / 子查询 / 聚合嵌套) |
三步接入
# 1) 配置(可选,缺省也能跑:只是语料检索为空)
export DIMCTX_ATLAS=/path/to/atlas.json # 工程表图谱(可选)
export DIMCTX_CANON_DIR=/path/to/markdown # 你自备的建模语料(可选)
# 2) 在 IDE 的 MCP 配置里加一条
# VS Code (mcp.json) / Cursor (.cursor/mcp.json) / Continue (config.yaml)
{"command": "uvx", "args": ["dimctx"]}
# 3) 让 AI 用它
# 「用 dimctx 看看 dt_batch 是什么表、粒度是什么」
数据边界(重要)
- 纯本地 stdio:无网络出口、无遥测、无云服务、不做托管;
- 不打包任何第三方内容:语料由你自备(详见
docs/DATA-POLICY.md与NOTICE); - 未配置语料时
search_canon返回空并提示配置,不会报错、不会联网索取。
开发
uv run --with pytest --with pydantic python -m pytest tests/ -q # 19 passed
许可
代码 AGPL-3.0-or-later(见 LICENSE)。本项目与 Kimball Group 无关联、未获其背书; 文档中提及 Kimball 方法论属指名性合理使用(nominative fair use)。
Metadata
Release files for dimctx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dimctx-0.1.0.tar.gz | 33.7 kB | Without provenance | Details for dimctx-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dimctx-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for dimctx-0.1.0-py3-none-any.whl |
Total release size: 68.4 kB
Release files / dimctx-0.1.0.tar.gz
| Download URL | dimctx-0.1.0.tar.gz |
|---|---|
| Size | 33.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
556963a60a214aebfb5761c3a61cbb7a84af98d058edcbc0551a682f4c6eb67e
|
|
BLAKE2b-256 checksum How to use checksums |
a8944d08cb63e2a96e61fc7b7ba0184ad31ff42e6f0d94d92fc5a7f63105e82e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / dimctx-0.1.0-py3-none-any.whl
| Download URL | dimctx-0.1.0-py3-none-any.whl |
|---|---|
| Size | 34.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
187a232062c8acfb47372ef8b5212c84af0b821243df2e67f567a35a72aa3557
|
|
BLAKE2b-256 checksum How to use checksums |
06d645d7d23800b8747e985bbb0784becf3fde75d82db16812423941f2e67155
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for dimctx 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.