ktor-server

Automates setup of Ktor HTTP servers with routing, authentication, and plugins across Netty, CIO, Jetty, and Tomcat engines.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ClankerGuru/opsx --skill ktor-server
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ktor-server
Source: https://github.com/ClankerGuru/opsx/tree/main/cli/src/main/resources/content/skills/ktor-server
Command: npx skills add https://github.com/ClankerGuru/opsx --skill ktor-server

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps Kotlin developers quickly bootstrap and configure a Ktor HTTP/WebSocket server, providing a cohesive structure for modules, routing, configuration, and common plugins, so teams can ship features faster.

Core Features & Use Cases

  • EmbeddedServer and EngineMain setups (Netty/CIO/Jetty/Tomcat) with practical defaults.
  • Routing, parameter handling, static content, WebSockets, SSE, and content negotiation.
  • Authentication, Sessions, and essential plugins (CallLogging, CORS, StatusPages, Micrometer-like metrics, and graceful shutdown).

Quick Start

Run the example to start a Ktor server with a predefined module and Netty engine, enabling rapid experimentation.

Frequently Asked Questions about ktor-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Kotlin HTTP server with WebSocket support?

To set up a Kotlin HTTP server with WebSocket support, you configure an embedded Ktor server using Netty or CIO engines, define routing, and install WebSocket plugins within a module to handle real-time client connections.

What is the best way to configure routing and content negotiation for a Kotlin API?

The best way to configure routing and content negotiation for a Kotlin API is using Ktor modules to define route paths and apply content negotiation plugins, automatically serializing and deserializing JSON or other payload formats.

Can I run a Ktor server on Jetty or Tomcat instead of Netty?

Yes, you can run a Ktor server on Jetty or Tomcat instead of Netty by using EngineMain configuration, which allows you to switch server engines seamlessly while maintaining the same routing and module structure across different environments.

How do I add authentication and sessions to my Ktor HTTP server?

You add authentication and sessions to your Ktor HTTP server by installing the Authentication and Sessions plugins in your application module, configuring session storage and auth providers to secure routing endpoints and maintain user state.

Does Ktor support SSE and graceful shutdown for streaming endpoints?

Yes, Ktor supports SSE and graceful shutdown for streaming endpoints by enabling Server-Sent Events plugins alongside graceful shutdown configuration, ensuring active HTTP connections complete data transmission before server termination.