Commit Graph

1 Commits (06eeb95b4e050ede712ef16fb6053e4fa5fcfbde)

Author SHA1 Message Date
01luyicheng 54c4309c65 feat(mcp-server): add create_knowledge_from_text tool
Add an MCP tool that creates a knowledge entry from raw Markdown text by
calling the existing backend endpoint
POST /knowledge-bases/{id}/knowledge/manual (handler.CreateManualKnowledge).
This completes the "text" half of #323, whose "file" half was already
covered by create_knowledge_from_file.

The tool defaults to status="publish" so the created entry is chunked,
embedded and made searchable immediately — matching the API/MCP use case
where there is no UI to publish a draft. Callers may pass status="draft"
to save without indexing.

- New client method WeKnoraClient.create_knowledge_from_text.
- New @mcp.tool() create_knowledge_from_text, resolving kb_id by name or
  UUID (consistent with create_session / hybrid_search).
- Add focused unittests verifying endpoint, request body shape, status
  default/override, and kb_id resolution wiring.
- Bump the stdio tools-list count assertion in test_mcp_transports.py
  from 29 to 30 for the newly registered tool.
2026-08-05 19:25:25 +08:00