Available tools
8 tools| Tool | Description |
|---|---|
searchExports | US exports by HS or NAICS code, country, month. Auto-routes to /exports/hs vs /exports/naics. Default COMM_LVL=HS4. |
searchImports | US imports by HS or NAICS code, country, month. Auto-routes to /imports/hs vs /imports/naics. Default COMM_LVL=HS4. |
searchTradeByPort | HS commodity × US port × country (porths). Filter by 4-digit port code (5301=Houston, 4601=NY/NJ). |
searchTradeByState | HS commodity × US state × country (statehs). Filter by 2-letter state postal (TX, CA, LA). |
getTradeBalance | Fetches both directions in parallel, returns {exportsValue, importsValue, balance} for an HS code + time slice. |
getCountryCodes | Built-in CTY_CODE↔ISO lookup. Top 30 US trading partners + USMCA / OECD / NATO / APEC rollups. No upstream call. |
lookupHsCode | Built-in HS chapter index for petroleum (27), petrochem (28/29/39), iron/steel (72/73), machinery (84/85), ores (26). |
getServiceInfo | Endpoints, common variables, country-code system, asymmetric value-field warning, and time-format options. |
Setup
A few steps to connect your AI agents to US Foreign Trade.
- 1
Toggle Connector On
Open /mcp and enable US Foreign Trade with the toggle, no credentials needed.
- 2
Start Querying
Call searchImports with hsCode: '2709' (crude petroleum) and time: '2024-01' to surface the top US suppliers and dollar values for the month. getTradeBalance with hsCode: '2710' and countryCode: '2010' (Mexico) returns net trade for the year. searchTradeByState with state: 'TX' and hsCode: '2711' surfaces LNG exports out of Texas.
- 3
Optional: Raise Tier Limits
Register at https://api.census.gov/data/key_signup.html for a free access key and set CENSUS_API_KEY in your Vercel environment to raise the rate limit from 500 calls/day per IP.
Connect to your AI assistant
Pick the tool your team uses for the exact setup steps.
- 1
Open Claude settings
Launch Claude, click the profile button (bottom left), and go to Settings.
- 2
Access connectors
Open the Connectors tab, scroll to the bottom, and click “Add custom connector”.
- 3
Name your connector
Enter any name you’d like for this connector.
- 4
Get the connector URL
Log in to PatchOps, open the /mcp page, and copy the connector URL you want to use.
- 5
Add the connector
Paste the URL into the “Remote MCP server URL” box and click Add.
- 6
Start using
Your US Foreign Trade connector is ready to use in Claude.
