
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Keryx: MCP と API の Fullstack TypeScript フレームワーク
概要
MCP と API のフルスタック TypeScript フレームワーク。 Keryx の背後にある大きなアイデア: 単一のアクションクラスでは HTTP リクエスト、WebSocket メッセージ、CLI コマンド、背景タスク、MCP ツールの呼び出しを処理します。同じ入力、同じ Zod 検証、同じミドルウェア、同じ応答。 一度にロジックを書きます。変更する唯一のことは、リクエストが到着し、応答が配信される方法です。 その最後の輸送 — MCP — 今構築した理由です。 すべてのアクションは自動的に MCP ツールです。そのため、AI エージェントは組み込み OAuth 2.1 で認証され、タイプされたエラーが取得され、HTTP クライアントの検証済みのエンドポイントを正確に呼び出します。 MCP サーバが維持し、スキーマが同期しないようにするには 2 番目の MCP サーバーはありません。アプリをエージェントに公開します。 そしてそれはおもちゃではなく、本当のバックエンドです.
概要(AI 翻訳)
MCP と API のフルスタック TypeScript フレームワーク。
このプロジェクトとは?
Keryxの背後にある大きなアイデア:コントローラーを一度書いて、どこでも動作します。 単一のアクションクラスでは、HTTP リクエスト、WebSocket メッセージ、CLI コマンド、背景タスク、MCP ツールの呼び出しを処理します。同じ入力、同じ Zod 検証、同じミドルウェア、同じ応答。 一度にロジックを書きます。変更する唯一のことは、リクエストが到着し、応答が配信される方法です。
その最後の輸送 — MCP — 今構築した理由です。 すべてのアクションは自動的に MCP ツールです。そのため、AI エージェントは組み込み OAuth 2.1 で認証され、タイプされたエラーが取得され、HTTP クライアントの検証済みのエンドポイントを正確に呼び出します。 MCP サーバが維持し、スキーマが同期しないようにするには 2 番目の MCP サーバーはありません。アプリをエージェントに公開します。
そしてそれはおもちゃではなく、本当のバックエンドです.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Keryx
The fullstack TypeScript framework for MCP and APIs.
What is this Project?
The big idea behind Keryx: write your controller once, and it works everywhere. A single action class handles HTTP requests, WebSocket messages, CLI commands, background tasks, and MCP tool calls — same inputs, same Zod validation, same middleware, same response. You write the logic once; the only thing that changes is how the request arrived and how the response gets delivered.
That last transport — MCP — is the reason I built this now. Every action is automatically an MCP tool, so AI agents authenticate with built-in OAuth 2.1, get typed errors, and call the exact same validated endpoints your HTTP clients do. There’s no second MCP server to maintain and no schemas to keep in sync… you expose your app to agents by writing the app.
And it’s a real backend, not a toy. You get Drizzle ORM with auto-migrations, background tasks with fan-out on Resque, streaming responses (SSE, chunked binary, and the same stream over WebSocket and MCP), OpenAPI generation, pagination and caching helpers, database transactions, and a companion Vite + React frontend that reads your actions with end-to-end type safety — no code generation. It’s all on Bun, so TypeScript runs natively and startup is fast.
One Action, Every Transport
Here’s what that looks like in practice. This is one action:
export class UserCreate implements Action {
name = "user:create";
description = "Create a new user";
inputs = z.object({
name: z.string().min(3),
email: z.string().email(),
password: secret(z.string().min(8)),
});
web = { route: "/user", method: HTTP_METHOD.PUT };
task = { queue: "default" };
async run(params: ActionParams) {
const user = await createUser(params);
return { user: serializeUser(user) };
}
}
That one class gives you:
HTTP — PUT /api/user with JSON body, query params, or form data:
curl -X PUT http://localhost:8080/api/user \
-H "Content-Type: application/json" \
-d '{"name":"Evan","email":"[email protected]","password":"secret123"}'
WebSocket — send a JSON message over an open connection:
{ "messageType": "action", "action": "user:create",
"params": { "name": "Evan", "email": "[email protected]", "password": "secret123" } }
CLI — flags are generated from the Zod schema automatically:
./keryx.ts "user:create" --name Evan --email [email protected] --password secret123 -q | jq
Background Task — enqueued to a Resque worker via Redis:
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"my-app": {
"url": "http://localhost:8080/mcp"
}
}
}