Automation and agent guide

API and MCP HTML Publishing: Automate Artifact Links

When an agent or script creates an HTML report, the publishing step should return a reviewable artifact link as part of the same workflow. BinHTML supports two automation surfaces: the REST API for explicit programmatic control and remote MCP for agent-led tool use.

Last reviewed 2026-08-02

01

1. Pick REST API or remote MCP

Use the REST API when a script, CI job, scheduled task, or product integration should control authentication, payloads, retries, and response handling. Use remote MCP when an MCP-capable agent should call the publishing tool during a task and include the result in its response.

Both paths publish a complete HTML document. The choice is about orchestration and ownership, not a different kind of artifact. Keep the same content and review rules whichever interface starts the publish.

  • REST API: explicit code, repeatable jobs, and integration tests.
  • Remote MCP: conversational agent workflows and tool-driven handoffs.
  • Dashboard: human-led publishing when automation is unnecessary.

02

2. Give the publisher a complete document and a clear name

The request should contain the full HTML needed for the artifact to render, plus a title that will make sense to the recipient later. A vague title such as 'output' makes automated review harder; a title that names the report, audience, or decision creates useful context in the dashboard and handoff.

Keep content generation separate from publishing where possible. That makes it easier to inspect, redact, retry, and test the document before it crosses the publishing boundary.

  • Generate and validate the HTML before the network call.
  • Use a stable, human-readable artifact title.
  • Do not place API keys or other credentials inside the document body.

03

3. Make the response a handoff contract

The useful result is not just a successful HTTP status or a tool confirmation. The caller needs the URL that a reviewer can open, and the surrounding workflow should make clear what was published. Agent prompts and application code should ask for a concise handoff containing the share link and, when needed, the source or management link.

Returning raw HTML in an agent response defeats the point of artifact publishing. It increases message size, makes the review surface inconsistent, and forces the recipient to reconstruct the browser experience.

  • Return the artifact share URL prominently.
  • Include the artifact name and the purpose of the generated output.
  • Expose source, management, version, or project links when the recipient needs them.

04

4. Decide whether updates keep the same URL

For a recurring report or an iterative prototype, update the existing artifact when the review object and audience remain the same. A stable URL means the next handoff can point to the current version without creating a new link every time.

Create a separate artifact when the audience, purpose, retention boundary, or review job changes. Stable URLs are useful only when their meaning stays stable too.

  • Same review object, new content: publish a new version.
  • New review object or audience: create a new artifact.
  • Several related outputs: use a project boundary and a clear project name.

05

5. Add projects for multi-artifact agent workflows

A single agent run may create a brief, a data summary, and a visual dashboard. Publishing each output separately is fine, but the reviewer needs an index. A BinHTML project can group related artifacts and provide a project-level handoff without forcing the agent to merge unrelated HTML into one document.

Keep project creation and naming deterministic. If each run makes a new project with a temporary name, the project list becomes difficult to navigate and the stable handoff benefit disappears.

06

6. Test the entire publish-and-review path

An integration is complete only when the generated document reaches the reviewer in the expected form. Test authentication, the publish request, the returned URL, the rendered result, version updates, and the final message. For MCP, test that the agent is instructed to return the link rather than the document body.

  • Publish a representative document with the same size and interaction as production output.
  • Verify the returned link resolves and the rendered HTML is complete.
  • Exercise an update against the same artifact when the workflow is recurring.
  • Check that failures are visible and do not produce a misleading success link.

Continue the workflow

Use the reference that matches the next decision, then publish a representative document and review the resulting link.

Ready to publish one?

Start with a real document, then keep the review link close to the context that produced it.

Publish HTML