Implementation:1mcp app Agent vendorLegacyTransport
| Knowledge Sources | |
|---|---|
| Domains | Build, MCP_Protocol |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete build script that vendors the pinned legacy MCP SDK transport code into `src/sdk/legacy/transport/vendored/` to preserve protocol compatibility without runtime dependency on the legacy package.
Description
The vendorLegacyTransport module is a build-time script that copies and transforms the legacy MCP SDK transport implementation into a vendored directory within `src/sdk/legacy/transport/vendored/`. This ensures the legacy transport code is available at build time without requiring a runtime dependency on the legacy `@modelcontextprotocol/sdk` package. The transformation adjusts import paths and removes unnecessary code.
Usage
Import this module when you need to:
- Vendor the legacy transport code during the build process
- Ensure legacy protocol support is bundled into the SEA binary
- Transform legacy transport imports for the vendored location
Code Reference
Source Location
- Repository: 1MCP Agent
- File: scripts/vendor-legacy-transport.mjs (L31-44)
Signature
export async function vendorLegacyTransport(root: string): Promise<void>;
export function transformTransport(source: string): string;
Import
import { vendorLegacyTransport } from './vendor-legacy-transport.mjs';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| root | string | Yes | Repository root path |
Outputs
| Name | Type | Description |
|---|---|---|
| vendored files | files | Transport code in src/sdk/legacy/transport/vendored/ |
Usage Examples
Vendor Legacy Transport
import { vendorLegacyTransport } from './vendor-legacy-transport.mjs';
await vendorLegacyTransport('/path/to/repo');
// Legacy transport vendored to src/sdk/legacy/transport/vendored/