# Connect Goose to SAM.gov data

To connect Goose to SAM.gov data, add a remote extension of type streamable_http with uri https://samgovapi.io/api/mcp and an Authorization: Bearer header, either through goose configure (Add Extension, Remote Extension (Streamable HTTP), add custom headers) or directly in ~/.config/goose/config.yaml.

Goose treats MCP servers as extensions. The interactive goose configure flow asks for the endpoint and then offers to add custom headers, which is where the key goes. The --with-streamable-http-extension session flag cannot carry headers, so use the saved extension instead.

- Connects with: MCP
- MCP server: https://samgovapi.io/api/mcp
- REST base: https://samgovapi.io/api/v1
- Auth: Authorization: Bearer <key>, kept in SAMGOVAPI_API_KEY

## Get a key

Free key at https://samgovapi.io/sign-up, or have the agent call start_signup and approve the link it shows you. Goose stores the header value in config.yaml. Keep that file private, or rotate the key from your dashboard if it leaks.

## Set up Goose

1. Run the configure flow: Choose Add Extension, then Remote Extension (Streamable HTTP). Name it samgovapi, give the endpoint URI, a timeout such as 300, and a description. Answer yes to adding custom headers: name Authorization, value Bearer followed by your key.

Terminal:

```bash
goose configure
```

2. Or write config.yaml: The configure flow writes an entry like this. Goose documents literal header values; paste the key in place of the placeholder.

~/.config/goose/config.yaml:

```yaml
extensions:
  samgovapi:
    name: samgovapi
    type: streamable_http
    enabled: true
    uri: https://samgovapi.io/api/mcp
    headers:
      Authorization: "Bearer sg_..."
    timeout: 300
```

3. Start a session: The extension loads in every new session; ask Goose which samgovapi tools it has.

Terminal:

```bash
goose session
```

## Finish account setup once

Data tools unlock after the account answers its onboarding questions: ask the agent to set up your samgovapi account (get_onboarding_questions, then answer_onboarding). Free.

## Check that it works

Ask: "Is UEI ZXBCU6K5KL99 registered in SAM.gov, and when does its registration expire?"

Expected tool call:

```json
{"name":"registration_status","arguments":{"id":"ZXBCU6K5KL99","user_request":"check a registration and its expiry"}}
```

## Things to know

- The --with-streamable-http-extension flag and goose:// deeplinks have no header parameter, so they cannot authenticate to this server; keyless search and fetch still work through them.

## Troubleshooting

- The extension fails to start: Check type is streamable_http and the field is uri, not url.
- Data tools say the key is missing: Re-run goose configure, edit the extension and add the Authorization header.
- ONBOARDING_REQUIRED: Ask Goose to answer the samgovapi onboarding questions; it is a one-time step.

## Questions

### Can Goose use the server without a key?

Yes, for the keyless tools: search and fetch over the public pages, signup and feedback. Data tools need the header.

## Official documentation

- Goose: using extensions: https://goose-docs.ai/docs/getting-started/using-extensions/
- Goose: configuration files: https://goose-docs.ai/docs/guides/config-files/

Checked 2026-11-13. All guides: https://samgovapi.io/agents.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.
