@@ -32,6 +32,7 @@ import (
3232 "github.com/charmbracelet/catwalk/pkg/catwalk"
3333 "github.com/charmbracelet/crush/internal/agent/hyper"
3434 "github.com/charmbracelet/crush/internal/agent/tools"
35+ "github.com/charmbracelet/crush/internal/agent/tools/mcp"
3536 "github.com/charmbracelet/crush/internal/config"
3637 "github.com/charmbracelet/crush/internal/csync"
3738 "github.com/charmbracelet/crush/internal/message"
@@ -167,6 +168,21 @@ func (a *sessionAgent) Run(ctx context.Context, call SessionAgentCall) (*fantasy
167168 largeModel := a.largeModel.Get()
168169 systemPrompt := a.systemPrompt.Get()
169170 promptPrefix := a.systemPromptPrefix.Get()
171+ var instructions strings.Builder
172+
173+ for _, server := range mcp.GetStates() {
174+ if server.State != mcp.StateConnected {
175+ continue
176+ }
177+ if s := server.Client.InitializeResult().Instructions; s != "" {
178+ instructions.WriteString(s)
179+ instructions.WriteString("\n\n")
180+ }
181+ }
182+
183+ if s := instructions.String(); s != "" {
184+ systemPrompt += "\n\n<mcp-instructions>\n" + s + "\n</mcp-instructions>"
185+ }
170186
171187 if len(agentTools) > 0 {
172188 // Add Anthropic caching to the last tool.