Skip to content

Commit 220aae8

Browse files
feat(plugin): add sdk-mcp-setup skill to ama-sdk plugin (#4354)
## Summary - Add a new `sdk-mcp-setup` skill that guides installing and configuring the `@ama-sdk/mcp` server so AI assistants (Claude Code, GitHub Copilot) can read `SDK_CONTEXT.md` from installed SDK packages - Wire the skill into the ama-sdk collection, plugin README, `sdk-setup` agent (new optional Phase 6), and the `create-sdk` next steps ## Test plan - [ ] Verify the collection YAML validates against the schema - [ ] Confirm the skill's `npx` invocations and `--packages` / `sdkContext.packages` config match the `@ama-sdk/mcp` CLI - [ ] Confirm `amasdk-update-sdk-context --interactive` is referenced correctly
2 parents 2558e41 + 058a457 commit 220aae8

5 files changed

Lines changed: 103 additions & 0 deletions

File tree

collections/ama-sdk.collection.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ items:
2525
tags:
2626
- plugins
2727
- extensibility
28+
- path: tools/llm/plugins/ama-sdk/skills/sdk-mcp-setup.md
29+
kind: skill
30+
title: SDK MCP Setup
31+
description: Configure the @ama-sdk/mcp server to expose SDK_CONTEXT.md to Claude Code and GitHub Copilot
32+
tags:
33+
- mcp
34+
- context
35+
- setup
2836
- path: tools/llm/plugins/ama-sdk/agents/sdk-setup.agent.md
2937
kind: agent
3038
title: SDK Setup

tools/llm/plugins/ama-sdk/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ AI-powered skills for creating, using, and extending TypeScript SDKs generated f
99
| **create-sdk** | Create a TypeScript SDK from an OpenAPI spec (standalone or monorepo) |
1010
| **use-sdk** | Install, configure clients (Fetch/Angular/Beacon), and call APIs |
1111
| **sdk-plugins** | Use built-in plugins and create custom ones for auth, retry, etc. |
12+
| **sdk-mcp-setup** | Configure the `@ama-sdk/mcp` server so AI assistants read `SDK_CONTEXT.md` |
1213

1314
## Agents
1415

@@ -53,6 +54,8 @@ The same [`.claude-plugin/`](../../../../.claude-plugin/marketplace.json) manife
5354

5455
**"I have a monorepo, add an SDK library"** → triggers `create-sdk` skill
5556

57+
**"Set up the ama-sdk MCP so Copilot/Claude knows my SDK"** → triggers `sdk-mcp-setup` skill
58+
5659
## Related Packages
5760

5861
- [`@ama-sdk/core`](https://www.npmjs.com/package/@ama-sdk/core) — SDK framework and plugin system

tools/llm/plugins/ama-sdk/agents/sdk-setup.agent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ Ask if they need:
6161
- Resilience (retry, timeout) → configure fetch plugins
6262
- Custom behavior → guide through custom plugin creation
6363

64+
### Phase 6: AI Context / MCP (Optional)
65+
66+
Ask if they want AI assistants (Claude Code, GitHub Copilot) to understand the SDK:
67+
- Generate `SDK_CONTEXT.md` with `amasdk-update-sdk-context` and configure the `@ama-sdk/mcp` server → delegate to `sdk-mcp-setup` skill
68+
6469
## Constraints
6570

6671
- **Never modify an OpenAPI specification.** If the spec has issues, suggest the user fix it upstream.

tools/llm/plugins/ama-sdk/skills/create-sdk.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,4 @@ For schematic options, see: https://github.com/AmadeusITGroup/otter/blob/main/pa
153153
- Install and configure a client (`@ama-sdk/client-fetch`, `@ama-sdk/client-angular`, or `@ama-sdk/client-beacon`) — see **use-sdk** skill
154154
- Add plugins for auth, retry, or caching — see **sdk-plugins** skill
155155
- Generate mocks for testing with `typescript-mock` schematic
156+
- Expose the SDK to AI assistants (generate `SDK_CONTEXT.md` and configure the MCP server) — see **sdk-mcp-setup** skill
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: sdk-mcp-setup
3+
description: Install and configure the @ama-sdk/mcp server so AI assistants can read SDK_CONTEXT.md from installed SDK packages. Use when the get_sdk_context tool is unavailable, or the user asks to "set up the ama-sdk mcp" or "configure sdk context server".
4+
---
5+
6+
# ama-sdk MCP Server Setup
7+
8+
Configure the [`@ama-sdk/mcp`](https://github.com/AmadeusITGroup/otter/tree/main/mcps/@ama-sdk/mcp) server so AI assistants can read the `SDK_CONTEXT.md` of installed SDK packages and use real operation IDs, models, and domains instead of hallucinating.
9+
10+
## Prerequisites
11+
12+
- One or more SDKs generated with `@ama-sdk/schematics`, each exposing an `SDK_CONTEXT.md`.
13+
- The server needs the **package names** of the SDKs to expose (e.g. `@my-scope/my-sdk`).
14+
15+
How you get the `SDK_CONTEXT.md` depends on where the SDK lives:
16+
17+
- **SDK source available (monorepo or local project)** — generate the context from the SDK project:
18+
19+
```bash
20+
npx amasdk-update-sdk-context --interactive
21+
```
22+
23+
- **SDK consumed from `node_modules`** — you can't regenerate it; the context must already ship inside the published package. Point `@ama-sdk/mcp` at the package name and it reads the bundled `SDK_CONTEXT.md`. If the package doesn't ship one, ask the SDK maintainer to generate and publish it.
24+
25+
## Configuration
26+
27+
The server runs via `npx` with no permanent install.
28+
29+
### Step 1: Declare the SDK packages in package.json
30+
31+
List the SDKs to expose under `sdkContext.packages` in the project's `package.json`. Prefer this over passing `--packages` on the command line — the list lives in one place, so the Claude Code and Copilot configs below stay identical with nothing to duplicate:
32+
33+
```json
34+
{
35+
"sdkContext": {
36+
"packages": ["@my-scope/my-sdk", "@other-scope/other-sdk"]
37+
}
38+
}
39+
```
40+
41+
### Step 2: Register the server
42+
43+
The server reads `sdkContext.packages` automatically, so both clients use the same args.
44+
45+
**Claude Code** — add to `.mcp.json` at the project root:
46+
47+
```json
48+
{
49+
"mcpServers": {
50+
"sdk-context": {
51+
"command": "npx",
52+
"args": ["-y", "-p", "@ama-sdk/mcp", "ama-sdk-mcp"]
53+
}
54+
}
55+
}
56+
```
57+
58+
**GitHub Copilot (VS Code)** — add to `.vscode/mcp.json`:
59+
60+
```json
61+
{
62+
"servers": {
63+
"sdk-context": {
64+
"type": "stdio",
65+
"command": "npx",
66+
"args": ["-y", "-p", "@ama-sdk/mcp", "ama-sdk-mcp"]
67+
}
68+
}
69+
}
70+
```
71+
72+
### Alternative: pass packages on the command line
73+
74+
If you can't edit `package.json`, list the SDKs after `--packages` instead (append to the `args` array): `["-y", "-p", "@ama-sdk/mcp", "ama-sdk-mcp", "--packages", "@my-scope/my-sdk", "@other-scope/other-sdk"]`. This has to be repeated in each client's config.
75+
76+
## Metrics (optional)
77+
78+
Ask the user whether to enable anonymous usage metrics. If they agree, add an `env` block to the server config:
79+
80+
```json
81+
"env": {
82+
"O3R_METRICS": true
83+
}
84+
```
85+
86+
Privacy policy: https://github.com/AmadeusITGroup/otter/blob/main/PRIVACY.md

0 commit comments

Comments
 (0)