@ontrails/mcp 1.0.0-beta.16 → 1.0.0-beta.17
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.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/build.ts +15 -0
- package/src/stdio.ts +8 -0
- package/src/surface.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ontrails/mcp
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 61497c5: Add v1-minimum public API examples for shipped surface entrypoints.
|
|
8
|
+
- Updated dependencies [3dc8254]
|
|
9
|
+
- @ontrails/core@1.0.0-beta.17
|
|
10
|
+
|
|
3
11
|
## 1.0.0-beta.16
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ontrails/mcp",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.17",
|
|
4
4
|
"files": [
|
|
5
5
|
"src/**/*.ts",
|
|
6
6
|
"!src/**/__tests__/**",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ontrails/core": "^1.0.0-beta.
|
|
25
|
+
"@ontrails/core": "^1.0.0-beta.16"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
package/src/build.ts
CHANGED
|
@@ -950,6 +950,21 @@ const registerTools = (
|
|
|
950
950
|
return Result.ok(tools);
|
|
951
951
|
};
|
|
952
952
|
|
|
953
|
+
/**
|
|
954
|
+
* Build MCP tool definitions from a topo without opening a transport.
|
|
955
|
+
*
|
|
956
|
+
* @example
|
|
957
|
+
* ```ts
|
|
958
|
+
* import { deriveMcpTools } from '@ontrails/mcp';
|
|
959
|
+
*
|
|
960
|
+
* const tools = deriveMcpTools(graph, { include: ['entity.**'] });
|
|
961
|
+
* if (tools.isErr()) throw tools.error;
|
|
962
|
+
*
|
|
963
|
+
* for (const tool of tools.value) {
|
|
964
|
+
* console.log(tool.name);
|
|
965
|
+
* }
|
|
966
|
+
* ```
|
|
967
|
+
*/
|
|
953
968
|
export const deriveMcpTools = (
|
|
954
969
|
graph: Topo,
|
|
955
970
|
options: DeriveMcpToolsOptions = {}
|
package/src/stdio.ts
CHANGED
|
@@ -10,6 +10,14 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Connect an MCP server to stdio transport.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { connectStdio, createServer } from '@ontrails/mcp';
|
|
17
|
+
*
|
|
18
|
+
* const server = createServer(graph);
|
|
19
|
+
* await connectStdio(server);
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
export const connectStdio = async (server: Server): Promise<void> => {
|
|
15
23
|
const transport = new StdioServerTransport();
|
package/src/surface.ts
CHANGED
|
@@ -162,6 +162,14 @@ const createMcpServer = (
|
|
|
162
162
|
* @remarks This is a host materialization boundary. Derivation failures are
|
|
163
163
|
* thrown for server bootstrap code after `deriveMcpTools` has already
|
|
164
164
|
* represented the framework error as a Result.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* import { connectStdio, createServer } from '@ontrails/mcp';
|
|
169
|
+
*
|
|
170
|
+
* const server = createServer(graph, { name: 'demo' });
|
|
171
|
+
* await connectStdio(server);
|
|
172
|
+
* ```
|
|
165
173
|
*/
|
|
166
174
|
export const createServer = (
|
|
167
175
|
graph: Topo,
|
|
@@ -199,6 +207,13 @@ export const createServer = (
|
|
|
199
207
|
*
|
|
200
208
|
* @remarks Opens the MCP server on stdio. For custom transports, use
|
|
201
209
|
* `createServer(graph)` with `connectStdio` or your own adapter.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```ts
|
|
213
|
+
* import { surface } from '@ontrails/mcp';
|
|
214
|
+
*
|
|
215
|
+
* await surface(graph, { name: 'demo' });
|
|
216
|
+
* ```
|
|
202
217
|
*/
|
|
203
218
|
export const surface = async (
|
|
204
219
|
graph: Topo,
|