Goose

Connect Block's Goose development assistant to BitRouter for MCP integration

Goose Integration

Quick Start

# 1. Start BitRouter with MCP gateway
bitrouter acp --enable-mcp

# 2. Configure Goose
goose config set provider.base_url http://localhost:8787
goose config set mcp.gateway bitrouter

# 3. Launch Goose
goose --provider bitrouter

What You Get

  • 70+ MCP extensions - All through BitRouter's gateway
  • 25+ LLM providers - Unified access via BitRouter
  • Recipe system - Reusable workflows with smart routing
  • ACP integration - Seamless IDE support
  • Enterprise backing - Block/Square supported, Linux Foundation hosted

Installation

Prerequisites

# Install Goose (choose one)
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash
# Download desktop app for macOS/Linux/Windows

Connect to BitRouter

Choose your method:

Option 1: Desktop App

# ~/.goose/config.yaml
provider:
  type: custom
  base_url: http://localhost:8787
mcp:
  gateway: bitrouter
  gateway_url: http://localhost:8787/mcp

Option 2: CLI Configuration

goose config set provider.base_url http://localhost:8787
goose config set mcp.gateway bitrouter
goose --provider bitrouter

Option 3: ACP for IDEs

# Configure for IDE integration
goose config set acp.enabled true
goose config set acp.server http://localhost:8787
# Use in Zed, JetBrains, VS Code via ACP

Essential Configuration

MCP Gateway Setup

# ~/.bitrouter/config.yaml
mcp:
  goose:
    enabled: true
    gateway: true
    servers:
      # Development tools
      - name: github
        command: npx @modelcontextprotocol/server-github
        route: "goose/mcp/github"
      - name: filesystem
        command: npx @modelcontextprotocol/server-filesystem
        route: "goose/mcp/fs"
      # Cloud providers
      - name: aws
        command: npx @modelcontextprotocol/server-aws
        route: "goose/mcp/aws"

Recipe System Integration

recipes:
  goose:
    - name: "code-review"
      route: "goose/recipe/review"
      model: claude-3-5-sonnet-latest
      steps: [analyze_code, check_practices, suggest_improvements]
    - name: "test-generation"
      route: "goose/recipe/test"
      model: gpt-4o
      steps: [analyze_functions, generate_unit_tests]
    - name: "refactor"
      route: "goose/recipe/refactor"
      model: deepseek-coder
      steps: [identify_smells, propose_refactoring]

Multi-Provider Routing

routes:
  # Primary Goose operations
  - match: "goose/*"
    provider: anthropic
    model: claude-3-5-sonnet-latest
    
  # MCP tool calls
  - match: "goose/mcp/*"
    provider: openai
    model: gpt-4o
    features:
      tool_calling: true
      
  # Local models
  - match: "goose/local/*"
    provider: ollama
    endpoint: http://localhost:11434

Common Recipes

Recipe: MCP Tool Chains

tool_chains:
  goose:
    - name: "full-stack-deploy"
      route: "goose/chain/deploy"
      chain:
        - tool: git
          action: pull_latest
        - tool: docker
          action: build_image
        - tool: kubernetes
          action: deploy_service

Recipe: IDE Integration

// Zed settings.json
{
  "assistant": {
    "provider": "acp",
    "acp_url": "http://localhost:8787/acp",
    "agent": "goose"
  }
}

Recipe: Automation Workflows

workflows:
  goose:
    - name: "pr-review"
      trigger: pull_request
      route: "goose/workflow/pr"
      steps: [code-review, test-generation, security-scan]

MCP Extensions

# Development tools
bitrouter mcp install --agent goose git docker kubernetes

# Data sources
bitrouter mcp install --agent goose sqlite mongodb elasticsearch

# Communication
bitrouter mcp install --agent goose slack email discord

# Cloud providers
bitrouter mcp install --agent goose aws gcp azure

Monitoring

MCP Tool Usage

# Monitor MCP tools
bitrouter mcp stats --agent goose

# Tool call traces
bitrouter mcp trace --agent goose --tool github

# Export metrics
bitrouter mcp export --agent goose --format json

Recipe Performance

# Analyze recipes
goose recipes analyze --backend bitrouter

# Recipe metrics
bitrouter recipes stats --agent goose

# Optimize routing
bitrouter recipes optimize --agent goose

Troubleshooting

🔴 MCP Server Failures

# Check MCP status
goose mcp status

# Verify gateway
curl http://localhost:8787/mcp/health

# Restart servers
goose mcp restart --all

🟡 Recipe Execution Errors

# Debug recipe
goose recipes debug --name code-review

# Check routing
bitrouter routes test "goose/recipe/review"

# View logs
bitrouter logs --filter "goose/recipe"

🔵 ACP Connection Issues

# Test ACP endpoint
curl http://localhost:8787/acp/status

# Verify config
goose config show acp

# Test IDE connection
goose acp test --ide vscode

Advanced Features

Docker Model Runner

docker_models:
  goose:
    enabled: true
    runners:
      - name: llama-cpp
        image: ghcr.io/ggerganov/llama.cpp:latest
        route: "goose/docker/llama"
      - name: vllm
        image: vllm/vllm-openai:latest
        route: "goose/docker/vllm"

Custom Extensions

// Custom Goose extension
import { Extension } from '@goose/sdk';

export class BitRouterExtension extends Extension {
  name = 'bitrouter-integration';
  
  async initialize(goose, bitrouter) {
    goose.on('request', async (req) => {
      const route = this.determineRoute(req);
      return bitrouter.route(route, req);
    });
  }
}

Learn More

How is this guide?

Last updated on

On this page