日本語English
TrayPage Docs

MCP integration

Connection methods per client, authentication (OAuth / API tokens), and the tool reference.

All publishing to and fetching from TrayPage happens via MCP (Model Context Protocol). The endpoint is https://tray.page/api/mcp over Streamable HTTP.

Connecting per client

Claude Code

claude mcp add --transport http traypage https://tray.page/api/mcp

After adding, run /mcp inside Claude Code and select traypage to authenticate. A browser opens for sign-in and consent (choose the workspace and confirm permissions).

claude.ai / Claude Desktop

Go to Settings → Connectors → Add custom connector and enter https://tray.page/api/mcp as the URL. The same authorization flow runs in the browser when connecting.

Other MCP clients

Any client that supports Streamable HTTP and OAuth 2.1 can connect by registering the URL https://tray.page/api/mcp. For clients without OAuth support, or for automation, pass an API token as a header instead:

claude mcp add --transport http traypage https://tray.page/api/mcp \
  --header "Authorization: Bearer tp_xxx"

Authentication

MethodBest forSteps
OAuth 2.1 (recommended)Day-to-day AI toolsAuthorize in the browser when connecting. No token management
API token (tp_ prefix)CI, scripts, clients without OAuthCreate in workspace settings, pass as Authorization: Bearer tp_xxx

During OAuth authorization, a consent screen shows which workspace and which permissions (scopes) you are granting. API tokens are issued per workspace and only work within that workspace.

The scopes are listed below. OAuth grants all of them when no scopes are specified.

ScopeAllowed operations
artifact:readFetch artifacts and versions
artifact:writePublish and add new versions
comment:readFetch review comments
revision_prompt:readFetch revision prompts
project:readList projects
folder:readList folders

Regardless of method and scopes, final authorization is decided per artifact by the permission model (How it works § Permissions).

Tool reference

publish_html_artifact

Publishes HTML as a new artifact. Returns a review URL and a viewer URL.

ArgumentRequiredDescription
workspace_slugSlug of the target workspace
project_slugSlug of the target project
artifact_titleArtifact title
htmlFull HTML
artifact_slugSlug used in URLs (auto-generated if omitted)
folder_pathFolder path within the project
changelogWhat changed in this version

publish_new_artifact_version

Adds a new version to an existing artifact.

ArgumentRequiredDescription
artifact_idTarget artifact ID
htmlFull HTML
changelogWhat changed in this version

list_artifacts

Lists artifacts in a project.

ArgumentRequiredDescription
workspace_slugWorkspace slug
project_slugProject slug
folder_pathFilter by folder

get_artifact_comments

Fetches review comments for an artifact.

ArgumentRequiredDescription
artifact_idTarget artifact ID
version_numberFilter to a specific version
statusopen (default) or resolved

get_revision_prompt

Builds revision instructions from open comments, ready to hand to an AI.

ArgumentRequiredDescription
artifact_idTarget artifact ID
version_numberBase the prompt on a specific version

Troubleshooting

  • The auth screen doesn't open / persistent 401 — Re-authenticate via /mcp in Claude Code. If that doesn't fix it, run claude mcp remove traypage and add it again.
  • Workspace not found — Check the slug, and confirm you granted access to that workspace during OAuth consent. You can find the workspace slug in the app URL (/app/{workspace-slug}).
  • Project not found — Projects are not auto-created. Create the project in the app first.
  • Publishing works but comments fail — Check that your API token's scopes include comment:read.

On this page