### Start SSE MCP Server with Ktor Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Starts an SSE-based MCP server on a specified port. Use the default port 3001 or provide a custom port as a command-line argument. ```kotlin import org.angularthree.runSseMcpServerUsingKtorPlugin fun main(args: Array) { // Start server on default port 3001 runSseMcpServerUsingKtorPlugin(3001) // Or specify custom port via command line argument val port = args.getOrNull(1)?.toIntOrNull() ?: 3001 runSseMcpServerUsingKtorPlugin(port) } ``` -------------------------------- ### Gradle Build and Run Commands Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Standard Gradle commands to build the project, run the MCP server, and execute with a custom port argument. ```bash # Build the project ./gradlew build # Run the MCP server ./gradlew run # Run with custom port argument ./gradlew run --args="ignored 3002" ``` -------------------------------- ### Configure MCP Server Capabilities Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Configures an MCP Server instance with specific capabilities for prompts, resources, and tools, enabling change notification support. ```kotlin import io.modelcontextprotocol.kotlin.sdk.* import io.modelcontextprotocol.kotlin.sdk.server.Server import io.modelcontextprotocol.kotlin.sdk.server.ServerOptions fun configureServer(): Server { val server = Server( Implementation( name = "angular-three-mcp server", version = "1.0.0", ), ServerOptions( capabilities = ServerCapabilities( prompts = ServerCapabilities.Prompts(listChanged = true), resources = ServerCapabilities.Resources(subscribe = true, listChanged = true), tools = ServerCapabilities.Tools(listChanged = true), ) ) ) // Add prompts, tools, and resources here... return server } ``` -------------------------------- ### Add Angular Three Test Tool Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Adds a basic tool that AI clients can invoke. This tool returns a simple 'Hello world!' text response. ```kotlin server.addTool( name = "Angular Three tool", description = "Angular Three test tool", inputSchema = Tool.Input() ) { request -> CallToolResult( content = listOf(TextContent("Hello world!")) ) } ``` -------------------------------- ### Run Ktor SSE MCP Server Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Launches an embedded Ktor server using the CIO engine and the MCP plugin to handle Server-Sent Events (SSE) connections. Ensure the MCP Inspector is accessible for connection. ```kotlin import io.ktor.server.cio.* import io.ktor.server.engine.* import io.modelcontextprotocol.kotlin.sdk.server.mcp import kotlinx.coroutines.runBlocking fun runSseMcpServerUsingKtorPlugin(port: Int): Unit = runBlocking { embeddedServer(CIO, host = "0.0.0.0", port = port) { mcp { return@mcp configureServer() } }.start(wait = true) } // Connect via MCP Inspector: // 1. Open MCP Inspector in browser // 2. Enter URL: http://localhost:3001/sse // 3. Connect to view available prompts, tools, and resources ``` -------------------------------- ### Add Web Search Resource Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Adds a resource that exposes external data. This 'Web Search' resource is a placeholder for web search functionality and returns placeholder content. ```kotlin server.addResource( uri = "https://search.com/", name = "Web Search", description = "Search the web", mimeType = "text/html", ) { request -> ReadResourceResult( contents = listOf( TextResourceContents( "placeholder content for ${request.uri}", request.uri, "text/html" ) ) ) } ``` -------------------------------- ### Gradle Build Configuration for Kotlin JVM Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Configures the Kotlin JVM project with the necessary MCP Kotlin SDK dependency. Use standard Gradle commands for building and running the project. ```kotlin // build.gradle.kts plugins { kotlin("jvm") version "2.1.20" } dependencies { implementation("io.modelcontextprotocol:kotlin-sdk:0.5.0") } kotlin { jvmToolchain(21) } ``` -------------------------------- ### Add Angular Three Developer Prompt Source: https://context7.com/angular-threejs/angular-three-mcp/llms.txt Adds a prompt for AI interactions, specifically for developing Angular Three applications. It accepts a 'Project Name' argument and returns a structured message. ```kotlin server.addPrompt( name = "Angular Three Developer", description = "Develop small Angular Three applications", arguments = listOf( PromptArgument( name = "Project Name", description = "The name of the project", required = true ) ) ) { request -> GetPromptResult( "Description for ${request.name}", messages = listOf( PromptMessage( role = Role.user, content = TextContent("Develop a project named ${request.arguments?.get("Project Name")}") ) ) ) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.