
ufownl/lua-resty-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Model Context Protocol SDK implemented in Lua for OpenResty
개요
- [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 A simple server demonstrating prompts, resources, tools: syntax: server, err = mcp.server(transport[, options]) Create an MCP server session with the specific transport (currently only mcp.transport.stdio is available here) and options. A successful call returns an MCP server session. Otherwise, it returns nil and a string describing the error. * mcp.transport.stdio * mcp.transport.websocket 1. The optional field title is intended for UI and end-user contexts — optimized to be human-readable and easily understood, even by those unfamiliar with domain-specific terminology. If not provided, the name should be used for display; 2.
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 가이드부터 시작하세요 →