Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungChrome Already Has The Eyedropper You're Building(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungFor VS Code lovers, you can have a colored border and more from now...(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungNuxt Hydration Mismatch: Why It Happens and How to Fix It(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungYour Browser Is Rejecting Every Drop On Purpose(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungReact Derived State: Why That useState Is Probably a Bug(20.09.2026 um 18:27 Uhr)
Sichere ProgrammierungI tried OpenProject and Vikunja. Then I built Agila.(20.09.2026 um 18:37 Uhr)
Sichere ProgrammierungSkill Recorder keeps your screen local until you press Analyze(20.09.2026 um 18:38 Uhr)
Sichere ProgrammierungChrome Already Has The Eyedropper You're Building(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungFor VS Code lovers, you can have a colored border and more from now...(20.09.2026 um 18:25 Uhr)
Sichere ProgrammierungNuxt Hydration Mismatch: Why It Happens and How to Fix It(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungYour Browser Is Rejecting Every Drop On Purpose(20.09.2026 um 18:26 Uhr)
Sichere ProgrammierungReact Derived State: Why That useState Is Probably a Bug(20.09.2026 um 18:27 Uhr)
Sichere ProgrammierungI tried OpenProject and Vikunja. Then I built Agila.(20.09.2026 um 18:37 Uhr)
Sichere ProgrammierungSkill Recorder keeps your screen local until you press Analyze(20.09.2026 um 18:38 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

A Domain MCP Server in Kotlin: Exposing a Scoring Engine to AI Agents

Reagiere als Erste:r — dein Feedback zählt!

Previously, I gave an AI agent hands — a Model Context Protocol server in Kotlin/Native that drives real Bluetooth hardware. This one is the other half of the pattern: a domain MCP server. Instead of touching devices, it lets an agent reason over a model — turning weather forecasts into an activity "playability score" — and, crucially, it runs on the exact same Kotlin Multiplatform core that powers the app. Write the domain once; expose it to both humans and agents.

The tools

The WeatherConditions MCP server (JVM, built on the Kotlin MCP SDK + Ktor) exposes five tools:

Tool What it does
score_location Score one location's playability for an activity profile, with a factor-by-factor breakdown
rank_locations Score and rank several locations at once
list_profiles List the available activity profiles (golf, dog-walking, …)
get_profile Fetch one profile's definition
upsert_profile Create or update a profile

So an agent can answer "where's the best place to walk the dog this afternoon?" by calling rank_locations with a dog_walking profile — and get back not just a number, but why.

Write the domain once, expose it twice

Here's the part I care about most. The scoring logic doesn't live in the server. It lives in WeatherConditions-CoreLib — a framework-free Kotlin Multiplatform module with zero platform dependencies:

core-lib/
├── domain/model/     PlayabilityProfile, WeatherPeriod, ActivityScore, ScoreFactor…
├── domain/usecase/   PlayabilityCalculator, ActivityScorer, ScorerRegistry, DogWalkingScorer
└── ports/outbound/   ForecastService, LocationService, ReverseGeocoding, Clock…  (interfaces only)

The same core-lib artifact is consumed by the Android/iOS/watchOS/WearOS apps and by this JVM MCP server. The app provides a CameraX/CoreLocation adapter for the LocationService port; the server provides a Ktor + Google Weather API adapter. The scoring — the thing with actual business value — is written exactly once.

// In the MCP server — the domain does the work, the server just adapts I/O.
server.addTool(
    name = "score_location",
    description = "Score a location's playability for an activity profile",
    inputSchema = Tool.Input(
        properties = buildJsonObject {
            putJsonObject("location") { put("type", "string") }
            putJsonObject("profile")  { put("type", "string") }
        },
        required = listOf("location")
    )
) { request ->
    val ctx   = service.buildScoringContext(request.location())     // Ktor → Google Weather
    val score = PlayabilityCalculator().calculateScore(ctx, profile) // ← CoreLib, shared
    text(score.render())                                            // value + factor breakdown
}

PlayabilityCalculator and DogWalkingScorer are the same classes the mobile app calls. The MCP server is a thin shell around a portable core.

Explainable by construction

A score the agent can't justify is worse than no score. The domain returns an ActivityScore made of ScoreFactors — wind, precipitation, temperature, time-of-day — each with its own contribution. So score_location doesn't just say "62/100"; it says "62 — strong wind (−18), light rain expected after 4pm (−12), comfortable temperature (+8)." That structure is what makes the tool genuinely useful to an LLM: it can explain, compare, and reason about the result instead of parroting a number.

Profiles: the configurable surface

Notice upsert_profile. A profile is the tunable definition of what "good weather" means for an activity — wind tolerance, ideal temperature band, rain sensitivity. They're first-class, stored, and syncable (the core even has a pairing-code-derived PSK sync protocol so profiles travel between devices).

That matters beyond this server: profiles are configuration. An agent can edit them via upsert_profile, but a human will want a real settings screen — sliders and toggles — on whatever device they're holding. Which is exactly where the next post in this series goes: using Multiplat to render cross-platform settings UIs for MCP servers like this one, straight from their tool schemas.

The pattern, generalized

Two MCP servers, two flavors:

  • Bluetooth MCP — a side-effect server: scan, connect, write, sync. Kotlin/Native, talks to hardware.
  • WeatherConditions MCP — a domain server: score, rank, configure. JVM, wraps a shared KMP core.

Both prove the same thesis: Kotlin Multiplatform lets you expose native and domain capabilities to agents while reusing the code that already runs your apps. The agent ecosystem is busy wrapping web APIs; there's a lot of room below that, in the native and cross-platform layer.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten A Domain MCP Server in Kotlin: Exposing a Scoring Engine to AI Agents

Thematisch verwandte Begriffe: Domain, Server, Kotlin, Exposing · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick