Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,24 @@
- run: npm test

- run: npm run prettier

kotlin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"

- name: Build Kotlin SDK
working-directory: kotlin
run: |
chmod +x gradlew
./gradlew build

- name: Test Kotlin SDK
working-directory: kotlin
run: ./gradlew test
Comment on lines +41 to +59

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

The best fix is to explicitly add a permissions block at the root level of the workflow file .github/workflows/ci.yml. This will apply the specified minimal permissions to all jobs (unless any override them individually). As recommended, setting contents: read is the least privilege needed for typical CI build/test workflows. No other changes are required unless future workflow steps are added that require additional permissions.

To implement this, insert the following YAML section directly after the name: CI line (so it applies globally):

permissions:
  contents: read

This ensures the workflow restricts GitHub token permissions to only those required for read access to repository contents.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,6 @@
 name: CI
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: CI
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ examples/basic-server-react/**/*.ts
examples/basic-server-react/**/*.tsx
examples/basic-server-vanillajs/**/*.ts
examples/basic-server-vanillajs/**/*.tsx

# Swift package manager build artifacts
sdk/swift/.build/
examples/basic-host-swift/.build/
examples/basic-host-swift/build/
examples/basic-host-kotlin/.gradle/
examples/basic-host-kotlin/build/

# Swift build artifacts
swift/.build/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Start with these foundational examples to learn the SDK:

- [`examples/basic-server-vanillajs`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-vanillajs) — Example MCP server with tools that return UI Apps (vanilla JS)
- [`examples/basic-server-react`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-react) — Example MCP server with tools that return UI Apps (React)
- [`examples/basic-host`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) — Bare-bones example of hosting MCP Apps
- [`examples/basic-host`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) — Bare-bones example of hosting MCP Apps (TypeScript/React)
- [`examples/basic-host-kotlin`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host-kotlin) — Android example of hosting MCP Apps (Kotlin/Jetpack Compose)

The [`examples/`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples) directory contains additional demo apps showcasing real-world use cases.

Expand Down
12 changes: 12 additions & 0 deletions examples/basic-host-kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Gradle
.gradle/
build/
!gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.properties

# IDE
.idea/
*.iml

# Local properties
local.properties
Loading
Loading