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/mcpAfter 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
| Method | Best for | Steps |
|---|---|---|
| OAuth 2.1 (recommended) | Day-to-day AI tools | Authorize in the browser when connecting. No token management |
API token (tp_ prefix) | CI, scripts, clients without OAuth | Create 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.
| Scope | Allowed operations |
|---|---|
artifact:read | Fetch artifacts and versions |
artifact:write | Publish and add new versions |
comment:read | Fetch review comments |
revision_prompt:read | Fetch revision prompts |
project:read | List projects |
folder:read | List 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.
| Argument | Required | Description |
|---|---|---|
workspace_slug | ✓ | Slug of the target workspace |
project_slug | ✓ | Slug of the target project |
artifact_title | ✓ | Artifact title |
html | ✓ | Full HTML |
artifact_slug | Slug used in URLs (auto-generated if omitted) | |
folder_path | Folder path within the project | |
changelog | What changed in this version |
publish_new_artifact_version
Adds a new version to an existing artifact.
| Argument | Required | Description |
|---|---|---|
artifact_id | ✓ | Target artifact ID |
html | ✓ | Full HTML |
changelog | What changed in this version |
list_artifacts
Lists artifacts in a project.
| Argument | Required | Description |
|---|---|---|
workspace_slug | ✓ | Workspace slug |
project_slug | ✓ | Project slug |
folder_path | Filter by folder |
get_artifact_comments
Fetches review comments for an artifact.
| Argument | Required | Description |
|---|---|---|
artifact_id | ✓ | Target artifact ID |
version_number | Filter to a specific version | |
status | open (default) or resolved |
get_revision_prompt
Builds revision instructions from open comments, ready to hand to an AI.
| Argument | Required | Description |
|---|---|---|
artifact_id | ✓ | Target artifact ID |
version_number | Base the prompt on a specific version |
Troubleshooting
- The auth screen doesn't open / persistent 401 — Re-authenticate via
/mcpin Claude Code. If that doesn't fix it, runclaude mcp remove traypageand 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.