@typeship-ax/mcp 0.8.0 → 0.10.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 (103) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +66 -9
  3. package/api.json +3153 -761
  4. package/api.md +9796 -382
  5. package/dist/api-identity.d.ts +40 -0
  6. package/dist/api-identity.d.ts.map +1 -0
  7. package/dist/api-identity.js +128 -0
  8. package/dist/auth-profiles.d.ts +30 -0
  9. package/dist/auth-profiles.d.ts.map +1 -0
  10. package/dist/auth-profiles.js +138 -0
  11. package/dist/core/http.d.ts +17 -2
  12. package/dist/core/http.d.ts.map +1 -1
  13. package/dist/core/http.js +78 -17
  14. package/dist/credential-storage.d.ts +24 -0
  15. package/dist/credential-storage.d.ts.map +1 -0
  16. package/dist/credential-storage.js +207 -0
  17. package/dist/docs.d.ts +25 -0
  18. package/dist/docs.d.ts.map +1 -1
  19. package/dist/docs.js +144 -0
  20. package/dist/errors.d.ts +18 -10
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +24 -14
  23. package/dist/index.d.ts +10 -3
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +20 -4
  26. package/dist/mcp-authorization.d.ts +52 -0
  27. package/dist/mcp-authorization.d.ts.map +1 -0
  28. package/dist/mcp-authorization.js +232 -0
  29. package/dist/mcp-protocol.d.ts +51 -2
  30. package/dist/mcp-protocol.d.ts.map +1 -1
  31. package/dist/mcp-protocol.js +249 -37
  32. package/dist/mcp.d.ts +21 -3
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +185 -68
  35. package/dist/named-credentials.d.ts +21 -0
  36. package/dist/named-credentials.d.ts.map +1 -0
  37. package/dist/named-credentials.js +86 -0
  38. package/dist/oauth-request.d.ts +21 -0
  39. package/dist/oauth-request.d.ts.map +1 -0
  40. package/dist/oauth-request.js +119 -0
  41. package/dist/oauth-session.d.ts +106 -0
  42. package/dist/oauth-session.d.ts.map +1 -0
  43. package/dist/oauth-session.js +244 -0
  44. package/dist/ops.d.ts +14 -1
  45. package/dist/ops.d.ts.map +1 -1
  46. package/dist/ops.js +34 -30
  47. package/dist/resources/account.d.ts +2 -2
  48. package/dist/resources/account.d.ts.map +1 -1
  49. package/dist/resources/account.js +1 -0
  50. package/dist/resources/api-keys.d.ts +3 -3
  51. package/dist/resources/api-keys.d.ts.map +1 -1
  52. package/dist/resources/api-keys.js +2 -0
  53. package/dist/resources/definition-revisions.d.ts +5 -5
  54. package/dist/resources/definition-revisions.d.ts.map +1 -1
  55. package/dist/resources/definition-revisions.js +4 -0
  56. package/dist/resources/definitions.d.ts +15 -4
  57. package/dist/resources/definitions.d.ts.map +1 -1
  58. package/dist/resources/definitions.js +11 -2
  59. package/dist/resources/generate.d.ts +14 -3
  60. package/dist/resources/generate.d.ts.map +1 -1
  61. package/dist/resources/generate.js +10 -2
  62. package/dist/resources/generations.d.ts +3 -3
  63. package/dist/resources/generations.d.ts.map +1 -1
  64. package/dist/resources/generations.js +2 -0
  65. package/dist/resources/projects.d.ts +56 -20
  66. package/dist/resources/projects.d.ts.map +1 -1
  67. package/dist/resources/projects.js +40 -4
  68. package/dist/resources/targets.d.ts +84 -10
  69. package/dist/resources/targets.d.ts.map +1 -1
  70. package/dist/resources/targets.js +127 -2
  71. package/dist/schemas.d.ts.map +1 -1
  72. package/dist/schemas.js +55 -26
  73. package/dist/types.d.ts +602 -123
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js +24 -0
  76. package/dist/worker.js +4 -4
  77. package/package.json +11 -1
  78. package/server.json +42 -0
  79. package/src/api-identity.ts +98 -0
  80. package/src/auth-profiles.ts +114 -0
  81. package/src/core/http.ts +88 -19
  82. package/src/credential-storage.ts +183 -0
  83. package/src/docs.ts +138 -0
  84. package/src/errors.ts +26 -15
  85. package/src/index.ts +29 -4
  86. package/src/mcp-authorization.ts +211 -0
  87. package/src/mcp-protocol.ts +287 -38
  88. package/src/mcp.ts +186 -72
  89. package/src/named-credentials.ts +74 -0
  90. package/src/oauth-request.ts +90 -0
  91. package/src/oauth-session.ts +258 -0
  92. package/src/ops.ts +48 -31
  93. package/src/resources/account.ts +3 -0
  94. package/src/resources/api-keys.ts +5 -0
  95. package/src/resources/definition-revisions.ts +9 -0
  96. package/src/resources/definitions.ts +25 -0
  97. package/src/resources/generate.ts +23 -0
  98. package/src/resources/generations.ts +5 -0
  99. package/src/resources/projects.ts +95 -7
  100. package/src/resources/targets.ts +241 -0
  101. package/src/schemas.ts +55 -26
  102. package/src/types.ts +640 -123
  103. package/src/worker.ts +4 -4
package/AGENTS.md ADDED
@@ -0,0 +1,31 @@
1
+ # typeship — agent context
2
+
3
+ This package contains the generated MCP server for **typeship** (API v1.0.0, package v0.10.0).
4
+
5
+ Resolve an OpenAPI or GraphQL Definition, diagnose it, and keep every
6
+ selected SDK, CLI, and MCP Target current.
7
+
8
+ Every operation but one requires a bearer credential: an organization
9
+ API key from the console, or an OAuth access token carrying the operation's
10
+ read, generate, or write capability and the organization selected during
11
+ consent. OAuth grants cannot switch organizations after consent. A browser
12
+ session is not a credential for this API. The exception is POST /generate,
13
+ which works anonymously with the free plan's limits.
14
+
15
+ ## Ground rules
16
+ - Typeship owns the files it generates. Change the API definition, generation settings, or definition patches, then regenerate those files. Repository delivery preserves files outside its generated-file ownership manifest; preserving a file does not add it to the package's exports, build, or tests.
17
+ - Zero runtime dependencies; the program runs on Node.js 18+ and platform `fetch`.
18
+ - `api.md` is the tool and schema reference; `api.json` is the machine-readable operation, schema, safety, and example contract. Read them before guessing.
19
+ - Start with the local build or installation instructions in `README.md`. Generation does not publish a registry package.
20
+
21
+ ## Authentication
22
+ - Bearer token: set the `TYPESHIP_TOKEN` environment variable.
23
+
24
+ ## MCP server
25
+ - Build the package and configure your MCP client to run `node` with the absolute path to `dist/mcp.js`. After publishing, you can use `npx -y --package @typeship-ax/mcp typeship-mcp`. Set the package's auth environment variables in that client; `--read-only` prevents write tools.
26
+ - This package exposes the compact `search_docs`, `read_docs`, and `execute` surface. Find an operation, read its complete contract, then call `execute` with its name and `arguments`; destructive operations return `CONFIRMATION_REQUIRED` until repeated with `confirm: true`. Operation names are not directly callable tools in this mode.
27
+ - Tool arguments are checked against the schema before any request (unknown or mistyped arguments are one `isError` result with per-argument issues); pass `fields` (dotted paths) to keep only the result keys you need; errors carry `code` and `next_steps`.
28
+
29
+ ## Documentation
30
+ - The reference for this exact package: `api.md` (offline, always current with the code).
31
+ - Conceptual guides live on the docs site. For questions about how the API's concepts fit together (flows, ordering, environments), fetch `https://typeship.dev/llms-full.txt` and read the relevant sections; `https://typeship.dev/llms.txt` is the page index. Relative links in the spec resolve against `https://typeship.dev`.
package/README.md CHANGED
@@ -4,29 +4,73 @@ MCP server for typeship. [API reference](./api.md)
4
4
 
5
5
  Generated from the OpenAPI spec by [typeship](https://typeship.dev). Change the spec or generation settings, then regenerate; generated files are not hand-edited.
6
6
 
7
- - **Zero runtime dependencies** — built on the platform `fetch` (Node 18+, browsers, edge runtimes)
7
+ - **Zero runtime dependencies** — built on the platform `fetch` in Node 18+
8
8
  - **Agent-ready MCP** — schema-derived tools, argument validation, read-only mode, and bounded results
9
9
 
10
- ## Install
10
+ ## Build from source
11
+
12
+ Run these commands in the downloaded or cloned package directory:
11
13
 
12
14
  ```sh
13
- npm install @typeship-ax/mcp
15
+ npm install
16
+ npm run build
14
17
  ```
15
18
 
19
+ Requires Node.js 18+. The package is ESM.
20
+
21
+ To run the local MCP server, configure your MCP client with `node` and the absolute path to `dist/mcp.js`, as shown below. The server communicates over stdio.
22
+
23
+ ## Install a published package
24
+
25
+ Generation does not publish a package. Before using the registry command below, confirm `name` and `version` in `package.json`, publish under a name you control, and verify that release is available on npm.
26
+
27
+ ```sh
28
+ npm install --global @typeship-ax/mcp@0.10.0
29
+ ```
30
+
31
+ ## Connect after publishing
32
+
33
+ The npm connections below require `@typeship-ax/mcp` to be published under your package identity. To use downloaded source before publishing, use the local configuration in the next section. Hosted connections require a deployed server.
34
+
35
+ Authentication: provide `TYPESHIP_TOKEN` through the MCP client's environment or secret settings. Keep credential values out of URLs and command arguments.
36
+
37
+ > **Cursor:** Cursor 3.2 is not supported: it opens with the legacy initialize handshake, while this server speaks MCP 2026-07-28.
38
+
39
+ ### Local
40
+
41
+ - Claude Code: `claude mcp add typeship -- npx -y --package @typeship-ax/mcp typeship-mcp`
42
+ - Codex: `codex mcp add typeship -- npx -y --package @typeship-ax/mcp typeship-mcp`
43
+ - [Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22typeship%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22--package%22%2C%22%40typeship-ax%2Fmcp%22%2C%22typeship-mcp%22%5D%7D)
44
+
45
+ ### Local · read-only
46
+
47
+ - Claude Code: `claude mcp add typeship-readonly -- npx -y --package @typeship-ax/mcp typeship-mcp --read-only`
48
+ - Codex: `codex mcp add typeship-readonly -- npx -y --package @typeship-ax/mcp typeship-mcp --read-only`
49
+ - [Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22typeship-readonly%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22--package%22%2C%22%40typeship-ax%2Fmcp%22%2C%22typeship-mcp%22%2C%22--read-only%22%5D%7D)
50
+
51
+ ### Hosted
52
+
53
+ - Claude Code: `claude mcp add --transport http typeship https://typeship.dev/mcp`
54
+ - Codex: `codex mcp add typeship --url https://typeship.dev/mcp`
55
+ - [Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22typeship%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Ftypeship.dev%2Fmcp%22%7D)
56
+
57
+ ### Hosted · read-only
58
+
59
+ - Claude Code: `claude mcp add --transport http typeship-readonly https://typeship.dev/mcp/readonly`
60
+ - Codex: `codex mcp add typeship-readonly --url https://typeship.dev/mcp/readonly`
61
+ - [Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22typeship-readonly%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Ftypeship.dev%2Fmcp%2Freadonly%22%7D)
62
+
16
63
  ## MCP server
17
64
 
18
- A zero-dependency stdio server exposing a compact discovery surface: `search_docs`, `read_docs`, and `execute`. Read an operation before executing it to get its complete schema, example arguments, and safety classification. Add this package to an MCP client:
65
+ A zero-dependency stdio server exposing a compact discovery surface: `search_docs`, `read_docs`, and `execute`. Read an operation before executing it to get its complete schema, example arguments, and safety classification. After building, add the local server to an MCP client:
19
66
 
20
67
  ```json
21
68
  {
22
69
  "mcpServers": {
23
70
  "typeship": {
24
- "command": "npx",
71
+ "command": "node",
25
72
  "args": [
26
- "-y",
27
- "--package",
28
- "@typeship-ax/mcp",
29
- "typeship-mcp"
73
+ "/absolute/path/to/package/dist/mcp.js"
30
74
  ],
31
75
  "env": {
32
76
  "TYPESHIP_TOKEN": "replace-with-your-credential"
@@ -36,8 +80,21 @@ A zero-dependency stdio server exposing a compact discovery surface: `search_doc
36
80
  }
37
81
  ```
38
82
 
83
+ Replace the path with the absolute path to this package's built `dist/mcp.js`.
84
+
39
85
  Replace the credential placeholder using the MCP client's secret storage when it has one. The local server reads `TYPESHIP_TOKEN` from its environment; credentials never belong in command arguments. If you also generated the CLI, its `typeship login` command stores credentials the local MCP server can reuse.
40
86
 
41
87
  Tool input schemas are derived from the OpenAPI spec, so agents see real parameter types and required fields. Arguments are checked before anything reaches the API (unknown or mistyped ones come back as one `isError` result, nothing is dropped), every tool takes `fields` to keep only the result keys it needs, and errors carry a stable `code` and `next_steps`.
42
88
 
43
89
  Add `--read-only` to `args` (or set `TYPESHIP_MCP_READ_ONLY=1`) for a server that cannot write, `--tools generate,projects` (or `TYPESHIP_MCP_TOOLS`) to expose a subset, and `TYPESHIP_MCP_MAX_RESULT_CHARS` to change the result size cap (64,000).
90
+
91
+ ## MCP Registry
92
+
93
+ `server.json` describes the npm executable and any hosted transports. Its `dev.typeship/typeship` identity matches `package.json#mcpName`.
94
+
95
+ Install the official `mcp-publisher`, publish this npm package first, then validate or publish the listing:
96
+
97
+ ```bash
98
+ npm run mcp:validate
99
+ npm run mcp:publish
100
+ ```