feat(mcp): gate meta-function emission on advertised server capabilities

Per-server McpServerFeatures (tools fail-open, resources/prompts
fail-closed) now drive which meta-functions are declared, with
gated_meta_function_prefixes as the single gating seam; read/prompt
declarations land together with their handlers. The server-enablement
sentinel keys on the always-emitted search name so resources-only
servers survive role filtering.

Implements plans/mcp-resources-prompts-design.md §4.4/D7 (T5).
This commit is contained in:
2026-08-25 11:37:41 -06:00
parent ef88b6a2c8
commit 437512fd6d
8 changed files with 433 additions and 87 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ use crate::config::prompts::{
};
use crate::graph::types::RagNode;
use crate::graph::{Graph, GraphParser, NodeType};
use crate::mcp::McpServerFeatures;
use crate::rag::RagInitConfig;
use crate::vault::SECRET_RE;
use anyhow::{Context, Result};
@@ -380,7 +381,7 @@ impl Agent {
self.graph_rags.get(node_id).cloned()
}
pub fn append_mcp_meta_functions(&mut self, mcp_servers: Vec<String>) {
pub fn append_mcp_meta_functions(&mut self, mcp_servers: Vec<McpServerFeatures>) {
self.functions.append_mcp_meta_functions(mcp_servers);
}