datuma_k

io.github.marthvon由 GitHub 账号 marthvon 发布v1.0.0更新于 Oct 24, 2026

Query, validate, preview, and generate source from *.dtct data contracts and *.ngin templates.

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

本地 MCP 服务器,让助手在项目中查询、校验、预览并基于 datuma_k 数据契约与模板生成源码。

可以做什么
列出项目目录以及契约和模板路径,可指定根目录。按 trait、model、field、attribute 或 type 查询契约目录。校验契约与模板,需要项目中的关键字文件。预览生成计划而不写入任何内容。根据模板生成源码并写入生成的片段。给出何时使用 ngin 模板而非手写代码的建议,并推断 trait、widget、关联说明、同步风险和别名等模式。读取内置的 dtct、ngin 与规范语言资源及实践文档。
适用场景
适用于使用 datuma_k 数据契约和 ngin 模板的代码仓库,希望助手查看契约目录、检查契约、试运行生成,或搭建新的模型与字段时。
运行要求
通过 npx 从 npm 包以 stdio 在本地运行,需要 Node.js。必须已安装 datuma_k 二进制并位于 PATH 中,或通过 DATUMA_K 环境变量提供其绝对路径。进程工作目录应为包含 .env 的 datuma_k 项目目录,或在每次工具调用时传入 root。
安装前请注意
generate 工具会向项目写入生成的源码,运行前应先查看预览结果。服务器会读取项目的 .env 和关键字文件,因此只应指向愿意让助手访问的仓库。它依赖单独安装的二进制,其行为不受本服务器控制。

安装

在 SourceWeft 中

  1. 打开 控制台中的 datuma_k,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

datuma_k MCP

stdio MCP server for agents using the installed datuma_k binary in an app repo. It does not link the compiler crate. Set DATUMA_K to the binary if it is not on PATH.

Install

Published to npm as @marthvon/datuma-k-mcp and to the MCP Registry as io.github.marthvon/datuma-k.

Cursor / Claude example (mcp.json):

json
{  "mcpServers": {    "datuma_k": {      "command": "npx",      "args": ["-y", "@marthvon/datuma-k-mcp"]    }  }}

datuma_k must be on PATH. If it is not, point DATUMA_K at the binary:

json
{  "mcpServers": {    "datuma_k": {      "command": "npx",      "args": ["-y", "@marthvon/datuma-k-mcp"],      "env": {        "DATUMA_K": "/ABS/PATH/TO/datuma_k/target/release/datuma_k"      }    }  }}

From source

bash
cd mcpnpm installnpm run build

Then use "command": "node" with "args": ["/ABS/PATH/TO/datuma_k/mcp/dist/index.js"].

The process cwd should be the datuma_k project (the directory with .env), or pass root on each tool call.

Tools

ToolBinaryNotes
list_project(files + .env)Directories and contract/template paths
query_contractsdatuma_k catalogOptional trait / model / field / attribute / type
validatedatuma_k checkParse + data/keywords.md required
previewdatuma_k previewPlan without writing
generatedatuma_k runWrites generated spans
advise_ngin(local rules)When to use ngin vs handwritten code
infer_patternscatalog + keywords.mdTraits, widgets, association review notes, sync risks, aliases

Resources

  • datuma://language/dtct
  • datuma://language/ngin
  • datuma://language/standards
  • datuma://docs/keywords
  • datuma://docs/practices
  • datuma://docs/when-ngin

Prompts

add-model, add-field, scaffold-ngin, should-use-ngin, infer-contract-patterns

Tests

bash
npm test

Publishing

Two registries, in this order. npm hosts the tarball; the MCP Registry hosts only metadata and verifies it against the published npm package, so npm must go first or the second publish fails with Registry validation failed for package.

NameWhereSet in
@marthvon/datuma-k-mcpnpm packagepackage.json name
io.github.marthvon/datuma-kMCP Registry serverpackage.json mcpName and server.json name — these two must match, or the registry rejects the publish

The io.github.marthvon/ prefix is not cosmetic: GitHub device-flow auth only grants that namespace. A different prefix needs DNS or HTTP auth.

One-time setup

bash
brew install mcp-publisher            # or a binary from the registry releases pagenpm login                             # npm account, scope @marthvon

npm requires 2FA to publish. If the account does not have it, npm publish fails with 403 ... Two-factor authentication or granular access token with bypass 2fa enabled is required, before it ever looks at the tarball. Check with npm profile get; enable with npm profile enable-2fa auth-and-writes or on npmjs.com, and keep the recovery codes.

Release

Bump the version in three places — the registry rejects a version it has already seen, and a mismatch between the npm package version and server.json packages[0].version fails verification:

  • package.json → version
  • server.json → version
  • server.json → packages[0].version

Then:

bash
npm test                              # tsc + node --testmcp-publisher validate                # checks server.json against the live registry, publishes nothingnpm publish --otp=123456              # prepublishOnly runs the build; drop --otp to be promptedmcp-publisher login github            # device code → github.com/login/devicemcp-publisher publish

mcp-publisher login persists a token, so day-to-day releases are npm publish then mcp-publisher publish.

Verify:

bash
npm view @marthvon/datuma-k-mcp versioncurl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.marthvon/datuma-k"

What ships

files in package.json limits the tarball to dist, resources, and README.md. resources/ is required at runtime — server.ts resolves it as dist/../resources — so dropping it from files produces a package that installs cleanly and fails on every resource read. Confirm with npm pack --dry-run before publishing.

Troubleshooting

ErrorCause
403 ... Two-factor authentication ... is required2FA disabled on the npm account. See above.
403 ... you do not have accessThe @marthvon scope belongs to an org; confirm membership with npm org ls marthvon.
Registry validation failed for packagenpm publish did not happen yet, or mcpName in package.json does not match name in server.json.
Invalid or expired Registry JWT tokenRe-run mcp-publisher login github.
You do not have permission to publish this serverServer name does not start with io.github.<your-github-username>/.
expected length <= 100 on body.descriptionserver.json description is capped at 100 characters. The npm description is not.

来源:mcp/README.md,提交 1e55220

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分