---
name: iblai-connect-salesforce-government-cloud
description: "Read and write Salesforce Government Cloud data through the Salesforce REST API (same platform APIs); Public Sector Solutions objects and expose it to an ibl.ai agent as an MCP tool. Use when the user asks an agent to work with Salesforce Government Cloud data, or to set up a Salesforce Government Cloud MCP connection on ibl.ai."
metadata:
  kind: guide
---

# Salesforce Government Cloud connector for AI agents

> A starting point maintained on ibl.ai at https://ibl.ai/developer/connectors/salesforce-government-cloud — not part of the iblai/vibe repository. Checked against Salesforce's documentation on October 20, 2026; test it against your own Salesforce Government Cloud setup before you rely on it.

Salesforce Government Cloud and Government Cloud Plus run the Salesforce platform in an isolated environment for U.S. agencies and contractors. Holds constituent cases, applications, licenses, inspections, grants and benefits records.

## Auth & conventions

- **API:** Salesforce REST API (same platform APIs); Public Sector Solutions objects (REST). REST API reads, creates, updates and deletes sObject records, runs SOQL queries and searches, and reports org limits. Public Sector Solutions adds standard objects such as IndividualApplication and BusinessLicense.
- **Base URL:** https://{MyDomainName}.my.salesforce.com/services/data/vXX.X/
- **Access:** Issued by your administrator. An admin of the Government Cloud org creates an External Client App or connected app and grants API-enabled users access. Government Cloud orgs use their own login host, not login.salesforce.com; confirm it with the admin.
- **Auth:** OAuth 2.0 via External Client App or connected app; Bearer access token. Clients authorize through an OAuth 2.0 flow on an External Client App or connected app and send the access token as Authorization: Bearer. Calls run with the user's object, field and sharing permissions.
- **Limits:** Each org has API request allocations; the REST limits resource reports current usage. Responses default to JSON.
- Keep Salesforce Government Cloud credentials in environment variables or the ibl.ai credential store. Never print a token in chat and never commit one to a file.
- Destructive or outward-facing calls are marked **Confirm with the user first** — do.

## Reads

- **Records (sObjects)** — GET /services/data/vXX.X/sobjects/{Object}/{Id} for standard and custom objects.
- **SOQL query results** — Query and search resources return records matching SOQL or SOSL.
- **Applications and licenses** — Public Sector objects such as IndividualApplication and BusinessLicense.
- **Object metadata** — Describe resources return fields and relationships for an object.
- **Org limits** — The limits resource reports the org's API and storage allocations.

## Writes

- **Create records** — POST to /sobjects/{Object}/ creates a record, such as a case or application.
- **Update records** — PATCH /sobjects/{Object}/{Id} updates field values.
- **Delete records** — DELETE /sobjects/{Object}/{Id} removes a record. **Confirm with the user first.**

## Expose it to an ibl.ai agent (MCP)

Salesforce Hosted MCP Servers are generally available for commercial orgs, but Salesforce's Government Cloud documentation says they are not yet supported in Government Cloud. Host a small MCP server that wraps the calls above, then register it below.

First install the ibl.ai platform skills and connect your organization (writes `IBLAI_ORG`, `IBLAI_USERNAME` and `IBLAI_API_KEY` to `.env`):

```bash
npx skills add iblai/vibe --all
# then, in your coding agent:
/iblai-api-login
```

Every call below sends `Authorization: Api-Token $IBLAI_API_KEY`.

1. **Register the server** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-servers/` with `name`, `url`, `transport` (`sse` | `websocket` | `streamable_http`) and `auth_type` (`none` | `token` | `oauth2`). Capture the returned `id`.
   - For an API key or service credential use `auth_type=token` with `auth_scope=platform` for one key across the organization, or scope it to a single agent for one key per agent.
2. **Create the connection** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-server-connections/` with `server`, `scope` (`platform` | `mentor` | `user`), `auth_type`, and either `credentials` + `authorization_scheme` or a `connected_service` id for OAuth. Credentials are masked on read; never send a masked value back.
3. **Enable it on the agent** — `GET https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentors/{agent_id}/settings/`, add `mcp-tool` to `tool_slugs` and the server id to `mcp_servers`, then `PATCH` the full lists back. They are replaced, not merged.

Full reference: https://ibl.ai/developer/platform/mcp/mcp-connections and the `/iblai-api-agent-mcp` skill.

## Example prompts

- "List permit applications submitted this week that are still awaiting review"
- "Show open constituent cases older than 30 days by department"
- "Update the status of business license BL-10422 to Active"
- "Count benefit applications by county for this quarter"

## Guardrails

- Agency records often hold PII and CUI; some hold tax or criminal justice data. Salesforce's compliance site lists Government Cloud Plus as FedRAMP High; confirm which environment your org uses.
- Request the narrowest Salesforce Government Cloud scopes or role the task needs, and prefer a read-only credential for agents that only answer questions.
- Return the fields the user asked for, not whole records; do not paste personal data into chat that the user did not request.
- Before any write, show the user exactly what will change and wait for a yes.
- Respect the documented limits above: page through results and back off on rate-limit responses instead of retrying in a loop.

## References

- REST API Developer Guide: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm
- Public Sector Data Models: https://developer.salesforce.com/docs/atlas.en-us.psc_api.meta/psc_api/psc_data_models_overview.htm
- Government Cloud Plus compliance: https://compliance.salesforce.com/en/services/salesforce-government-cloud-plus-hyperforce
- This connector on ibl.ai: https://ibl.ai/developer/connectors/salesforce-government-cloud
- ibl.ai MCP server connections: https://ibl.ai/developer/platform/mcp/mcp-connections
