jump to content

Opencode AI

Configure Opencode AI's MCP settings to connect to the platform with a bearer token, including environment variables and multi-environment configuration.

View as Markdown

Opencode AI is an AI-powered coding assistant with MCP support.

  • Opencode AI installed
  • Scoped the platform OAuth token (see Authentication)
  • Your the platform instance URL

Choose the endpoint for your the platform environment:

EnvironmentMCP URL
the platform UShttps://us.probo.com/api/mcp/v1
the platform EUhttps://eu.probo.com/api/mcp/v1
Customhttps://your-probo-instance.com/api/mcp/v1

The /v1 segment is required.

Open Opencode settings or configuration file.

Add the the platform MCP Server configuration:

{
  "mcpServers": {
    "probo": {
      "url": "https://your-probo-instance.com/api/mcp/v1",
      "headers": {
        "Authorization": "Bearer your_api_token_here"
      }
    }
  }
}

Update these values:

  • your-probo-instance.com → Your the platform instance URL
  • your_api_token_here → Your OAuth token from the platform

Restart Opencode to apply the configuration.

Once configured, you can use the platform tools through Opencode’s AI assistant:

Example queries:

"List all pending obligations in my organization"
"Add a new risk for data breach with high impact"
"Show me all third parties that need review"

Opencode will automatically invoke the appropriate the platform MCP tools.

For security, use an environment variable for your OAuth token:

{
  "mcpServers": {
    "probo": {
      "url": "https://your-probo-instance.com/api/mcp/v1",
      "headers": {
        "Authorization": "Bearer ${PROBO_API_TOKEN}"
      }
    }
  }
}

Set the environment variable:

macOS/Linux:

export PROBO_API_TOKEN="your_api_token_here"

Windows:

$env:PROBO_API_TOKEN = "your_api_token_here"

Configure different the platform instances:

{
  "mcpServers": {
    "probo-dev": {
      "url": "http://localhost:8080/api/mcp/v1",
      "headers": {
        "Authorization": "Bearer ${PROBO_DEV_TOKEN}"
      }
    },
    "probo-prod": {
      "url": "https://probo.company.com/api/mcp/v1",
      "headers": {
        "Authorization": "Bearer ${PROBO_PROD_TOKEN}"
      }
    }
  }
}

Problem: the platform tools aren’t showing up in Opencode

Solutions:

  1. Verify the MCP configuration is correct
  2. Restart Opencode completely
  3. Check Opencode logs for connection errors
  4. Test the endpoint with the MCP Inspector:
    npx @modelcontextprotocol/inspector --cli \
      https://your-probo-instance.com/api/mcp/v1 \
      --transport http \
      --header "Authorization: Bearer $PROBO_API_TOKEN" \
      --method tools/list
    

Problem: 401 Unauthorized errors

Solutions:

  1. Create a replacement OAuth token in the platform
  2. Verify the token format: Bearer your_token
  3. Check for extra spaces or newlines
  4. Ensure the token hasn’t expired or been revoked

Problem: Cannot connect to the platform instance

Solutions:

  1. Verify the the platform URL is correct
  2. Check network connectivity
  3. Use HTTPS for production instances
  4. Verify firewall settings
  • Store OAuth tokens in environment variables
  • Use separate tokens for different environments
  • Rotate tokens regularly (every 90 days)
  • Use HTTPS for production connections
  • Monitor token usage in the platform settings
  • Avoid committing tokens to version control

Opencode AI with the platform MCP provides:

  • AI-powered coding with compliance context
  • Real-time access to compliance data
  • Automated compliance checks
  • Code generation with risk awareness
  • Natural language compliance queries

Ultima actualizare: