Embedding Fastn UCL onto your AI Agent
This guide will take you through each step, from setting up your environment to seamlessly integrating your tools into your environment.
Embedding refers to integrating Fastn UCL directly into your AI agent’s environment so it can take real actions, like sending messages, updating records, or triggering workflows, using your connected tools.
When you’re integrating Connectors into your SaaS product, Fastn Unified Command Layer (UCL) makes it easy to connect 1000+ tools (Actions), manage customer environments, and orchestrate real-world actions from a single command layer.
In this guide, we will walk you through step by step from setting up your space to fully embedding your tools into your environment, including but not limited to:
Setting up your account on Fastn UCL
Enabling your connectors and actions
Connecting your Fastn MCP server
Implementing it onto your application/product
Real-World Example: Document Management Workflow
When a marketing team creates a new campaign brief, a single Fastn UCL command automatically:
Creates a new project document in Notion
Shares the brief via Gmail to stakeholders
Sets up a dedicated Slack channel for discussions
Creates a collaborative Google Doc for content drafts
How Embedding Works?
Embedding via Fastn UCL refers to the process of integrating the UCL functionality directly into your product or AI agent's codebase. This allows your application to seamlessly interact with external tools and services through Fastn's unified interface.
This is how your AI agent looks with and without Fastn UCL embedding:
The embedding process enables you to:
Execute commands across multiple tools without managing individual integrations
Handle authentication and permissions across different customer workspaces
Maintain secure tenant separation while accessing various third-party services
Manage API connections and token storage through a single interface
Let's further understand embedding via a use case example below:
Step 1: Creating Your Fastn UCL Account
After you log in, you can select a workspace, after which you'll be directed to the next page to set up your integrations.
Step 2: Enabling Connectors & Selecting Actions
Navigate to the Connect setup section to choose from more than a hundred apps (e.g., Slack, Google Docs, Jira, Notion, Salesforce) and 1000+ actions (e.g., send email, create task, update database, generate report, schedule meeting).
Select your desired connector (or app) and allow the respective authorization.
Once you have connected, you will see the “Connected” button highlighted in green as shown below:
Once you have selected your connectors, selected your desired actions and click on the confirmation button below as shown.
For each app you connect, UCL automatically provides a set of supported actions.
Fastn UCL handles all OAuth and API token management in the background.
Step 3: Setting Up Your Environment
Within this step, we’ll focus on setting up your codebase environment where you can embed Fastn UCL easily, to ensure an easy-to-follow process, you can find an example environment repository to clone below:
If you wish to run the code locally on your code editor, simply follow the README documentation within the GitHub repository.
Environment via Code Editor
Please ensure that you've read the ReadMe file in the GitHub repository before starting.
Click on the code button to download the ZIP file.
After downloading, open the file in your respective code editor.
Setting up your Keys and IDs
Once you've set up your code environment, you'll see a .env file that consists of three environment variables:
Head back to the .env file and insert your generated API key within the OPENAI_API_KEY environment variable.
Click on the Integrate section, copy the command, and paste it into the FASTN_MCP_SERVER_URL:
Scroll to the bottom of the Integrate page and you will see an assets section which contains the Space ID and an API key:
Head back to the .env file in the code editor and copy paste the SPACE ID and paste in the FASTN_SPACE_ID variable.
Then head over to your code editor and in the lib folder, you will find a file named config.ts, simply place the same Space ID in the config.ts file as shown below:
Setting up your Agent Connect UI
The next step is to integrate the Agent Connect UI onto your app, which is primarily an npm package provided by Fastn UCL that allows you to plug and play your connectors and tools easily.
However, for tutorial purposes, you'll find the Agent Connect UI code within the components folder, already implemented in your environment.
As shown below in the file:
Step 4: Implementation
Now that you've set up everything, you'll now see Fastn UCL embedded in action, simply follow the steps below:
Head over to your code editor, open your terminal, write and execute command:
Once you have executed the command, you will see a local host site showcasing UCL embedded within an AI agent, where you can put your connectors and tools to test as shown below:
Additionally, in the Tools section of the demo app, you can also see the actions that you have enabled for each connector as shown below:
Environment via Codespaces - Alternative Method
Codespaces provides a complete, pre-configured development environment in the cloud, allowing you to start coding instantly without worrying about local setup or dependencies.
Simply access the repository → Click on Code → Then click on “Create codespace on main”
After creating a codespace environment you’ll see a live code editor waiting for you
Conclusion
Fastn UCL simplifies the process of embedding AI capabilities into your applications by providing a unified layer for connecting tools and managing multi-tenant workflows. Through its MCP server and Agent Connect component, developers can quickly implement secure, scalable integrations across different customer workspaces while maintaining proper isolation and authentication.
Next Steps:
Last updated
Was this helpful?