Skip to content

feat(mcpembed): wire IPFS transfer surface on hosted MCP - #659

Merged
pcfreak30 merged 2 commits into
developfrom
feat/mcpembed-hosted-ipfs-transfer
Sep 1, 2026
Merged

feat(mcpembed): wire IPFS transfer surface on hosted MCP#659
pcfreak30 merged 2 commits into
developfrom
feat/mcpembed-hosted-ipfs-transfer

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Wires the IPFS transfer surface on hosted (Portal-embedded) MCP servers. Hosted assemblies previously never registered upload_file, download_file, or host_file_input and reported them false in capabilities for authenticated agents; the Sia vault stays surface-disabled and is never wired.

BuildHostedServer builds the IPFS curlUpload/downloadDrop coordinators from wired executors, threads them into custom-tool registration, and returns a HostedTransfer. mcpembed.New auto-wires the IPFS upload/download executors from the hosted config manager and serves /mcp plus 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:

  1. New shared IPFS transfer handlers (internal/cli/hosted_transfer.go): Added streamUploadHandler and ipfsDownloadHandler functions 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.

  2. Hosted MCP server now surfaces IPFS transfer coordinators (internal/mcp/hosted.go): Updated BuildHostedServer to return a new HostedTransfer struct 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.

  3. Automatic IPFS transfer wiring in hosted embeds (mcpembed/server.go): The New function now automatically wires the IPFS upload/download transfer surface when the catalog deps provide a config manager. It resolves the transfer options via the new BuildHostedTransferOptions function, mounts the streamable MCP endpoint on /mcp plus the IPFS byte routes (/upload/ and /download/), and supports configuring a public BaseURL so presigned URLs are reachable externally.

  4. 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.

  5. 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 /mcp and 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.

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.
@kody-ai

This comment has been minimized.

Comment thread mcpembed/server.go Outdated
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 50.1%

Generated from commit: 163fe43
Repository: LumeWeb/pinner-cli

@kody-ai

kody-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@pcfreak30
pcfreak30 marked this pull request as ready for review September 1, 2026 09:49
@pcfreak30
pcfreak30 merged commit 55865b9 into develop Sep 1, 2026
13 checks passed
@pcfreak30
pcfreak30 deleted the feat/mcpembed-hosted-ipfs-transfer branch September 1, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant