modelcontextprotocol / modelcontextprotocol/kotlin-sdk

Support Android targets for remote MCP clients

Open
#972 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Kotlin
Stars
1.5k
Forks
248
Avg merge
1d 20h
Merged PRs (30d)
23

Description

Is your feature request related to a problem? Please describe.

Android applications can act as MCP hosts and connect to remote MCP servers to discover and invoke tools. The Kotlin SDK already provides client APIs and Streamable HTTP transport APIs that fit this use case.

Android applications may be able to consume the JVM variant in some configurations, but Android is not part of the SDK's declared target matrix.

As a result, the SDK does not publish an Android-specific variant or run Android compatibility tests. Android consumers must independently validate dependency resolution, runtime behavior, minified release builds, and SDK upgrades. A regression caused by a JDK-only API or an Android-incompatible dependency can therefore be discovered only downstream.

Describe the solution you'd like

Add officially supported Android targets for the client-facing modules:

  • kotlin-sdk-core
  • kotlin-sdk-client

The initial support scope could focus on Android applications connecting to remote MCP servers over HTTPS using Streamable HTTP.

The SDK should continue to accept a caller-provided Ktor HttpClient. Android consumers could then choose an appropriate engine, such as ktor-client-okhttp, without the SDK forcing a specific engine dependency.

An official Android client target would make this compatibility contract explicit and allow the SDK to detect Android regressions before release.

Suggested validation scope:

  • Android dependency resolution and published Android variants
  • Client initialization and shutdown
  • StreamableHttpClientTransport
  • tools/list and tools/call
  • JSON and SSE response handling
  • request headers
  • release/R8 compatibility

Describe alternatives you've considered

  1. Consume the JVM variant from an Android application

    This can work for some API and dependency combinations, but Android compatibility is not explicitly declared or continuously verified by the SDK.

  2. Use a third-party Android MCP wrapper

    This can provide a project-specific solution, but duplicates protocol integration, compatibility testing, and lifecycle handling outside the official SDK.

  3. Implement the MCP protocol directly in an Android application

    This avoids SDK compatibility uncertainty, but duplicates the protocol client, Streamable HTTP transport, lifecycle handling, and future specification updates.

Additional context

This proposal is intentionally client-only and has a limited initial scope. It does not propose:

  • running an MCP server on Android;
  • stdio transport support;
  • Android-specific OAuth UI, credential storage, deep-link handling, or configuration screens;
  • WebSocket support as an initial requirement;
  • changes to the MCP protocol or existing public client APIs.

I would be interested in contributing this feature. Before starting implementation, I would appreciate maintainer guidance on the intended scope, supported Android versions, testing strategy, and publishing conventions, so that a potential contribution aligns with the project’s maintenance expectations.

If this direction is in scope, I am happy to prepare a small proof of concept and then submit a focused PR based on maintainer feedback.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the target and publishing setup for kotlin-sdk-core and kotlin-sdk-client, then trace Client and StreamableHttpClientTransport usage. Confirm the intended Android versions and testing strategy with maintainers. Done means published Android variants and validation covering initialization, shutdown, tools/list, tools/call, JSON/SSE handling, headers, dependency resolution, and release/R8 compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
api, mobile, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.