kmp-api-lookup-mcp
Enables lookup of iOS platform APIs through Kotlin/Native klib indexing, supporting iOS-specific frameworks such as AVFoundation, UIKit, Foundation, and MediaPlayer for iOS development targets including ios_simulator_arm64 and ios_arm64.
Provides tools for indexing and querying Kotlin/Native platform klib APIs, enabling fast symbol lookup, metadata retrieval, and signature resolution from local Kotlin/Native libraries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kmp-api-lookup-mcp} look up AVPlayer in AVFoundation "
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kmp-api-lookup-mcp
MCP server for fast lookup of Kotlin/Native iOS klib APIs.
The server indexes local Kotlin/Native platform klibs into a persistent SQLite database and exposes a compact MCP API for symbol lookup and index maintenance.
Installation
Prerequisites
Node.js 22+
A local Kotlin/Native installation with platform klibs available through
KONAN_HOMEor~/.konan
From npm (recommended)
npm install -g kmp-api-lookup-mcpRun without global install via npx
npx -y kmp-api-lookup-mcpThis does not install the package globally. npm downloads and runs the published binary on demand.
From source
git clone https://github.com/SuLG-ik/kmp-api-lookup-mcp.git
cd kmp-api-lookup-mcp
npm install
npm run build
npm linkQuick Start
As an MCP Server
Add the server to your MCP client configuration.
Common config file locations:
macOS Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows Claude Desktop:
%APPDATA%/Claude/claude_desktop_config.jsonLinux Claude Desktop:
~/.config/Claude/claude_desktop_config.json
Ready-to-copy example files are included in the repository:
claude_desktop_config.json.examplefor a global npm installclaude_desktop_config.npx.json.examplefor running the published package throughnpxclaude_desktop_config.konan_home.json.examplefor a global npm install with explicitKONAN_HOMEclaude_desktop_config.from_source.json.examplefor running the built server from the repository
If the package is installed globally:
{
"mcpServers": {
"kmp-api-lookup": {
"command": "kmp-api-lookup-mcp"
}
}
}If you prefer not to install the package globally:
{
"mcpServers": {
"kmp-api-lookup": {
"command": "npx",
"args": ["-y", "kmp-api-lookup-mcp"]
}
}
}This is convenient for quick setup, but the first launch can be slower because npx may need to download the package.
If you want to point directly at a specific Kotlin/Native installation:
{
"mcpServers": {
"kmp-api-lookup": {
"command": "kmp-api-lookup-mcp",
"env": {
"KONAN_HOME": "/Users/you/.konan/kotlin-native-prebuilt-macos-aarch64-2.2.21"
}
}
}
}If you run the server from source:
{
"mcpServers": {
"kmp-api-lookup": {
"command": "node",
"args": ["/absolute/path/to/kmp-api-lookup-mcp/dist/index.js"]
}
}
}First Run
After the server starts, the usual first steps are:
Call
get_klib_index_statusto see whether an index already exists.If the index is missing, call
rebuild_klib_indexfor the Kotlin/Native version and target you need.Start querying symbols with
lookup_symbol.
Example rebuild request:
{
"kotlinVersion": "2.2.21",
"target": "ios_simulator_arm64",
"frameworks": ["AVFoundation", "AVKit", "MediaPlayer", "AVFAudio"]
}Current Scope
TypeScript npm ESM MCP server over stdio
Persistent SQLite cache in the user cache directory
Discovery of Kotlin/Native prebuilt installations via
KONAN_HOME,~/.konan, or an explicit pathManual index rebuild from
klib dump-metadata-signaturesOn-demand enrichment from
klib dump-metadatafor full Kotlin signatures, class hierarchy, and importsStructured JSON MCP responses with short text summaries
Implemented Tools
lookup_symbol
Resolve a Kotlin/Native Apple platform class, member, or top-level platform alias/constant into a compact development card.
Input:
{
"query": "AVPlayer",
"frameworks": ["AVFoundation"],
"detail": "compact",
"queryKind": "auto"
}Behavior:
A class query like
AVPlayerreturns one class card with:full Kotlin class signature
superclass and implemented interfaces
all constructors, instance methods, and class methods when
detailis omitted or set tocompact, grouped by member name to reduce output sizea separate
propertieslist in compact mode with explicitaccessors.getterandaccessors.setterflags when matching getter/setter methods exist for that propertycompact mode removes only duplicated property accessor methods; it does not trim unrelated methods from the class surface
the full direct member set, ObjC bridge extension members, and
Metaclass members whendetailis set tofullrequiredImportsfor code generation
A member query like
AVPlayer.playorplayreturns a compact grouped card with overload signatures and imports.Exact top-level platform aliases and constants like
AVPlayerStatus,AVLayerVideoGravity, orAVPlayerItemDidPlayToEndTimeNotificationresolve to package-scoped member cards instead of degrading into fuzzy class matches.If the query is ambiguous, the tool returns a short alternatives list instead of dumping raw search rows.
Output intentionally omits noisy fields like DB paths, internal IDs, raw metadata dumps, match stages, and installation paths.
detaildefaults tocompact. Use"detail": "full"only when you really need the entire class surface.
get_klib_index_status
Return a compact index summary.
Input:
{}Output includes:
readydiscovered Kotlin/Native versions and targets
indexed datasets with counts
aggregate symbol counts
lastRebuildAt
rebuild_klib_index
Build or refresh the SQLite index from local klibs.
Input:
{
"kotlinVersion": "2.2.21",
"target": "ios_simulator_arm64",
"frameworks": ["Foundation", "UIKit"],
"force": false,
"dryRun": false,
"cleanBefore": true
}Rules:
kotlinVersionandkonanHomeare optional, but you may provide at most one of them.If both are omitted, the latest discovered local Kotlin/Native installation is used.
If
targetis omitted, the server prefersios_simulator_arm64, thenios_arm64, thenios_x64.If
frameworksis omitted, the rebuild covers all frameworks for the selected target.dryRun=truecomputes the rebuild plan without writing to SQLite.force=trueignores freshness checks.cleanBefore=trueremoves existing rows for the affected frameworks before writing fresh records.
Storage Layout
The server stores data outside the repository.
SQLite DB: user cache dir +
klib-index.sqliteService metadata: user cache dir +
state.json
Typical cache locations:
macOS:
~/Library/Caches/kmp-api-lookup-mcp/Linux:
${XDG_CACHE_HOME:-~/.cache}/kmp-api-lookup-mcp/Windows:
%LOCALAPPDATA%/kmp-api-lookup-mcp/
Discovery Rules
Installations are discovered in this order:
Explicit
konanHomeargument when a tool provides itKONAN_HOME~/.konan/kotlin-native-prebuilt-*
Each installation is validated by checking for:
bin/klibklib/platform/
MCP Configuration
Run From Source
{
"mcpServers": {
"kmp-api-lookup": {
"command": "node",
"args": ["/absolute/path/to/kmp-api-lookup-mcp/dist/index.js"]
}
}
}Optional environment override:
{
"mcpServers": {
"kmp-api-lookup": {
"command": "node",
"args": ["/absolute/path/to/kmp-api-lookup-mcp/dist/index.js"],
"env": {
"KONAN_HOME": "/Users/you/.konan/kotlin-native-prebuilt-macos-aarch64-2.2.21"
}
}
}
}Run As Installed Binary
{
"mcpServers": {
"kmp-api-lookup": {
"command": "kmp-api-lookup-mcp"
}
}
}Typical Installed-Binary Configuration
{
"mcpServers": {
"kmp-api-lookup": {
"command": "kmp-api-lookup-mcp",
"env": {
"KONAN_HOME": "/Users/you/.konan/kotlin-native-prebuilt-macos-aarch64-2.2.21"
}
}
}
}Development
Scripts
npm run devstarts the server from TypeScript sourcesnpm run buildcompiles todist/npm startruns the compiled servernpm run typecheckruns TypeScript type checkingnpm testruns Vitestnpm run test:watchstarts Vitest in watch mode
Local Workflow
npm install
npm run typecheck
npm run build
npm testPublishing
npm publication is handled by GitHub Actions.
Push a tag in the form
vX.Y.ZwhereX.Y.Zmatches theversioninpackage.json.The
Publish Packageworkflow validates the package and publishes it to npm.The npm package must be configured for trusted publishing from the
SuLG-ik/kmp-api-lookup-mcpGitHub repository.See PUBLISHING.md for the one-time npm setup and the exact release steps.
Test Coverage
The current test suite covers:
MCP tool registration
dump-metadata-signaturesline parsingSQLite storage and search behavior on synthetic fixtures
server runtime creation
Project Structure
.
├── src/
│ ├── index.ts
│ ├── config/
│ ├── indexer/
│ ├── server/
│ ├── storage/
│ ├── tools/
│ ├── search-utils.ts
│ └── types.ts
├── test/
├── package.json
├── tsconfig.json
├── tsconfig.build.json
└── vitest.config.tsThis server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SuLG-ik/kmp-api-lookup-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server