mcp-unified-context-gateway
Orchestrates dynamic invocation of tooling across diverse service endpoints via a singular, standardized protocol interface, enhancing service integration capabilities for platforms like Slack and Notion.
Author

fastnai
Quick Info
Actions
Tags
Centralized Model Interaction Protocol (MCP) Facade
This component, known as the Unified Context Layer (UCL) Gateway, acts as a multi-tenant intermediary for the Model Context Protocol (MCP). It furnishes AI entities, automated systems, and applications with unified access to an extensive catalog of over 1,000 Software as a Service (SaaS) platforms—including, but not limited to, Slack, Jira, Gmail, Shopify, and Notion—all accessible through one standardized invocation point (/command). UCL abstracts away the burdens of managing disparate SDKs, boilerplate integration code, and complex cross-service authentication routines, empowering developers to construct context-aware, multi-platform automated processes without creating bespoke connectors for every external service.
Core Capabilities
- Broad Ecosystem Support - Seamlessly leverage services such as Slack, Notion, HubSpot, and many others via the Fastn execution environment.
- Adaptable Credential Management - Supports initiation via either explicit API key provision or tenant-scoped security contexts.
- Auditing Features - Comprehensive transaction logging for diagnostic purposes.
- Resilient Fault Tolerance - Advanced mechanisms for managing and recovering from operational exceptions.
Essential Prerequisites
- Execution environment must support Python version 3.10 or newer.
Deployment Pathways
Method A: Artifact Installation (Recommended)
The most straightforward route for deploying the UCL server involves leveraging the Python package manager:
pip install fastn-mcp-server
To ascertain the exact binary path after installation:
- Unix-like systems (macOS/Linux): which fastn-mcp-server
- Windows systems: where fastn-mcp-server
Configuration Post-Installation
Upon successful package installation, configure your environment (e.g., via a settings file):
{
"mcpServers": {
"fastn": {
"command": "fastn-mcp-server",
"args": [
"--api_key",
"YOUR_API_KEY",
"--space_id",
"YOUR_WORKSPACE_ID"
]
}
}
}
Method B: Source Compilation and Local Setup
# Obtain source code and navigate into the root directory
git clone <your-repo-url> && cd fastn-server
# For macOS/Linux: Invoke UV installer, establish a virtual environment, and install dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh && uv venv && source .venv/bin/activate && uv pip install -e .
# For Windows (PowerShell): Invoke UV installer, establish a virtual environment, and install dependencies
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" && uv venv && .venv\Scripts\activate && uv pip install -e .
# Direct dependency resolution
uv pip install "httpx>=0.28.1" "mcp[cli]>=1.2.0"
UCL Account Initialization
- Access your UCL operational account, or register a new one.
- Enable the required service connectors/adapters.
- Navigate to the "Integrate" panel (typically on the left navigation pane) and follow the procedural guidance for linking UCL with your agentic frameworks.
- Alternatively, review the integration section for alternate invocation methodologies.
Server Activation Procedures
The gateway supports initialization via two primary authentication schematics:
Authentication Scheme 1: API Key Authorization
# If installed via package manager
fastn-mcp-server --api_key YOUR_API_KEY --space_id YOUR_WORKSPACE_ID
# If initiated from manual/source installation
uv run fastn-server.py --api_key YOUR_API_KEY --space_id YOUR_WORKSPACE_ID
Authentication Scheme 2: Tenant-Based Credentials
# If installed via package manager
fastn-mcp-server --space_id YOUR_WORKSPACE_ID --tenant_id YOUR_TENANT_ID --auth_token YOUR_AUTH_TOKEN
# If initiated from manual/source installation
uv run fastn-server.py --space_id YOUR_WORKSPACE_ID --tenant_id YOUR_TENANT_ID --auth_token YOUR_AUTH_TOKEN
Agent Interface Linkage Examples
Integration with Claude Assistants
- Locate and open the configuration file for Claude:
- Windows OS:
notepad "%APPDATA%\Claude\claude_desktop_config.json"orcode "%APPDATA%\Claude\claude_desktop_config.json -
macOS:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json -
Inject the necessary configuration stanza:
Configuration for Package Installation
{
"mcpServers": {
"fastn": {
"command": "/path/to/fastn-mcp-server",
"args": [
"--api_key",
"YOUR_API_KEY",
"--space_id",
"YOUR_WORKSPACE_ID"
]
}
}
}
Or, utilizing tenant credentials:
{
"mcpServers": {
"fastn": {
"command": "/path/to/fastn-mcp-server",
"args": [
"--space_id",
"YOUR_WORKSPACE_ID",
"--tenant_id",
"YOUR_TENANT_ID",
"--auth_token",
"YOUR_AUTH_TOKEN"
]
}
}
}
Configuration for Source Installation
Using API Key authorization:
{
"mcpServers": {
"fastn": {
"command": "/path/to/your/uv",
"args": [
"--directory",
"/path/to/your/fastn-server",
"run",
"fastn-server.py",
"--api_key",
"YOUR_API_KEY",
"--space_id",
"YOUR_WORKSPACE_ID"
]
}
}
}
Using Tenant authorization:
{
"mcpServers": {
"fastn": {
"command": "/path/to/your/uv",
"args": [
"--directory",
"/path/to/your/fastn-server",
"run",
"fastn-server.py",
"--space_id",
"YOUR_WORKSPACE_ID",
"--tenant_id",
"YOUR_TENANT_ID",
"--auth_token",
"YOUR_AUTH_TOKEN"
]
}
}
}
Integration within Cursor IDE
- Access Cursor application settings.
- Navigate to the "Tools & Integrations" preference pane and select "Introduce Custom MCP".
- Choose the option to "Register a new MCP server".
- Assign an identifier (e.g., "fastn").
- Return to the UCL portal, find the "Real Time Event Streaming" utility detailed near the footer of the Integrate section.
- Acquire the provided JSON payload and paste it into the
mcp.jsonfile within Cursor, then persist the changes.
Containerized Deployment (Docker)
Phase 1: Runtime Environment Parameterization
Establish a .env file within your primary project directory to hold your UCL authentication parameters:
# Credential Set 1: Standard API Key and Space Identifier
API_KEY=your_actual_api_key
SPACE_ID=your_actual_space_id
# Credential Set 2: Expanded Tenant Context
TENANT_ID=your_tenant_id
AUTH_TOKEN=your_actual_auth_token
# Selector for credential usage mode: "basic" or "extended"
CONFIG_MODE=extended
Phase 2: Image Construction and Initialization
Execute the following command sequence to compile the UCL server image and confirm successful startup:
docker-compose up --build
Phase 3: Configuring AI Frameworks for Container Access
Claude Desktop Configuration
- Open the configuration manifest for Claude Desktop:
- Windows:
notepad "%APPDATA%\Claude\claude_desktop_config.json" -
Mac:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json -
Insert the Docker invocation payload:
{
"mcpServers": {
"ucl": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--env-file", "/path/to/your/fastn-stdio-server/.env",
"ucl-stdio-server"
]
}
}
}
Mandatory Modification: Substitute /path/to/your/fastn-stdio-server/.env with the absolute file system path pointing to your .env configuration file.
Alternative: Direct Environment Variable Injection
For scenarios where utilizing a dedicated file is undesirable:
{
"mcpServers": {
"ucl": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "API_KEY=your_actual_api_key",
"-e", "SPACE_ID=your_actual_space_id",
"-e", "TENANT_ID=your_tenant_id",
"-e", "AUTH_TOKEN=your_actual_auth_token",
"-e", "CONFIG_MODE=extended",
"ucl-stdio-server"
]
}
}
}
Docker Deployment Advantages
- Environment Encapsulation: UCL operates within an isolated, contained runtime sphere.
- Platform Uniformity: Guarantees identical execution conditions across disparate host machines.
- Simplified Local Setup: Eliminates the necessity for local Python environment dependency installation.
- Horizontal Scaling: Optimal for deployment in cloud infrastructure or orchestration managed by Kubernetes.
Remediation of Issues
Wheel Construction Error Manifestation
If installation yields an error resembling:
ValueError: Unable to determine which files to ship inside the wheel using the following heuristics:
The most likely cause of this is that there is no directory that matches the name of your project (fastn).
Remedy:
1. Verify that pyproject.toml correctly specifies wheel packaging directives:
[tool.hatch.build.targets.wheel]
packages = ["."]
- Re-execute dependency installation command:
uv pip install "httpx>=0.28.1" "mcp[cli]>=1.2.0"
Assistance Channels
- Detailed Documentation: https://docs.fastn.ai/ucl-unified-context-layer/about-ucl
- Community Support Forum: https://discord.gg/Nvd5p8axU3
Licensing
This codebase is distributed under the terms outlined in the accompanying [LICENSE] manifest file.
Background Context: Asynchronous Web Requests (XMLHttpRequest)
XMLHttpRequest (XHR) defines a standard JavaScript Application Programming Interface, manifested as a callable object, utilized to dispatch HTTP communications from a web browser client to a designated web server. The methods afforded by this API empower browser-based scripts to initiate server queries subsequent to page load finalization and subsequently receive resultant data. XHR constitutes a foundational element of the Ajax programming paradigm. Before Ajax's prevalence, the dominant mechanisms for server interaction involved conventional page reloads triggered by form submissions or hyperlink navigation.
== Historical Evolution ==
The underlying principle for XMLHttpRequest was first conceived around the year 2000 by the engineering team responsible for Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 release (1999). However, the initial invocation syntax did not utilize the canonical XMLHttpRequest identifier. Instead, developers relied on invoking COM objects via ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP"). By the release of Internet Explorer 7 (2006), this identifier achieved universal support across all major browser platforms.
XMLHttpRequest is now established as the pragmatic industry standard across leading browser engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Efforts === The World Wide Web Consortium (W3C) issued the first Working Draft specification for the XMLHttpRequest object on April 5, 2006. A Level 2 specification followed as a Working Draft on February 25, 2008. Level 2 introduced enhanced capabilities such as event progress monitoring, enabling cross-origin resource sharing (CORS), and management of raw byte streams. By the conclusion of 2011, the Level 2 extensions were formally consolidated back into the primary specification document. As of late 2012, the specification development mandate transferred to the WHATWG, which maintains the living document using Web IDL definitions.
== Operational Usage Pattern == Typically, the procedure for dispatching a request using XMLHttpRequest necessitates several sequential programming actions:
- Instantiate the XMLHttpRequest object by invoking its constructor method.
- Invoke the
open()method to define the request modality (GET/POST, etc.), specify the target URI, and select synchronous or asynchronous execution mode. - For asynchronous operations, establish an event handler callback intended to be triggered upon state transitions of the request.
- Initiate the data transmission sequence by calling the
send()method, optionally supplying payload data. - Process the state changes within the established event listener. If the server returns data, it is typically aggregated in the
responseTextattribute by default. Once the processing cycle concludes, the object transitions to state 4, signifying completion. Beyond these fundamental stages, XMLHttpRequest offers extensive configurability for request transmission control and response ingestion. Custom HTTP headers can be affixed to tailor server behavior, and data can be transmitted to the server via parameters passed to thesend()call. Responses can be seamlessly deserialized from JSON format into native JavaScript objects or consumed progressively as byte chunks arrive, obviating the need to await the full response text. Furthermore, requests can be terminated prematurely or configured to time out if completion deadlines are not met.
== Inter-Domain Communication (Cross-domain Requests) ==
During the early evolution of the World Wide Web, it was identified that establishing communication pathways across security domains (different origins) could be exploite
