Skip to content

Make agents-mcp support KMP targets#756

Merged
kpavlov merged 6 commits into
developfrom
kpavlov/agents-mcp-kmp
Sep 12, 2025
Merged

Make agents-mcp support KMP targets#756
kpavlov merged 6 commits into
developfrom
kpavlov/agents-mcp-kmp

Conversation

@kpavlov
Copy link
Copy Markdown
Contributor

@kpavlov kpavlov commented Sep 7, 2025

Motivation and Context

To make McpTool cross-platform

Changes

  • Moved reusable implementations (e.g., McpToolRegistryProvider, McpTool) to commonMain.
  • Updated Gradle configurations to align with Multiplatform support.
  • Adjusted platform-specific implementations where necessary.
  • Improved test structure using shared test utilities.

Breaking Changes

  • McpToolRegistryProvider.defaultStdioTransport is JVM-only and has to be imported (import ai.koog.agents.mcp.defaultStdioTransport)

Type of the changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tests improvement
  • Refactoring

Checklist

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

@kpavlov kpavlov requested a review from devcrocod September 7, 2025 14:04
@kpavlov kpavlov added the refactoring Code improvements that enhance structure, readability, and quality without changing functionality label Sep 7, 2025
@kpavlov
Copy link
Copy Markdown
Contributor Author

kpavlov commented Sep 7, 2025

Project compiles with Kotlin 2.2.0+

@kpavlov kpavlov changed the title Support KMP targets in agents-mcp Agents-mcp to support KMP targets Sep 7, 2025
@kpavlov kpavlov changed the title Agents-mcp to support KMP targets Make agents-mcp support KMP targets Sep 7, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 7, 2025

Qodana for JVM

833 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 792
Missing KDoc for public API declaration 🔶 Warning 25
Vulnerable imported dependency 🔶 Warning 16
@@ Code coverage @@
+ 67% total lines covered
11273 lines analyzed, 7580 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 8, 2025

Qodana for JVM

870 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 825
Missing KDoc for public API declaration 🔶 Warning 24
Vulnerable imported dependency 🔶 Warning 21
@@ Code coverage @@
+ 67% total lines covered
11681 lines analyzed, 7922 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@kpavlov kpavlov marked this pull request as ready for review September 8, 2025 14:15
@kpavlov kpavlov added the dependencies Update dependencies label Sep 8, 2025
@kpavlov kpavlov force-pushed the kpavlov/agents-mcp-kmp branch from 01db1a7 to e11de91 Compare September 8, 2025 14:22
## Changes
- Moved reusable implementations (e.g., `McpToolRegistryProvider`, `McpTool`) to `commonMain`.
- Updated Gradle configurations to align with Multiplatform support.
- Adjusted platform-specific implementations where necessary.
- Improved test structure using shared test utilities.
## Motivation and Context

To streamline Android and Native dependencies and fix Ktor CIO
dependency leaking to iOS and Android.

- Added Android support for multiple modules, including Android-specific
implementations for coroutine dispatchers.
- Removed CIO engine from common dependencies (KG-315 / #710)
- Configured Kotlin/JS targets with npm instead of yarn to minimize
build dependencies in `gradle.properties`.
- Integrated `google()` repository and Android Gradle Plugin setup
(`com.android.library`) in build scripts.
- Updated dependencies (`android-tools-gradle`, `ktor-client-cio`) and
Gradle plugin versions.
- Minor refactor in `KtorIntegrationExample` (OpenTelemetry exporter
setup).
- Updated CONTRIBUTING.md to include note on Node.js requirement for
Kotlin/JS targets.

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

---

#### Type of the changes
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Tests improvement
- [x] Refactoring

#### Checklist
- [ ] The pull request has a description of the proposed change
- [ ] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [ ] The pull request uses **`develop`** as the base branch
- [ ] Tests for the changes have been added
- [ ] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [ ] An issue describing the proposed change exists
- [ ] The pull request includes a link to the issue
- [ ] The change was discussed and approved in the issue
- [ ] Docs have been added / updated
#724)

## Motivation and Context

To speed up the build

## Changes

- Update Qodana action to `v2025.2` and enable caching on default branch
- Added `kotlin.native.ignoreDisabledTargets=true` to remove noise in
logs

---

#### Type of the changes
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Tests improvement
- [x] Refactoring
- [x] CI configuration updates 

#### Checklist
- [ ] The pull request has a description of the proposed change
- [ ] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [ ] The pull request uses **`develop`** as the base branch
- [ ] Tests for the changes have been added
- [x] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [ ] An issue describing the proposed change exists
- [ ] The pull request includes a link to the issue
- [ ] The change was discussed and approved in the issue
- [ ] Docs have been added / updated
@kpavlov kpavlov force-pushed the kpavlov/agents-mcp-kmp branch from e11de91 to 6024a0a Compare September 12, 2025 08:14
- Bump MCP SDK to version `0.7.0`.
- Split MCP dependencies into `mcp-client` and `mcp-server`.
- Update Gradle configurations and test dependencies accordingly.
@kpavlov kpavlov force-pushed the kpavlov/agents-mcp-kmp branch from 4874eb1 to 65ad4a3 Compare September 12, 2025 09:02
Copy link
Copy Markdown
Contributor

@devcrocod devcrocod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please take a look at my little comments

Comment thread agents/agents-mcp/build.gradle.kts
Comment thread gradle.properties
@kpavlov kpavlov merged commit 4259435 into develop Sep 12, 2025
8 checks passed
@kpavlov kpavlov deleted the kpavlov/agents-mcp-kmp branch September 12, 2025 09:46
Ololoshechkin pushed a commit that referenced this pull request Sep 12, 2025
## Motivation and Context

To make McpTool cross-platform 
- KG-380
- [Slack
thread](https://kotlinlang.slack.com/archives/C08SLB97W23/p1757126633769069)
- Requires #764 

## Changes
- Moved reusable implementations (e.g., `McpToolRegistryProvider`,
`McpTool`) to `commonMain`.
- Updated Gradle configurations to align with Multiplatform support.
- Adjusted platform-specific implementations where necessary.
- Improved test structure using shared test utilities.

## Breaking Changes
- McpToolRegistryProvider.defaultStdioTransport is JVM-only and has to
be imported (`import ai.koog.agents.mcp.defaultStdioTransport`)

---

#### Type of the changes
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Tests improvement
- [x] Refactoring

#### Checklist
- [ ] The pull request has a description of the proposed change
- [ ] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [x] The pull request uses **`develop`** as the base branch
- [ ] Tests for the changes have been added
- [ ] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [ ] An issue describing the proposed change exists
- [ ] The pull request includes a link to the issue
- [ ] The change was discussed and approved in the issue
- [ ] Docs have been added / updated
karloti pushed a commit to karloti/koog that referenced this pull request Sep 20, 2025
## Motivation and Context

To make McpTool cross-platform 
- KG-380
- [Slack
thread](https://kotlinlang.slack.com/archives/C08SLB97W23/p1757126633769069)
- Requires JetBrains#764 

## Changes
- Moved reusable implementations (e.g., `McpToolRegistryProvider`,
`McpTool`) to `commonMain`.
- Updated Gradle configurations to align with Multiplatform support.
- Adjusted platform-specific implementations where necessary.
- Improved test structure using shared test utilities.

## Breaking Changes
- McpToolRegistryProvider.defaultStdioTransport is JVM-only and has to
be imported (`import ai.koog.agents.mcp.defaultStdioTransport`)

---

#### Type of the changes
- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Tests improvement
- [x] Refactoring

#### Checklist
- [ ] The pull request has a description of the proposed change
- [ ] I read the [Contributing
Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md)
before opening the pull request
- [x] The pull request uses **`develop`** as the base branch
- [ ] Tests for the changes have been added
- [ ] All new and existing tests passed

##### Additional steps for pull requests adding a new feature
- [ ] An issue describing the proposed change exists
- [ ] The pull request includes a link to the issue
- [ ] The change was discussed and approved in the issue
- [ ] Docs have been added / updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Update dependencies refactoring Code improvements that enhance structure, readability, and quality without changing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants