Skip to content

feat(mcp): relay speechify mcp to the hosted MCP server (DRG-482) - #18

Merged
luke-speechify merged 3 commits into
mainfrom
feat/mcp-relay
Sep 8, 2026
Merged

feat(mcp): relay speechify mcp to the hosted MCP server (DRG-482)#18
luke-speechify merged 3 commits into
mainfrom
feat/mcp-relay

Conversation

@luke-speechify

Copy link
Copy Markdown
Contributor

Turns speechify mcp into a thin relay to Speechify's hosted MCP server at https://mcp.speechify.ai/mcp, replacing the CLI's bespoke server + local tools.

What

  • Pure relay. speechify mcp speaks MCP over stdio to the local client (Claude Code, Cursor, Claude Desktop, …) and forwards every JSON-RPC message verbatim to the hosted server. The CLI defines no tools of its own — the hosted surface (today ask, search) is what clients see, and grows with no CLI release.
  • stdio only. Dropped the local --http/--host/--port server and its unauthenticated, API-key-bearing endpoint (and the DNS-rebinding / bind-interface warnings that came with it).
  • Bearer pass-through. Resolves the API key (flag / env / stored) and forwards it upstream as Authorization: Bearer. Optional today — ask/search are public — and wired so the hosted server can expose authenticated, API-backed tools later without a CLI change.
  • --url to relay to a different endpoint (staging/testing); defaults to the hosted URL.
  • Kept the --accept-alpha gate and speechify mcp install.

Removed

  • The local MCP tools (text_to_speech, stream_text_to_speech, list_voices, get_voice) and the search_docs proxy to the old Fern docs MCP, along with src/mcp/server.ts.

Testing

  • New src/mcp/run.test.ts: a real Client ⟷ relay ⟷ McpServer round-trip over in-memory transports proves tools/list and tools/call forward transparently, plus close-propagation.
  • Full suite green (201 tests), typecheck + biome clean, tsup build clean.
  • Live smoke test against https://mcp.speechify.ai/mcp: a spec-compliant stdio handshake returns TOOLS: ask, search, and the bearer is forwarded when a key is present.

Replace the CLI's bespoke MCP server with a transparent stdio→streamable-HTTP
relay to Speechify's hosted MCP at https://mcp.speechify.ai/mcp. The CLI defines
no tools of its own; it forwards JSON-RPC verbatim, so the hosted tool surface
(today `ask`/`search`) is what clients see and grows with no CLI release.

- stdio only: drop the local `--http`/`--host`/`--port` server and its
  unauthenticated, key-bearing endpoint and warnings.
- Forward the resolved API key upstream as `Authorization: Bearer`. Optional —
  the hosted tools are public — and wired for future authenticated pass-through.
- Add `--url` to point the relay at a different endpoint (staging/testing).
- Keep the `--accept-alpha` gate and `mcp install`.
- Remove the local TTS/voice MCP tools and the docs-search proxy with the server.
The mcp surface is no longer alpha. `speechify mcp` and `mcp install` now REJECT
`--accept-alpha` with a clear instruction to remove it (exit 78, code
`alpha_flag_removed`), so a stale client config written by an older CLI fails
loudly and prompts a re-install instead of silently passing a dead flag.

- `mcp install` no longer bakes `--accept-alpha` into the config it writes
  (`cliInvocation` → args `["mcp"]`).
- Drop the "(alpha) … Requires --accept-alpha" wording from command help.
- README: replace the alpha note, remove the flag from every example.
- Tests: assert both subcommands reject the flag, install works without it, and
  cliInvocation emits no `--accept-alpha`.
The hosted server advertises its own tools to clients, so the README no longer
enumerates them (they'd only go stale). Replace the flat install list with a
collapsible <details> accordion per client (Claude Code, Cursor, Claude Desktop,
Windsurf, VS Code), each with its install command, config path, and manual entry.
@luke-speechify
luke-speechify merged commit acf1a67 into main Sep 8, 2026
4 checks passed
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