0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/server-adapters/tanstack-start
History 2026-11-12 21:12:29 +00:00
..
src refactor(server): shared route authorization and in-process dispatchRoute across adapters (#29928) 2026-11-12 12:30:28 -05:00
CHANGELOG.md chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
lint-staged.config.js chore: run lint-staged for root files and the 16 packages without a config (#29898) 2026-11-10 14:08:55 +01:00
package.json chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
README.md docs: add Next.js and TanStack Start server adapter guides (#22964) 2026-09-03 10:55:07 +02:00
tsconfig.build.json feat: add @mastra/tanstack-start server adapter for TanStack Start (#18270) 2026-06-21 15:49:32 +02:00
tsconfig.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
tsdown.config.ts chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vitest.config.ts feat: add @mastra/tanstack-start server adapter for TanStack Start (#18270) 2026-06-21 15:49:32 +02:00

@mastra/tanstack-start

@mastra/tanstack-start exposes a Mastra instance through TanStack Start server route handlers. Use it to serve Mastra's REST, streaming, custom API, MCP, and A2A endpoints from the same TanStack Start application.

Installation

npm install @mastra/tanstack-start

Usage

Create a catch-all server route at src/routes/api/$.ts:

import { createFileRoute } from '@tanstack/react-router';
import { createStartRouteHandler } from '@mastra/tanstack-start';
import { mastra } from '../../mastra';

export const Route = createFileRoute('/api/$')({
  server: {
    handlers: createStartRouteHandler({ mastra }),
  },
});

The route prefix and splat location must match. For a route mounted below /api/mastra, pass the same prefix:

createStartRouteHandler({
  mastra,
  prefix: '/api/mastra',
  tools: { customTool },
});

Documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.