{"id":42549620,"url":"https://github.com/monkopedia/ksrpc","last_synced_at":"2026-05-03T23:11:32.845Z","repository":{"id":50608198,"uuid":"305151870","full_name":"Monkopedia/ksrpc","owner":"Monkopedia","description":"ksrpc is a simple library that allows for json-like RPCs with a simple service declaration in kotlin common.","archived":false,"fork":false,"pushed_at":"2026-01-20T21:46:22.000Z","size":52813,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-21T05:34:08.054Z","etag":null,"topics":["kotlin","kotlin-multiplatform","rpc-framework"],"latest_commit_sha":null,"homepage":"https://monkopedia.github.io/ksrpc/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Monkopedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-18T16:57:56.000Z","updated_at":"2026-01-20T21:44:35.000Z","dependencies_parsed_at":"2025-09-29T21:39:15.519Z","dependency_job_id":null,"html_url":"https://github.com/Monkopedia/ksrpc","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/Monkopedia/ksrpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monkopedia%2Fksrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monkopedia%2Fksrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monkopedia%2Fksrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monkopedia%2Fksrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Monkopedia","download_url":"https://codeload.github.com/Monkopedia/ksrpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Monkopedia%2Fksrpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28849377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin","kotlin-multiplatform","rpc-framework"],"created_at":"2026-01-28T19:02:49.216Z","updated_at":"2026-05-03T23:11:32.838Z","avatar_url":"https://github.com/Monkopedia.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin Simple RPCs\n\n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Kotlin](https://img.shields.io/badge/kotlin-2.3.20-blue.svg?logo=kotlin)](http://kotlinlang.org)\n[![Maven Central](https://img.shields.io/maven-central/v/com.monkopedia.ksrpc/ksrpc-core/0.11.1)](https://search.maven.org/artifact/com.monkopedia.ksrpc/ksrpc-core/0.11.1/pom)\n[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://monkopedia.github.io/ksrpc/)\n\nDefine a service interface once in Kotlin common, then call it over HTTP, sockets, stdin/out,\nwebsockets, or in-process, without changing your service code. Built for Kotlin Multiplatform,\ncurl-testable by default, and LSP-protocol-compatible out of the box.\n\n## Quick Start\n\n```kotlin\n@KsService\ninterface GreetingService : RpcService {\n    @KsMethod(\"/greet\")\n    suspend fun greet(name: String): String\n}\n\n// Implement once\nclass GreetingServiceImpl : GreetingService {\n    override suspend fun greet(name: String) = \"Hello, $name!\"\n}\n\n// Host over HTTP\nval env = ksrpcEnvironment { }\nembeddedServer(Netty, 8080) {\n    routing { serveHttp(\"/api\", GreetingServiceImpl(), env) }\n}.start()\n\n// Call from any platform\nval service = HttpClient { }.asHttpChannelClient(\"http://localhost:8080/api\", env)\n    .defaultChannel().toStub\u003cGreetingService\u003e()\nprintln(service.greet(\"world\")) // \"Hello, world!\"\n```\n\n## Build Setup\n\n```kotlin\nplugins {\n    id(\"com.monkopedia.ksrpc.plugin\") version \"0.11.1\"\n}\n\ndependencies {\n    implementation(\"com.monkopedia.ksrpc:ksrpc-core:0.11.1\")\n    // Add transport modules as needed:\n    // implementation(\"com.monkopedia.ksrpc:ksrpc-ktor-server:0.11.1\")\n    // implementation(\"com.monkopedia.ksrpc:ksrpc-ktor-client:0.11.1\")\n}\n```\n\n## Supported Transports\n\n| Transport | Platforms | Module |\n|-----------|-----------|--------|\n| HTTP | JVM, Native, JS/WASM (client) | `ksrpc-ktor-client`, `ksrpc-ktor-server` |\n| WebSockets | JVM, Native, JS/WASM (client) | `ksrpc-ktor-websocket-client`, `ksrpc-ktor-websocket-server` |\n| Sockets | JVM, POSIX Native | `ksrpc-sockets` |\n| Stdin/out | JVM, POSIX Native | `ksrpc-sockets` |\n| JSON-RPC 2.0 | JVM, POSIX Native | `ksrpc-jsonrpc` |\n| Service Workers | JS (experimental) | `ksrpc-service-worker` |\n\n## Features\n\n- **Service declaration** -- Define services with [`@KsService`](https://monkopedia.github.io/ksrpc/ksrpc-api/com.monkopedia.ksrpc.annotation/-ks-service/index.html) and [`@KsMethod`](https://monkopedia.github.io/ksrpc/ksrpc-api/com.monkopedia.ksrpc.annotation/-ks-method/index.html); the compiler plugin generates stubs and companions automatically. [Guide](https://monkopedia.github.io/ksrpc/)\n- **Sub-services** -- Pass services as method parameters or return values for contextual callbacks and hierarchical APIs. [Guide](https://monkopedia.github.io/ksrpc/)\n- **Bidirectional communication** -- [`Connection`](https://monkopedia.github.io/ksrpc/ksrpc-core/com.monkopedia.ksrpc.channels/-connection/index.html) supports hosting and calling services simultaneously over the same channel. [Guide](https://monkopedia.github.io/ksrpc/)\n- **Binary data** -- Stream binary payloads via [`RpcBinaryData`](https://monkopedia.github.io/ksrpc/ksrpc-core/com.monkopedia.ksrpc.channels/-rpc-binary-data/index.html) with adapters for ktor, kotlinx-io, and okio.\n- **Typed errors** -- Map exceptions to wire-format error codes with [`@KsError`](https://monkopedia.github.io/ksrpc/ksrpc-api/com.monkopedia.ksrpc.annotation/-ks-error/index.html) and [`KsrpcException`](https://monkopedia.github.io/ksrpc/ksrpc-core/com.monkopedia.ksrpc/-ksrpc-exception/index.html). [Guide](https://monkopedia.github.io/ksrpc/)\n- **Context propagation** -- Propagate per-call context (auth tokens, trace IDs) across transports with [`@KsContext`](https://monkopedia.github.io/ksrpc/ksrpc-api/com.monkopedia.ksrpc.annotation/-ks-context/index.html). [Guide](https://monkopedia.github.io/ksrpc/)\n- **Introspection** -- Opt in with [`@KsIntrospectable`](https://monkopedia.github.io/ksrpc/ksrpc-introspection/com.monkopedia.ksrpc.annotation/-ks-introspectable/index.html) to expose endpoint metadata and schemas at runtime. [Guide](https://monkopedia.github.io/ksrpc/)\n- **Flow streaming** -- Use `Flow\u003cT\u003e` in method signatures for streaming results over any transport, backed by [`KsFlowService`](https://monkopedia.github.io/ksrpc/ksrpc-flow/com.monkopedia.ksrpc.flow/-ks-flow-service/index.html). [Guide](https://monkopedia.github.io/ksrpc/)\n- **JSON-RPC 2.0 notifications** -- Mark methods with [`@KsNotification`](https://monkopedia.github.io/ksrpc/ksrpc-api/com.monkopedia.ksrpc.annotation/-ks-notification/index.html) for fire-and-forget semantics.\n\n## Why not gRPC?\n\nksrpc exists because gRPC and protobuf didn't quite fit. I wanted JSON on the wire so I could\ncurl at services for testing, stdin/out support like LSP, and first-class Kotlin Multiplatform\ncoverage. ksrpc fills that niche: simple service declarations, multiple transports, and\nbroad platform support.\n\n## Documentation\n\nFull API reference and guides are hosted at [monkopedia.github.io/ksrpc](https://monkopedia.github.io/ksrpc/).\n\n## License\n\n```\nCopyright 2026 Jason Monk\n\nLicensed under the Apache License, Version 2.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkopedia%2Fksrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkopedia%2Fksrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkopedia%2Fksrpc/lists"}