Learn how to use the MCP Gateway SDK to securely connect to integrated MCP Servers through TrueFoundry AI Gateway.
Copy the code snippet
Get your code snippet from the AI Gateway UI
Copy the code snippet from the UI for quick integration
Copy PAT or VAT
Call the MCP Server from your code
Parameter | Description |
---|---|
url | The MCP server URL (e.g., https://<controlPlaneUrl>/api/llm/mcp-server/<integrationId>/server ) |
authToken | Your TrueFoundry API token (PAT or user token) |
toolName | The name of the tool you want to invoke |
args | The arguments to pass to the tool |
<controlPlaneUrl>
with your TrueFoundry control plane URL<integrationId>
with your MCP server ID<tfy-api-token>
with your TrueFoundry API token<tool-name>
with the name of the tool you want to use/agent/responses
endpoint but are not compatible with the proxy connection method described here