Allow named MCP servers in Claude stages
Add validated per-stage MCP allowlists while keeping builtin tools separate. Enable matching Claude Code permission rules only for Claude stages, reject unsupported harnesses, and document the unattended-stage safety model.
This commit is contained in:
@@ -9,7 +9,8 @@ import (
|
||||
)
|
||||
|
||||
func TestToolsBlockPersistenceAndAdapter(t *testing.T) {
|
||||
source := strings.Replace(Template([]string{"one"}, true), "```tools\n```", "```tools\nwebsearch\nwebfetch\n```", 1)
|
||||
source := strings.Replace(Template([]string{"one"}, true), "```tools\n```", "```tools\nmcp:ai-memory\nmcp:linear/list_issues\n```", 1)
|
||||
source = strings.Replace(source, "provider=opencode-go", "provider=anthropic\nharness=claude", 1)
|
||||
store, err := Open(filepath.Join(t.TempDir(), "tools.db"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -25,10 +26,10 @@ func TestToolsBlockPersistenceAndAdapter(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
tools, explicit, err := stage.ToolNames(StageDefinition(d.Graph.Stages[0]))
|
||||
if err != nil || !explicit || len(tools) != 2 || tools[0] != "websearch" {
|
||||
if err != nil || !explicit || len(tools) != 2 || tools[0] != "mcp:ai-memory" || tools[1] != "mcp:linear/list_issues" {
|
||||
t.Fatal("tool allowlist lost", tools, explicit, err)
|
||||
}
|
||||
if _, err := Parse(strings.Replace(source, "websearch\nwebfetch", "websearch\nunknown", 1)); err == nil {
|
||||
if _, err := Parse(strings.Replace(source, "mcp:ai-memory\nmcp:linear/list_issues", "mcp:bad name", 1)); err == nil {
|
||||
t.Fatal("unknown tool accepted")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user