|
| 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