Get the FREE Ultimate OpenClaw Setup Guide →

sveltekit -starter

MCP server from axel-rock/sveltekit-mcp-starter

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio axel-rock-sveltekit-mcp-starter npx -y axel-rock-sveltekit-mcp-starter \
  --env REDIS_URL="redis://localhost:6379" \
  --env ANTHROPIC_API_KEY="your-anthropic-api-key"

How to use

This MCP server demonstrates a minimal SvelteKit-based MCP setup on top of Vercel using the @vercel/mcp-adapter. It showcases a basic MCP tool accessible via a SvelteKit route and an accompanying MCP client example that can call the server using the MCP SDK. The project focuses on integrating the MCP transport (primarily StreamableHTTPClientTransport) with a SvelteKit app, illustrating how tools can be defined, invoked, and streamed back to the client. You can deploy locally or on Vercel, and the example highlights how to wire up an LLM provider (e.g., Anthropic) and a Redis-backed state transport for compatible transports like SSE, though the adapter also supports streamable HTTP without Redis in some setups.

To use the MCP server, install dependencies, configure environment variables, and start the development server. The MCP client example demonstrates how to call the server’s tool and receive tool results through the MCP SDK, enabling AI-driven tool calls within your app. The setup is intentionally minimal, but it documents how the server and client communicate, how tools are defined, and how to adapt transports for your hosting environment.

How to install

Prerequisites:

  • Node.js v18+ and pnpm installed
  • Access to an Anthropic (or compatible) API key
  • Optional: Redis URL for certain transports (SSE/StreamableHTTP); Vercel adapters may work with streamableHTTP without Redis in newer versions

Steps:

  1. Clone the repository
  2. Install dependencies pnpm install
  3. Copy environment configuration cp .env.example .env

    Edit .env and set required keys, e.g.:

    ANTHROPIC_API_KEY=your-key

    REDIS_URL=redis://...

  4. Run locally pnpm run dev
  5. Open http://localhost:5173 (or the port shown in the console)

Notes:

  • The MCP server is integrated via Vercel’s MCP adapter, with a minimal SvelteKit setup to illustrate the concept. If you’re deploying to Vercel, ensure your vercel.json or project settings reflect the MCP adapter usage according to the Vercel docs.

Additional notes

Tips and caveats:

  • Edge Function limitations may apply when deploying MCP with certain adapters on Vercel; standard serverless functions are the recommended path.
  • This example focuses on the StreamableHTTPClientTransport; the adapter also supports SSE for stateful transports.
  • The MCP TypeScript SDK version is pinned in the example (e.g., 1.10.2) due to historical issues with tool arguments; verify compatibility with newer SDK versions before upgrading.
  • Environment variables in .env include API keys and Redis URLs; adjust according to your deployment environment and transport needs.
  • If you plan to extend with more tools, follow the MCP SDK tool definition patterns and update the server routes accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers