文档存储工具

一个用于验证、自动校正和存储文档JSON的工具,适用于项目文件夹中的文档管理。

  • by JungleDome
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 JungleDome/mcp-docstore

使用说明

MCP DocStore工具(验证+自动更正+写入)

一个小小的 MCP工具 食品法典委员会可以致电 验证, 自动校正,以及 商店 将文档JSON放入项目文件夹。它处理:

  • ID生成(FS-…, TDR-…, BIZ-…)
  • 带时间戳的文件名
  • 模式验证(AJV)+轻度自动更正(字段别名、复选框删除、默认值)
  • 写信至:
  • docs/feature-specs/
  • docs/tech-decisions/
  • docs/biz-decisions/

安装并运行

npm i
npm run build
# Option A: run directly (stdio)
node dist/server.js
# Option B: package as a binary and point Codex CLI to it via MCP server config

Codex CLI集成(示例)

在 .codex/config.toml 您可以注册服务器(语法取决于您的CLI版本):

[model]
name = "gpt-5"


[prompt]
system = ".codex/prompts/system.md"


[mcp_servers.docstore]
command = "node"
args = ["dist/server.js"]         # relative to cwd below
cwd = "D:\\Projects_2\\MCP\\mcp-docstore"  # folder containing dist/server.js

如果您的CLI对MCP服务器使用不同的格式,请将其指向 node dist/server.js.

系统提示代码段(与Codex CLI一起使用)

For each instruction, decide action_type ∈ { feature_add | feature_detail | technical_decision | business_decision | none }.
If none → respond briefly that no documentation is needed and do not call tools.
Otherwise:
1) Draft minimal JSON for the relevant artifacts (FeatureSpec / TDR / BizDecision). IDs and dates may be omitted.
2) Call tool `doc.store` with { action_type, feature?, tdr?, biz? }.
3) If the tool responds ok=false with validation errors, repair your JSON and call `doc.store` once more.
4) Return the tool’s `written` paths.
Output only a short confirmation and the relative file paths.

输入合同 doc.store

{
"action_type": "feature_add|feature_detail|technical_decision|business_decision",
"feature": { "title": "…", "context": "…", "user_stories": ["…"], "acceptance_criteria": ["…"] },
"tdr": { "decision": "…", "status": "proposed|accepted|rejected|deprecated", "context": "…", "options": ["…"], "pros": ["…"], "cons": ["…"], "consequences": "…" },
"biz": { "decision": "…", "context": "…", "assumptions": ["…"], "expires_on": "YYYY-MM-DD" },
"project_root": "/absolute/path/optional"
}