feat(mcp): separate direct order queries from wiki tools

Add an opt-in business group with schema, template, guarded SQL, and status tools. Reuse existing order statistics through read-only SQLite connections without OpenCode or wiki retrieval.

Add tools set for switching enabled groups with one restart. Gate file diagnostics with file-assets and document business-only operation while retaining the independent Kingdee sync task.

Validation: 217 unit tests passed; business tool tests rerun after read-only annotations. Live authenticated MCP schema/status/template/SQL calls passed, ask_wiki was unavailable, uploads returned 404, and unauthenticated requests returned 401.
This commit is contained in:
Codex
2026-10-31 06:47:43 +00:00
parent 1133e2bf50
commit 6c451c3eb6
10 changed files with 500 additions and 44 deletions
+2
View File
@@ -126,6 +126,8 @@ See `wiki-query` and `wiki-export` skills for how the filter is applied.
## File Asset Indexing
- **Keep business MCP independent.** The opt-in `business` group exposes direct schema/template/guarded-SQL/status tools without Wiki retrieval or OpenCode. `scripts/mcp_service.sh tools set business` disables Wiki query, file assets, and ingest together while preserving order access. Business MCP reads the existing SQLite database through read-only connections; the separate Kingdee sync task owns updates. Preserve configured internal-party exclusions and sync freshness metadata. `OBSIDIAN_MCP_BUSINESS_DB` or `--business-db` selects an existing business database independently of the file-asset index.
- **Index source files as richly as possible.** When writing `_meta/source-registry.jsonl` or rebuilding `_meta/file-assets.sqlite`, preserve structured identifiers instead of relying only on filenames or summaries.
- **Keep product lookup fields explicit.** Carry forward `bjd_part_numbers`, `competitor_part_numbers`, `series`, `pitch`, `pin_count`, `product_lines`, `customers`, `competitors`, `standards`, `business_categories`, `related_pages`, and `catalog_paths` whenever they are known.
- **Merge, do not overwrite.** Automatic identifier extraction may add terms, but it must not discard curated registry metadata. Registry values are the durable source for future index rebuilds and remote MCP lookup.