Skip to content

feat(relay): Kaption Links tools, gated by the extension (kaption-links.MCP) - #76

Open
kshmir wants to merge 1 commit into
mainfrom
feat/kaption-links-tools
Open

kshmir wants to merge 1 commit into
mainfrom
feat/kaption-links-tools

Conversation

@kshmir

@kshmir kshmir commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

What this is, in plain words: this lets Claude and ChatGPT use Kaption Links through the cloud connector. Kaption Links is the link shortener with click counts on the Business plans. Three new tools are added: make short tracked links (create_tracked_links), list them with their clicks (list_tracked_links), and read who clicked (get_link_clicks). The relay does not answer these tools itself. It shows them only to accounts whose extension says the feature is on, and passes each call on to that extension unchanged.

Pairs with: the kaptionai monorepo PR on branch feat/kaption-links-core. That PR is the extension side: its account core answers these tools and reports features.kaption_links. Deploy this after that one ships. Until then no extension reports the feature, so nobody sees the tools.

Changes

  • src/tools.ts: the three definitions, copied word for word from kaptionai kext/scripts/mcp-links-tools.json, with the same descriptions, schemas (including target_session) and annotations. zodToJsonSchema now publishes .int() numbers as integer with minimum/maximum, and an array .min(n) as minItems. No existing tool uses .int() together with a published bound that changes, and all existing pins still pass.
  • src/manage-kaption.ts: adds features.kaption_links, which shows all three tools (kaption-links.MCP.10). It works the same way as export_chat: a value of false, a missing key or an older extension hides them, and a call to a hidden tool never reaches the extension.
  • src/credits.ts: create_tracked_links is classed send (2 credits). list_tracked_links and get_link_clicks are read (1 credit) (kaption-links.MCP.5).
  • src/test-support/mcp-links-tools.json: the pinned definitions.
  • Tests (manage-kaption.test.ts, ledger-credits.test.ts, relay.test.ts) check that:
    • the definitions match the pinned file exactly;
    • the tools show only when kaption_links is true;
    • they appear with list_changed, are forwarded unchanged, and inputs outside the schema are refused before forwarding;
    • the month's credits come out at 2/1/1, for both cloud calls and local batch rows.

Not deployed, version not bumped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GyommtrSAyAEfKj1gxi9Kj

…links, get_link_clicks), gated by the extension (kaption-links.MCP.1-5, MCP.10)

The relay lists the three tools only while the connected extension said
features.kaption_links true, and forwards them by name. Definitions are
verbatim from kaptionai kext/scripts/mcp-links-tools.json (pinned in
src/test-support). create_tracked_links counts 2 credits (send); the two
reads 1. zodToJsonSchema now publishes .int() bounds and array minItems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GyommtrSAyAEfKj1gxi9Kj
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