Adding SAP Business One MCP Server to Goose¶
Vigencia por confirmar: guía del ejemplo de referencia de SAP, escrita para desarrollo local. En Compulandia el servidor corre en Cloud Run y los usuarios se conectan desde Claude (ver Runbook).
This guide provides step-by-step instructions for connecting the B1 MCP Server to Goose using OAuth 2.0 authentication and testing it with SAP Business One Service Layer.
- Adding SAP Business One MCP Server to Goose
- What is Goose?
- Prerequisites
- Keycloak Setup for Goose
- Add the MCP Server to Goose
- Authenticate
- Select a Company
- Examples
- Troubleshooting
What is Goose?¶
Goose is an extensible open-source AI agent that runs on your machine. Unlike IDE-embedded assistants, Goose works as a standalone agent — available as a desktop app, CLI, and API — and can handle code, research, writing, automation, data analysis, and more. It supports the Model Context Protocol (MCP), which means any MCP server can be added as an extension to expand what Goose can do.
Prerequisites¶
- Goose >= 1.38.0 installed (desktop app). See https://goose-docs.ai/docs/getting-started/installation for installation instructions.
- The B1 MCP server is running in
AUTHENTICATION_MODE=oauthand reachable (e.g.https://localhost:3000/mcp). - SAP B1 Service Layer and SLD are configured and accessible.
- Keycloak realm configured with the
b1_mcp:accessscope — see Keycloak setup. Step 4 (trusted hosts for Dynamic Client Registration) is required for Goose.
Keycloak Setup for Goose¶
Goose has a built-in OAuth 2.0 Authorization Code + PKCE flow. When it connects to an OAuth-protected MCP server, it automatically discovers the authorization endpoints from /.well-known/oauth-protected-resource and opens a browser window for login. Goose registers itself in Keycloak automatically at runtime using OAuth 2.0 Dynamic Client Registration (RFC 7591) — no manual client registration is required.
For the complete four-step Keycloak configuration (client scope, audience mapper, trusted hosts), see Keycloak setup.
Add the MCP Server to Goose¶
- Open the Goose desktop app.
- Click Extensions in the sidebar.
- Click Add custom extension.
- Fill in the extension details:
| Field | Value |
|---|---|
| Name | b1-mcp-server |
| Type | Streamable HTTP |
| Description | SAP Business One MCP Server |
| Endpoint | https://localhost:3000/mcp |
| Timeout | 10000 |
- Click Add Extension and confirm the extension is enabled.
Authenticate¶
When Goose first calls the MCP server, it detects the OAuth metadata and initiates the PKCE flow automatically:
- Goose opens your browser to the Keycloak login page.

- Log in with your SAP B1 credentials and grant access to Goose

- Keycloak redirects back to Goose with an authorization code, which Goose exchanges for an access token automatically.

Select a Company¶
Once authenticated, select a company before calling any entity tools:
- Ask Goose:
List available SAP Business One companies - Goose calls
b1_list_companiesand returns the companies your user is entitled to access.

- Ask Goose:
Select company SBODEMOUS(use theCompanySchemaNamefrom the previous step) - Goose calls
b1_select_companyto bind the session to that company.

All subsequent entity tool calls will use the selected company context.
Examples¶
Once connected and a company is selected, you can interact with SAP Business One data using natural language. Goose follows the 3-step discovery pattern automatically.
Read Sensitive Data¶
- Ask Goose: Get the card code, card name, address, zip code, credit limit of the business partner with card code = 'BA01'
- Goose calls
b1_find_entitiesto locate theBusinessPartnersentity. - Goose calls
b1_get_entity_schemato retrieve the schema and available properties for theBusinessPartnersentity. - Goose calls
b1_readto retrieve the requested properties for the specified business partner.

Troubleshooting¶
Authentication failures¶
- Confirm the server is running:
curl http://localhost:3000/health - Verify the endpoint URL in the extension config matches the running server address.
- Restart Goose after making configuration changes.
- Check Keycloak trusted hosts configuration if authentication fails with a host verification error — see Keycloak setup.
- If the OAuth flow still fails or token expires, try the following recovery steps in order:
- Clear your browser cache and cookies.
- Restart the MCP server.
- Remove and re-add the extension in Goose.
- Restart Goose.
Write operations blocked¶
- If
MCP_HUMAN_CONFIRMATION_ENABLED=true, Goose will display an elicitation confirmation prompt before write operations. Approve the prompt to proceed, or setMCP_HUMAN_CONFIRMATION_ENABLED=falsein.envfor automated pipelines.