feat(mcpembed): wire IPFS transfer surface on hosted MCP - #659
Merged
Conversation
Hosted (Portal-embedded) MCP servers never registered upload_file, download_file, or host_file_input: BuildHostedServer passed no transfer coordinators to custom-tool registration and no IPFS executors were wired, so the capabilities report reported them false for logged-in agents. Vault stays surface-disabled and is never wired. BuildHostedServer now builds the IPFS curlUpload/downloadDrop coordinators from wired executors, threads them into custom-tool registration, and surfaces a HostedTransfer so the embedding host can mount the byte routes. mcpembed.New auto-wires the IPFS upload/download executors from the hosted config manager and returns a handler serving /mcp plus the /upload/ and /download/ byte routes.
This comment has been minimized.
This comment has been minimized.
Code Coverage ReportTotal Coverage: 50.1% Generated from commit: 163fe43 |
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires the IPFS transfer surface on hosted (Portal-embedded) MCP servers. Hosted assemblies previously never registered
upload_file,download_file, orhost_file_inputand reported them false incapabilitiesfor authenticated agents; the Sia vault stays surface-disabled and is never wired.BuildHostedServerbuilds the IPFScurlUpload/downloadDropcoordinators from wired executors, threads them into custom-tool registration, and returns aHostedTransfer.mcpembed.Newauto-wires the IPFS upload/download executors from the hosted config manager and serves/mcpplus the/upload/and/download/byte routes.This pull request wires the IPFS transfer surface onto the hosted (Portal-embedded) MCP server, enabling hosted deployments to support file upload and download capabilities natively.
Key Changes:
New shared IPFS transfer handlers (
internal/cli/hosted_transfer.go): AddedstreamUploadHandlerandipfsDownloadHandlerfunctions that provide the single implementation of authenticated IPFS upload/download executors. These are extracted so both CLI and hosted surfaces reference the same transfer logic without duplication.Hosted MCP server now surfaces IPFS transfer coordinators (
internal/mcp/hosted.go): UpdatedBuildHostedServerto return a newHostedTransferstruct containing presigned HTTP PUT upload and filedrop GET download coordinators when the corresponding IPFS executors are wired. The server now connects the upload coordinator's connect origins to the IPFS upload app resource for proper CSP configuration.Automatic IPFS transfer wiring in hosted embeds (
mcpembed/server.go): TheNewfunction now automatically wires the IPFS upload/download transfer surface when the catalog deps provide a config manager. It resolves the transfer options via the newBuildHostedTransferOptionsfunction, mounts the streamable MCP endpoint on/mcpplus the IPFS byte routes (/upload/and/download/), and supports configuring a publicBaseURLso presigned URLs are reachable externally.Config manager resolution seam (
mcpembed/cfg.go): Added a helper to resolve the live config manager from the catalog deps bundle, providing the seam for building IPFS transfer executors from Portal API credentials.Test coverage: Added tests verifying that hosted assemblies reject vault sync, that IPFS transfer coordinators are produced only when executors are wired, that capabilities properly advertise upload/download file support (never vault), and that the served handler routes both
/mcpand the IPFS byte-route paths to the correct handlers.The changes ensure hosted Portal-embedded MCP servers can now fully support IPFS file upload/download operations without vault, with automatic wiring based on available configuration.