
ufownl/lua-resty-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
OpenResty 用の Lua で実装されたモデルコンテキストプロトコル SDK
概要
- [x] トランスポート - [x] stdio - [x] ストリーム可能な HTTP - [x] WebSocket (非指定) - [x] プロトコル - [x] ライフサイクル - [x] プロンプト - [x] リソース - [x] ツール - [x] ルート - [x] サンプリング - [x] エリシテーション - [x] ユーティリティ - [x] パージネーション - [x] 進行 - [x] キャンセル - [x] 完了 - [x] ログ - [x] ピン プロンプト、リソース、ツールをデモンストレーションするシンプルなサーバー: 構文:サーバ、err = mcp.server(transport[、オプション]) 特定のトランスポート(現在のmcp.transportのみ)でMCPサーバーセッションを作成します。 stdio は こちら で利用可能です。 成功するコールは、MCP サーバーセッションを返します。 それ以外の場合は、nil とエラーを記述する文字列を返します。 * mcp.transport.stdio * mcp.transport.websocket 1。 オプションのフィールドタイトルは、UIとエンドユーザのコンテキストを意図しています。ドメイン固有の用語で不慣れな人でも簡単に理解できるように最適化されています。 提供されていない場合、名前は表示に使用されます。 2.
概要(AI 翻訳)
OpenResty 用の Lua で実装されているモデルコンテキストプロトコル(MCP) SDK。
ステータス
生産の準備ができた。
コンテンツの表
*特徴
- クイックスタート
- サーバー API
- mcp.server は
- mcp.transport.streamable\ http.endpoint ディレクティブ *サーバ:run *サーバ:登録 *サーバ:unregister\ * *サーバ:resource\ updated *サーバ:replace\ *
- サーバ:list\ roots *サーバ:create\ message *サーバ:elicit *サーバ:log *サーバ:ping *サーバ:wait\ background\ tasks *サーバ:shutdown
- MCPクライアントを書く
- クライアント API
- mcp.clientの
- クライアント:initialize
- クライアント:wait\ background\ tasks
- クライアント:shutdown
- クライアント:expose\ roots
- クライアント:list\ prompts
- クライアント:get\ prompt
- クライアント:list\ resources
- クライアント:list\ resource\ templates
- クライアント:read\ resource
- クライアント:subscribe\ resource
- クライアント:unsubscribe\ resource
- クライアント:list\ tools
- クライアント:call\ tool
- クライアント:prompt\ complete
- クライアント:resource\ complete
- クライアント:set\ log\ level
- クライアント: ping
- 既知の問題
- stdio トランスポートを使用したリクエストサーバでのキャンセル
- ライセンス
##特徴
- [x] 輸送
- [x] ステレオ
- [x] ストリーム可能な HTTP
- [x] WebSocket (非指定)
- [x] プロトコル
- [x] ライフサイクル
- [x] プロンプト
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
lua-resty-mcp
Model Context Protocol (MCP) SDK implemented in Lua for OpenResty.
Status
Production ready.
Table of Contents
- Features
- Quickstart
- Server APIs
- Writing MCP Clients
- Client APIs
- mcp.client
- client:initialize
- client:wait_background_tasks
- client:shutdown
- client:expose_roots
- client:list_prompts
- client:get_prompt
- client:list_resources
- client:list_resource_templates
- client:read_resource
- client:subscribe_resource
- client:unsubscribe_resource
- client:list_tools
- client:call_tool
- client:prompt_complete
- client:resource_complete
- client:set_log_level
- client:ping
- Known Issues
- License
Features
- [x] Transports
- [x] stdio
- [x] Streamable HTTP
- [x] WebSocket (non-specification)
- [x] Protocols
- [x] Lifecycle
- [x] Prompts
- [x] Resources
- [x] Tools
- [x] Roots
- [x] Sampling
- [x] Elicitation
- [x] Utilities
- [x] Pagination
- [x] Progress
- [x] Cancellation
- [x] Completion
- [x] Logging
- [x] Ping
Quickstart
A simple server demonstrating prompts, resources, tools:
-- Import lua-resty-mcp module
local mcp = require("resty.mcp")
-- Create an MCP server session with stdio transport
local server = assert(mcp.server(mcp.transport.stdio, {}))
-- Register a prompt
assert(server:register(mcp.prompt("echo", function(args)
return "Please process this message: "..args.message
end, {
description = "Create an echo prompt",
arguments = {
message = {required = true}
}
})))
-- Register a resource template
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →