harnest_fused package to describe several OpenAPI services, provision one Fused MCP server, and connect your agent to that server. Each spec includes all operations unless you provide an explicit selection.
Install the package
Until the first package release is published, install from the Harnest checkout:harnest[adk-mcp] or harnest[langgraph-mcp]. Setup also requires fused-cli installed on your system and configured for your Fused Engine. The CLI uses its existing login and credential precedence. Your chosen bucket and any provider credentials must already exist in Fused.
Declare the services
mcp/business.py
MCPClient. Creating it does not read the specs, start processes, contact Fused, or resolve environment variables. Harnest can discover and compile it through the normal MCP Client workflow.
For all operations from every source, strings are shorthand:
Provision explicitly
Callsetup() from a developer setup script. Keep it outside the mcp/ factory, agent imports, and runtime lifecycle hooks.
description and bucket are required. The bucket must be an existing bucket you are allowed to use. version defaults to 1.0.0; choose a new version when changing an already published MCP server’s immutable configuration.
1
Plan the imports
Setup checks the configured CLI identity and plans every spec with strict import validation. Each plan has its own retained receipt under
.fused/harnest/<name>/setup-.../.2
Import the services
Setup applies the exact receipts and verifies their committed service and version identities. Fused’s successful import also activates those versions in its workspace.
3
Create one MCP server
Setup writes one Fused MCP configuration containing every selected service, plans it, and applies it. Fused validates operation selections, credentials, and access requirements.
4
Bind the client
Setup reads the structured version catalogue and returns the exact version’s Streamable HTTP endpoint and a standard
MCPClient. It does not select whichever version happens to be latest.result.token_env. The package does not scrape human output, save a token to source files, or generate replacement tokens automatically. An idempotent apply does not reveal the original token again; retain your existing token.
For the authored mcp/business.py declaration, supply:
Override the variable names with
url_env= and token_env= on from_openapi(). Never use a Fused control-plane API key as the MCP execution token.
Generate a regular client file
For a project without an existingmcp/business.py, setup can write a standard client declaration:
harnest.mcp, so this runtime path needs neither harnest_fused nor fused-cli. The method refuses to overwrite an existing file.
Standard client options such as prefix, permission, tool_permissions, and timeout_seconds can be passed to from_openapi() and are preserved. Use environment references for any additional connection headers. Lifecycle and other executable Python objects cannot be emitted into a generated file; use result.client or your authored factory when supplying those options.
Handle setup failures
Setup never retries a failed mutation automatically and does not claim to roll back imported services. A later MCP plan failure can leave earlier imports committed. Receipts and the MCP configuration remain available for inspection and recovery. For an uncertain import outcome, usefused-cli import status <plan-id> with the ID in that source’s receipt before deciding whether to retry.
FusedCLIError reports the failed phase without copying captured provider output or credentials into the exception. Human MCP apply output remains under the CLI’s control. The configurable timeout_seconds bounds each subprocess and defaults to 1,260 seconds to accommodate Fused’s import timeout.
An existing Fused MCP server needs no OpenAPI setup. Connect to it directly with the regular MCP Client.