Skip to content

Commit 2f0fcb7

Browse files
committed
✨ Support Model Context Protocol (MCP) #13795
Signed-off-by: Daniel <845765@qq.com>
1 parent 186f0b4 commit 2f0fcb7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

kernel/cli/cmd/ref.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var refBacklinksCmd = &cobra.Command{
4444
keyword, _ := cmd.Flags().GetString("keyword")
4545
sortMode, _ := cmd.Flags().GetInt("sort")
4646

47-
_, backlinks, _, count, _ := model.GetBacklink2(id, keyword, "", sortMode, 0, false)
47+
_, backlinks, _, count, _ := model.GetBacklink2(id, keyword, "", sortMode, 0, model.Conf.Editor.BacklinkContainChildren)
4848

4949
switch outputFormat {
5050
case "json":
@@ -71,7 +71,7 @@ var refMentionsCmd = &cobra.Command{
7171
keyword, _ := cmd.Flags().GetString("keyword")
7272
sortMode, _ := cmd.Flags().GetInt("sort")
7373

74-
_, _, backmentions, _, count := model.GetBacklink2(id, "", keyword, 0, sortMode, false)
74+
_, _, backmentions, _, count := model.GetBacklink2(id, "", keyword, 0, sortMode, model.Conf.Editor.BacklinkContainChildren)
7575

7676
switch outputFormat {
7777
case "json":

kernel/mcp/tools/ref.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func refBacklinks(args map[string]interface{}) (CallToolResult, error) {
6262
id, _ := args["id"].(string)
6363
keyword, _ := args["keyword"].(string)
6464

65-
_, backlinks, _, _, _ := model.GetBacklink2(id, keyword, "", 0, 0, false)
65+
_, backlinks, _, _, _ := model.GetBacklink2(id, keyword, "", 0, 0, model.Conf.Editor.BacklinkContainChildren)
6666
if len(backlinks) == 0 {
6767
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "no backlinks found"}}}, nil
6868
}
@@ -79,7 +79,7 @@ func refMentions(args map[string]interface{}) (CallToolResult, error) {
7979
id, _ := args["id"].(string)
8080
keyword, _ := args["keyword"].(string)
8181

82-
_, _, mentions, _, _ := model.GetBacklink2(id, "", keyword, 0, 0, false)
82+
_, _, mentions, _, _ := model.GetBacklink2(id, "", keyword, 0, 0, model.Conf.Editor.BacklinkContainChildren)
8383
if len(mentions) == 0 {
8484
return CallToolResult{Content: []ContentItem{{Type: "text", Text: "no mentions found"}}}, nil
8585
}

0 commit comments

Comments
 (0)