A sample implementation of an MCP (Model Communication Protocol) server in Kotlin that demonstrates different server configurations and transport methods.
- Multiple server operation modes:
- Standard I/O server
- SSE (Server-Sent Events) server with plain configuration
- SSE server using Ktor plugin
- Built-in capabilities for:
- Prompts management
- Resources handling
- Tools integration
To run the server in SSE mode on the port 3001, run:
./gradlew run
For SSE servers (both plain and Ktor plugin versions):
- Start the server
- Use the MCP inspector to connect to
http://localhost:<port>/sse
- Prompts: Supports prompt management with list change notifications
- Resources: Includes subscription support and list change notifications
- Tools: Supports tool management with list change notifications
The server is implemented using:
- Ktor for HTTP server functionality
- Kotlin coroutines for asynchronous operations
- SSE for real-time communication
- Standard I/O for command-line interface