Your Remix app already routes everything through loader + action handlers — the cleanest server primitives in any React framework. Here's how to expose them as MCP tools without breaking the model.
wmcp.sh is not affiliated with Remix Software, Shopify, or Anthropic. Remix and React Router are open-source projects.
As of late 2024, Remix's framework features merged into React Router v7 — the new "framework mode" ships loaders, actions, file-based routing, and SSR under the react-router package. Existing Remix v2 apps still work and have a documented migration path. wmcp.sh treats both identically: it consumes the OpenAPI doc describing whichever URLs serve your loaders and actions.
Routes export loader (GET) and action (mutations). Resource routes skip the default component to act as pure API endpoints.
Same primitives, new package: react-router framework mode. Migration is mostly imports + config. MCP exposure model doesn't change.
Plain Remix v2; the OpenAPI bit is what wmcp.sh ingests.
// app/routes/api.orders.$id.ts — Remix v2 resource route
import { json } from '@remix-run/node';
import type { LoaderFunctionArgs, ActionFunctionArgs } from '@remix-run/node';
import { z } from 'zod';
export async function loader({ params }: LoaderFunctionArgs) {
const id = z.string().min(1).parse(params.id);
const order = await getOrder(id);
if (!order) throw new Response('not found', { status: 404 });
return json(order);
}
export async function action({ request, params }: ActionFunctionArgs) {
if (request.method !== 'PATCH') throw new Response(null, { status: 405 });
const body = z.object({ status: z.enum(['open', 'paid', 'shipped']) }).parse(await request.json());
const id = z.string().parse(params.id);
return json(await updateOrderStatus(id, body.status));
}
// Publish OpenAPI at /api/openapi (hand-written or generated from Zod).
// Register: curl 'https://wmcp.sh/api/v1/tools?url=https://acme.example.com/api/openapi'
| Capability | Hand-rolled | wmcp.sh + Remix OpenAPI |
|---|---|---|
| loader + action mapped to MCP tools | ⚠️ You write a tool-per-route bridge | ✅ Each operation in OpenAPI becomes one MCP tool automatically |
| FormData action handlers | ⚠️ Manual JSON branching in every action | ✅ Wrapper pattern documented; spec it once |
| MCP transport (Streamable HTTP, SSE) | ⚠️ You implement the spec server | ✅ Served at https://wmcp.sh/mcp/<your-id> |
| Adapter portability | ⚠️ Tied to one runtime | ✅ Node, Cloudflare, Vercel, AWS, Deno — all work |
| React Router 7 migration | ⚠️ Touches every tool definition | ✅ Update spec URL; rest is unchanged |
| Auth forwarding | ⚠️ Per-handler middleware | ✅ Bearer / API-key / OAuth 2.1 declared in spec |
@asteasolutions/zod-to-openapi, hand-write a static spec at a resource route, or factor handlers into a Hono / tRPC sub-app./mcp/<provider>, or per-tool API keys declared in your spec's securitySchemes.Audit your loaders + actions, emit a typed spec, deploy MCP at mcp.yourbrand.com. Starter $499 one-time setup; Managed Retainer $999/mo for ongoing maintenance; Enterprise $4,999+/mo for SLA + private deploy.