1-File Tri-Transport
Declare schema, validation, idempotency, REST routing, and MCP agent tools in a single unified TypeScript action under 60 lines.
Author once in pure TypeScript. Expose simultaneously as REST, OpenAPI 3.1.0, and Model Context Protocol (MCP) across Cloudflare Workers, AWS Lambda, Node, and Bun.
Shukoi is an enterprise-grade TypeScript micro-framework designed to eliminate architectural duplication across the modern full-stack ecosystem. Instead of authoring separate controllers, OpenAPI schemas, validation pipelines, and LLM agent tool definitions, Shukoi unifies business logic into declarative actions.
A single action file simultaneously powers:
Here is what authoring a production feature looks like in Shukoi—complete with schema validation, REST exposure, idempotency locks, composite cancellation, and MCP tool discovery:
import { Type } from '@sinclair/typebox';
import { defineAction, DomainError } from '@shukoi/core';
export const processPaymentAction = defineAction({
name: 'processPayment',
summary: 'Authorizes and captures a credit card payment with idempotency guarantee',
authRequired: true,
input: Type.Object(
{
amount: Type.Integer({ minimum: 100, description: 'Amount in cents' }),
currency: Type.String({ minLength: 3, maxLength: 3, description: 'ISO 4217 code' }),
customerId: Type.String({ description: 'Customer identifier' }),
},
{ additionalProperties: false }
),
output: Type.Object(
{
transactionId: Type.String(),
status: Type.Literal('SUCCEEDED'),
amount: Type.Integer(),
currency: Type.String(),
},
{ additionalProperties: false }
),
http: {
method: 'POST',
path: '/api/v1/payments',
successStatus: 201,
requireIdempotencyKey: true,
},
mcp: {
enabled: true,
entityType: 'tool',
annotations: { destructiveHint: true, idempotentHint: true },
},
async handler(input, ctx) {
ctx.logger.info('Processing payment', { customerId: input.customerId, amount: input.amount });
// ctx.signal combines client disconnect, request timeout, and container deadline
const response = await fetch('https://payment-gateway.internal/charge', {
method: 'POST',
body: JSON.stringify(input),
signal: ctx.signal,
});
if (!response.ok) {
throw new DomainError('PAYMENT_REJECTED', 'Gateway declined the transaction', {
status: 402,
expose: true,
});
}
return {
transactionId: `txn_${Date.now()}`,
status: 'SUCCEEDED',
amount: input.amount,
currency: input.currency,
};
},
});Create a brand new production-ready Shukoi service in seconds using the official interactive scaffolder:
pnpm create shukoi@latest my-servicenpm create shukoi@latest my-servicebun create shukoi@latest my-serviceSelect your desired deployment target (Cloudflare Workers, AWS Lambda, or Self-Host Server), install dependencies, and start building immediately.