Skip to content

Integrations ​

Sink exposes an authenticated REST API and generated OpenAPI document for automation. The following projects and recipes provide convenient entry points; review third-party code and credential handling before use.

AI Skills ​

Install the repository's AI Skills package with:

sh
npx skills add miantiao-me/sink

MCP Server ​

Sink serves a Model Context Protocol endpoint at POST /api/mcp. It uses the official @modelcontextprotocol/server SDK v2 entry point, serving modern clients over the per-request transport and 2025-era clients over the stateless fallback with JSON responses, so current MCP clients work without extra configuration and older protocol versions stay compatible through the SDK's own version negotiation.

The endpoint authenticates with the same bearer token as the REST API, so no separate credential is needed. See API authentication.

sh
claude mcp add --transport http sink https://your-domain/api/mcp --header "Authorization: Bearer YOUR_SITE_TOKEN"

Any client that supports an HTTP transport with custom headers can connect the same way:

json
{
  "mcpServers": {
    "sink": {
      "type": "http",
      "url": "https://your-domain/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_SITE_TOKEN"
      }
    }
  }
}

Tools ​

ToolDescription
list_linksList links newest first, with cursor pagination.
search_linksSearch links by keyword or exact destination URL.
get_linkRead a single link by slug.
count_linksCount links matching a keyword, URL, tag, or status.
list_tagsList tags in use and how many links carry each.
create_linkCreate a link, generating a slug when none is given.
update_linkReplace every writable field of an existing link.
upsert_linkReturn the existing link for a slug, or create it.
delete_linkPermanently delete a link.
check_linksCheck stored link targets, paginated by slug.
get_analytics_countersTotal visits, visitors, and referers.
get_analytics_viewsVisits and visitors bucketed by minute, hour, or day.
get_analytics_metricsTop values for one access-log dimension.
get_analytics_heatmapVisits and visitors by weekday and hour of day.

The write tools honor NUXT_PUBLIC_PREVIEW_MODE and the KV-to-D1 migration gate exactly as the REST API does, and analytics tools read the same sampled access log as the dashboard, so their counts are estimates. For update_link, sending an empty password clears protection while omitting it keeps the stored one.

The endpoint sits under /api/ so it stays out of the short-link namespace: a slug cannot contain a slash, so no link can shadow it and no reserved slug is needed. Upgrading never takes a slug away from an instance that already uses one.

OpenAPI to MCP ​

An OpenAPI proxy is an alternative when a client cannot reach the built-in endpoint, for example because it only supports stdio servers.

Requires uv so the uvx command is available:

json
{
  "mcpServers": {
    "sink": {
      "command": "uvx",
      "args": ["mcp-openapi-proxy"],
      "env": {
        "OPENAPI_SPEC_URL": "https://your-domain/_docs/openapi.json",
        "API_KEY": "YOUR_SITE_TOKEN",
        "TOOL_WHITELIST": "/api/link"
      }
    }
  }
}

Use your own instance URL and site token. Restrict the exposed route set to the operations the client needs, and protect the client configuration as a secret. See API authentication.

Apps and extensions ​

These integrations may be maintained independently of the core Sink repository. Confirm their compatibility with your deployed API version in your instance's OpenAPI reference.