@runapi.ai/mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +367 -0
  4. package/data/contract.json +3493 -0
  5. package/data/pricing.json +1263 -0
  6. package/dist/bin/runapi-mcp.d.ts +2 -0
  7. package/dist/bin/runapi-mcp.js +10 -0
  8. package/dist/bin/runapi-mcp.js.map +1 -0
  9. package/dist/scripts/sync-data.d.ts +2 -0
  10. package/dist/scripts/sync-data.js +22 -0
  11. package/dist/scripts/sync-data.js.map +1 -0
  12. package/dist/src/config.d.ts +7 -0
  13. package/dist/src/config.js +32 -0
  14. package/dist/src/config.js.map +1 -0
  15. package/dist/src/constants.d.ts +5 -0
  16. package/dist/src/constants.js +6 -0
  17. package/dist/src/constants.js.map +1 -0
  18. package/dist/src/index.d.ts +2 -0
  19. package/dist/src/index.js +6 -0
  20. package/dist/src/index.js.map +1 -0
  21. package/dist/src/init.d.ts +1 -0
  22. package/dist/src/init.js +52 -0
  23. package/dist/src/init.js.map +1 -0
  24. package/dist/src/lib/contract.d.ts +21 -0
  25. package/dist/src/lib/contract.js +81 -0
  26. package/dist/src/lib/contract.js.map +1 -0
  27. package/dist/src/lib/data.d.ts +3 -0
  28. package/dist/src/lib/data.js +22 -0
  29. package/dist/src/lib/data.js.map +1 -0
  30. package/dist/src/lib/errors.d.ts +10 -0
  31. package/dist/src/lib/errors.js +88 -0
  32. package/dist/src/lib/errors.js.map +1 -0
  33. package/dist/src/lib/input-rules.d.ts +9 -0
  34. package/dist/src/lib/input-rules.js +61 -0
  35. package/dist/src/lib/input-rules.js.map +1 -0
  36. package/dist/src/lib/pricing.d.ts +7 -0
  37. package/dist/src/lib/pricing.js +42 -0
  38. package/dist/src/lib/pricing.js.map +1 -0
  39. package/dist/src/lib/runapi-client.d.ts +22 -0
  40. package/dist/src/lib/runapi-client.js +119 -0
  41. package/dist/src/lib/runapi-client.js.map +1 -0
  42. package/dist/src/lib/schema.d.ts +3 -0
  43. package/dist/src/lib/schema.js +44 -0
  44. package/dist/src/lib/schema.js.map +1 -0
  45. package/dist/src/lib/text.d.ts +5 -0
  46. package/dist/src/lib/text.js +27 -0
  47. package/dist/src/lib/text.js.map +1 -0
  48. package/dist/src/lib/tool-response.d.ts +6 -0
  49. package/dist/src/lib/tool-response.js +11 -0
  50. package/dist/src/lib/tool-response.js.map +1 -0
  51. package/dist/src/server-instructions.d.ts +1 -0
  52. package/dist/src/server-instructions.js +66 -0
  53. package/dist/src/server-instructions.js.map +1 -0
  54. package/dist/src/server.d.ts +2 -0
  55. package/dist/src/server.js +20 -0
  56. package/dist/src/server.js.map +1 -0
  57. package/dist/src/tools/authenticated-handlers.d.ts +77 -0
  58. package/dist/src/tools/authenticated-handlers.js +144 -0
  59. package/dist/src/tools/authenticated-handlers.js.map +1 -0
  60. package/dist/src/tools/authenticated.d.ts +3 -0
  61. package/dist/src/tools/authenticated.js +53 -0
  62. package/dist/src/tools/authenticated.js.map +1 -0
  63. package/dist/src/tools/catalog-handlers.d.ts +88 -0
  64. package/dist/src/tools/catalog-handlers.js +104 -0
  65. package/dist/src/tools/catalog-handlers.js.map +1 -0
  66. package/dist/src/tools/catalog.d.ts +3 -0
  67. package/dist/src/tools/catalog.js +29 -0
  68. package/dist/src/tools/catalog.js.map +1 -0
  69. package/dist/src/types.d.ts +75 -0
  70. package/dist/src/types.js +2 -0
  71. package/dist/src/types.js.map +1 -0
  72. package/package.json +66 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - Initial RunAPI MCP server.
6
+ - Added free catalog tools: `list_models`, `get_model_info`, `list_actions`, `check_pricing`.
7
+ - Added authenticated tools: `create_task`, `get_task`, `check_balance`, `chat`.
8
+ - Added service route normalization for authenticated media task URLs.
9
+ - Added long-running media polling hardening for audio-like tasks.
10
+ - Added init command for Claude Code, Cursor, Windsurf, VS Code, and Roo.
11
+ - Added Claude Code plugin assets, manual eval scenarios, CI validation, Glama metadata, and distribution listing drafts.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,367 @@
1
+ <h1 align="center">RunAPI MCP Server</h1>
2
+
3
+ <p align="center">
4
+ <strong>One MCP server for RunAPI model discovery, pricing lookup, media tasks, account status, and LLM chat.</strong>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@runapi.ai/mcp"><img src="https://img.shields.io/npm/v/%40runapi.ai/mcp?style=flat-square&color=blue" alt="npm version"></a>
9
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue?style=flat-square" alt="Apache-2.0 license"></a>
10
+ <img src="https://img.shields.io/badge/Type-MCP_Server-blue?style=flat-square" alt="MCP Server">
11
+ </p>
12
+
13
+ <p align="center">
14
+ <a href="#quick-start">Quick Start</a> |
15
+ <a href="#tools">Tools</a> |
16
+ <a href="#examples">Examples</a> |
17
+ <a href="#catalog-coverage">Catalog</a> |
18
+ <a href="#platform-setup">Platforms</a>
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## What Is This?
24
+
25
+ RunAPI MCP Server connects MCP-compatible coding tools to RunAPI.
26
+ It lets an assistant browse the RunAPI catalog, inspect model inputs, check current pricing snapshots, create media tasks, poll task status, check account balance, and call RunAPI LLM endpoints.
27
+
28
+ The discovery tools work without an API key because they use the embedded build-time catalog.
29
+ Authenticated operations require `RUNAPI_API_KEY`.
30
+
31
+ This package is a pure client.
32
+ It does not run a local generation backend and does not require changes to your RunAPI account beyond creating an API key for authenticated tools.
33
+
34
+ ---
35
+
36
+ ## Quick Start
37
+
38
+ Install through your MCP host config:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "runapi": {
44
+ "command": "npx",
45
+ "args": ["-y", "@runapi.ai/mcp"],
46
+ "env": {
47
+ "RUNAPI_API_KEY": "${RUNAPI_API_KEY}"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ Or generate a config file:
55
+
56
+ ```bash
57
+ npx @runapi.ai/mcp init claude
58
+ ```
59
+
60
+ Supported init targets:
61
+
62
+ ```bash
63
+ npx @runapi.ai/mcp init claude
64
+ npx @runapi.ai/mcp init cursor
65
+ npx @runapi.ai/mcp init vscode
66
+ npx @runapi.ai/mcp init windsurf
67
+ npx @runapi.ai/mcp init roo
68
+ ```
69
+
70
+ Free catalog tools work even when `RUNAPI_API_KEY` is not configured.
71
+ For task creation, balance checks, and LLM chat, create an API key in the RunAPI dashboard and expose it as `RUNAPI_API_KEY`.
72
+
73
+ ---
74
+
75
+ ## Tools
76
+
77
+ | Tool | Auth | Purpose |
78
+ |---|---|---|
79
+ | `list_models` | No | List RunAPI models from the embedded catalog. Supports `modality`, `service`, and `action` filters. |
80
+ | `get_model_info` | No | Return service, action, modality, input constraints, and pricing snapshot for a model slug. Use `service` + `action` when a model appears in multiple endpoints. |
81
+ | `list_actions` | No | Group endpoint action names by modality. |
82
+ | `check_pricing` | No | Return pricing snapshot data for a `service` + `action` + `model` combination. |
83
+ | `create_task` | Yes | Create a media task and optionally poll until completion. |
84
+ | `get_task` | Yes | Fetch status and latest payload for an existing media task. |
85
+ | `check_balance` | Yes | Return account balance and spending metrics. |
86
+ | `chat` | Yes | Send messages to a RunAPI LLM endpoint and return the response with usage metadata when available. |
87
+
88
+ The catalog and pricing tools are designed for funnel-top discovery inside coding tools.
89
+ The task, balance, and chat tools are designed for authenticated workflows.
90
+
91
+ ---
92
+
93
+ ## Examples
94
+
95
+ Ask your assistant natural-language questions.
96
+ The assistant should use the tools to discover current model slugs and pricing instead of relying on memorized names.
97
+
98
+ ### Browse The Catalog
99
+
100
+ ```text
101
+ What RunAPI image models are available?
102
+ ```
103
+
104
+ Expected behavior:
105
+
106
+ 1. The assistant calls `list_models` with `modality: "image"`.
107
+ 2. It summarizes the returned model slugs, services, actions, and required fields.
108
+ 3. It avoids quoting stale prices unless it calls `check_pricing`.
109
+
110
+ ### Inspect A Model
111
+
112
+ ```text
113
+ Show me the required parameters for this model slug: <model-slug>
114
+ ```
115
+
116
+ Expected behavior:
117
+
118
+ 1. The assistant calls `get_model_info`.
119
+ 2. If the response is ambiguous, it chooses the relevant service/action from the returned matches and calls `get_model_info` again with `service` and `action`.
120
+ 3. It shows required fields, enum constraints, range constraints, conditional input rules, supported action, and pricing snapshot if present.
121
+ 4. It tells you to choose another slug with `list_models` if the slug is not found.
122
+
123
+ ### Create A Media Task
124
+
125
+ ```text
126
+ Generate a square product image with RunAPI. Pick a suitable image model.
127
+ ```
128
+
129
+ Expected behavior:
130
+
131
+ 1. The assistant calls `list_models` to choose a compatible image model.
132
+ 2. It calls `get_model_info` with the selected service/action/model to validate parameters and any conditional input rules.
133
+ 3. It asks for confirmation if the request is expensive, long-running, or a batch.
134
+ 4. It calls `create_task`.
135
+ 5. It returns task ID, status, output URLs, and cost fields when available.
136
+
137
+ ### Submit Without Waiting
138
+
139
+ ```text
140
+ Create the task but do not wait for completion.
141
+ ```
142
+
143
+ Expected behavior:
144
+
145
+ 1. The assistant calls `create_task` with `wait: false`.
146
+ 2. It returns the task ID.
147
+ 3. You can later ask for status with `get_task`.
148
+
149
+ ### Check Account Balance
150
+
151
+ ```text
152
+ Check my RunAPI balance.
153
+ ```
154
+
155
+ Expected behavior:
156
+
157
+ 1. The assistant calls `check_balance`.
158
+ 2. If no key is configured, it explains how to set `RUNAPI_API_KEY`.
159
+
160
+ ### LLM Chat
161
+
162
+ ```text
163
+ Use a RunAPI LLM model to summarize this file.
164
+ ```
165
+
166
+ Expected behavior:
167
+
168
+ 1. The assistant uses catalog tools to identify a current LLM model slug when needed.
169
+ 2. It calls `chat` rather than `create_task`.
170
+ 3. It returns the model response and usage metadata when available.
171
+
172
+ ---
173
+
174
+ ## Catalog Coverage
175
+
176
+ The embedded catalog is generated from RunAPI's contract snapshot.
177
+ It includes media models, utility endpoints, and LLM model slugs.
178
+
179
+ | Modality | What To Use |
180
+ |---|---|
181
+ | Image | `list_models` with `modality: "image"` |
182
+ | Video | `list_models` with `modality: "video"` |
183
+ | Audio and music | `list_models` with `modality: "audio"` |
184
+ | LLM | `list_models` with `modality: "llm"` |
185
+ | Utility | `list_models` with `modality: "utility"` |
186
+
187
+ Catalog contents can change between releases.
188
+ Use `list_models` for current service/action/model slugs and `get_model_info` for each model's current constraints.
189
+
190
+ ---
191
+
192
+ ## Pricing
193
+
194
+ RunAPI pricing is exposed through the `check_pricing` tool and the public pricing page.
195
+ Do not rely on examples in README files for exact prices.
196
+
197
+ Useful flows:
198
+
199
+ 1. Call `list_models` to find a candidate model.
200
+ 2. Call `check_pricing` with `service`, `action`, and `model`.
201
+ 3. Show the returned pricing snapshot or link to [runapi.ai/pricing](https://runapi.ai/pricing).
202
+
203
+ Free catalog tools do not create tasks and do not consume account balance.
204
+
205
+ ---
206
+
207
+ ## Platform Setup
208
+
209
+ ### Claude Code
210
+
211
+ Run:
212
+
213
+ ```bash
214
+ npx @runapi.ai/mcp init claude
215
+ ```
216
+
217
+ This writes `.mcp.json` in the current directory.
218
+ Restart Claude Code after editing MCP configuration.
219
+
220
+ ### Cursor
221
+
222
+ Run:
223
+
224
+ ```bash
225
+ npx @runapi.ai/mcp init cursor
226
+ ```
227
+
228
+ This writes `.cursor/mcp.json`.
229
+ Open Cursor settings to verify the MCP server is enabled.
230
+
231
+ ### VS Code
232
+
233
+ Run:
234
+
235
+ ```bash
236
+ npx @runapi.ai/mcp init vscode
237
+ ```
238
+
239
+ This writes `.vscode/mcp.json`.
240
+ VS Code uses a top-level `servers` key and `type: "stdio"` in generated config.
241
+
242
+ ### Windsurf
243
+
244
+ Run:
245
+
246
+ ```bash
247
+ npx @runapi.ai/mcp init windsurf
248
+ ```
249
+
250
+ This writes the generated config for the Windsurf target used by the init command.
251
+
252
+ ### Roo Code
253
+
254
+ Run:
255
+
256
+ ```bash
257
+ npx @runapi.ai/mcp init roo
258
+ ```
259
+
260
+ This writes `.roo/mcp.json`.
261
+
262
+ ### Manual Configuration
263
+
264
+ Use the example files in `examples/` as starting points.
265
+ Each platform has slightly different wrapper keys and file paths, but all run the same command:
266
+
267
+ ```bash
268
+ npx -y @runapi.ai/mcp
269
+ ```
270
+
271
+ ---
272
+
273
+ ## Configuration
274
+
275
+ The server reads configuration in this order:
276
+
277
+ 1. `RUNAPI_API_KEY` environment variable
278
+ 2. `~/.config/runapi/config.json`
279
+ 3. No key, which still allows free catalog tools
280
+
281
+ Example config file:
282
+
283
+ ```json
284
+ {
285
+ "apiKey": "your_runapi_key"
286
+ }
287
+ ```
288
+
289
+ You can also set a custom base URL for local testing:
290
+
291
+ ```json
292
+ {
293
+ "apiKey": "your_runapi_key",
294
+ "baseUrl": "https://runapi.ai"
295
+ }
296
+ ```
297
+
298
+ Do not commit real API keys.
299
+
300
+ ---
301
+
302
+ ## Data Sync
303
+
304
+ This package ships build-time data files:
305
+
306
+ - `data/contract.json`: catalog, actions, model slugs, and input constraints
307
+ - `data/pricing.json`: pricing snapshot used by `check_pricing`
308
+
309
+ Refresh data from the RunAPI source tree before a release:
310
+
311
+ ```bash
312
+ npm run sync:data
313
+ ```
314
+
315
+ Build-time data means a pricing or catalog update requires a new package release.
316
+
317
+ ---
318
+
319
+ ## Development
320
+
321
+ ```bash
322
+ npm install
323
+ npm run typecheck
324
+ npm test
325
+ npm pack --dry-run
326
+ ```
327
+
328
+ Run the server locally:
329
+
330
+ ```bash
331
+ npm run dev
332
+ ```
333
+
334
+ Manual initialize smoke test:
335
+
336
+ ```bash
337
+ printf '%s\n' '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}},"id":1}' | npx tsx src/index.ts
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Package Contents
343
+
344
+ The npm package includes:
345
+
346
+ - compiled `dist/` files
347
+ - embedded `data/` files
348
+ - platform examples
349
+ - Claude Code plugin files, when generated by this repo
350
+ - eval scenarios, when generated by this repo
351
+ - README, changelog, license, and package metadata
352
+
353
+ It does not include `node_modules`, `.env`, local config files, or API keys.
354
+
355
+ ---
356
+
357
+ ## Also Available Via CLI
358
+
359
+ RunAPI also has a separate command-line client for terminal workflows.
360
+ Use this MCP server when you want RunAPI available inside an MCP host.
361
+ Use the CLI when you want direct shell commands, scripts, or CI integration.
362
+
363
+ ---
364
+
365
+ ## License
366
+
367
+ [Apache-2.0](LICENSE)