mcpgraph 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.
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/dist/config/loader.d.ts +6 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +8 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/parser.d.ts +6 -0
- package/dist/config/parser.d.ts.map +1 -0
- package/dist/config/parser.js +24 -0
- package/dist/config/parser.js.map +1 -0
- package/dist/config/schema.d.ts +366 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +75 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/count-files.test.d.ts +5 -0
- package/dist/count-files.test.d.ts.map +1 -0
- package/dist/count-files.test.js +46 -0
- package/dist/count-files.test.js.map +1 -0
- package/dist/execution/context.d.ts +18 -0
- package/dist/execution/context.d.ts.map +1 -0
- package/dist/execution/context.js +33 -0
- package/dist/execution/context.js.map +1 -0
- package/dist/execution/executor.d.ts +13 -0
- package/dist/execution/executor.d.ts.map +1 -0
- package/dist/execution/executor.js +72 -0
- package/dist/execution/executor.js.map +1 -0
- package/dist/execution/nodes/entry-executor.d.ts +10 -0
- package/dist/execution/nodes/entry-executor.d.ts.map +1 -0
- package/dist/execution/nodes/entry-executor.js +17 -0
- package/dist/execution/nodes/entry-executor.js.map +1 -0
- package/dist/execution/nodes/exit-executor.d.ts +9 -0
- package/dist/execution/nodes/exit-executor.d.ts.map +1 -0
- package/dist/execution/nodes/exit-executor.js +16 -0
- package/dist/execution/nodes/exit-executor.js.map +1 -0
- package/dist/execution/nodes/mcp-tool-executor.d.ts +11 -0
- package/dist/execution/nodes/mcp-tool-executor.d.ts.map +1 -0
- package/dist/execution/nodes/mcp-tool-executor.js +74 -0
- package/dist/execution/nodes/mcp-tool-executor.js.map +1 -0
- package/dist/execution/nodes/switch-executor.d.ts +10 -0
- package/dist/execution/nodes/switch-executor.d.ts.map +1 -0
- package/dist/execution/nodes/switch-executor.js +32 -0
- package/dist/execution/nodes/switch-executor.js.map +1 -0
- package/dist/execution/nodes/transform-executor.d.ts +10 -0
- package/dist/execution/nodes/transform-executor.d.ts.map +1 -0
- package/dist/execution/nodes/transform-executor.js +20 -0
- package/dist/execution/nodes/transform-executor.js.map +1 -0
- package/dist/expressions/context.d.ts +9 -0
- package/dist/expressions/context.d.ts.map +1 -0
- package/dist/expressions/context.js +10 -0
- package/dist/expressions/context.js.map +1 -0
- package/dist/expressions/json-logic.d.ts +11 -0
- package/dist/expressions/json-logic.d.ts.map +1 -0
- package/dist/expressions/json-logic.js +27 -0
- package/dist/expressions/json-logic.js.map +1 -0
- package/dist/expressions/jsonata.d.ts +5 -0
- package/dist/expressions/jsonata.d.ts.map +1 -0
- package/dist/expressions/jsonata.js +27 -0
- package/dist/expressions/jsonata.js.map +1 -0
- package/dist/graph/graph.d.ts +14 -0
- package/dist/graph/graph.d.ts.map +1 -0
- package/dist/graph/graph.js +38 -0
- package/dist/graph/graph.js.map +1 -0
- package/dist/graph/validator.d.ts +11 -0
- package/dist/graph/validator.d.ts.map +1 -0
- package/dist/graph/validator.js +90 -0
- package/dist/graph/validator.js.map +1 -0
- package/dist/logger.d.ts +23 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +37 -0
- package/dist/logger.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +93 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp/client-manager.d.ts +11 -0
- package/dist/mcp/client-manager.d.ts.map +1 -0
- package/dist/mcp/client-manager.js +39 -0
- package/dist/mcp/client-manager.js.map +1 -0
- package/dist/types/config.d.ts +69 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +5 -0
- package/dist/types/config.js.map +1 -0
- package/examples/count_files.yaml +57 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 TeamSpark, LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# mcpGraph
|
|
2
|
+
|
|
3
|
+
MCP server that executes directed graphs of MCP server calls.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
mcpGraph is an MCP (Model Context Protocol) server that exposes tools defined by declarative YAML configurations. Each tool executes a directed graph of nodes that can call other MCP tools, transform data, and make routing decisions, all without embedding a full programming language.
|
|
8
|
+
|
|
9
|
+
**Key Features:**
|
|
10
|
+
- **Declarative Configuration**: Define tools and their execution graphs in YAML
|
|
11
|
+
- **Data Transformation**: Use [JSONata](https://jsonata.org/) expressions to transform data between nodes
|
|
12
|
+
- **Conditional Routing**: Use [JSON Logic](https://jsonlogic.com/) for conditional branching
|
|
13
|
+
- **Observable**: Every transformation and decision is traceable
|
|
14
|
+
- **No Embedded Code**: All logic expressed using standard expression languages ([JSONata](https://jsonata.org/), [JSON Logic](https://jsonlogic.com/))
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
Here's a simple example that counts files in a directory:
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
version: "1.0"
|
|
22
|
+
|
|
23
|
+
server:
|
|
24
|
+
name: "mcpGraph"
|
|
25
|
+
version: "1.0.0"
|
|
26
|
+
description: "MCP server that executes directed graphs of MCP tool calls"
|
|
27
|
+
|
|
28
|
+
tools:
|
|
29
|
+
- name: "count_files"
|
|
30
|
+
description: "Counts the number of files in a directory"
|
|
31
|
+
inputSchema:
|
|
32
|
+
type: "object"
|
|
33
|
+
properties:
|
|
34
|
+
directory:
|
|
35
|
+
type: "string"
|
|
36
|
+
description: "The directory path to count files in"
|
|
37
|
+
required:
|
|
38
|
+
- directory
|
|
39
|
+
outputSchema:
|
|
40
|
+
type: "object"
|
|
41
|
+
properties:
|
|
42
|
+
count:
|
|
43
|
+
type: "number"
|
|
44
|
+
description: "The number of files in the directory"
|
|
45
|
+
entryNode: "entry_count_files"
|
|
46
|
+
exitNode: "exit_count_files"
|
|
47
|
+
|
|
48
|
+
nodes:
|
|
49
|
+
- id: "entry_count_files"
|
|
50
|
+
type: "entry"
|
|
51
|
+
next: "list_directory_node"
|
|
52
|
+
|
|
53
|
+
- id: "list_directory_node"
|
|
54
|
+
type: "mcp_tool"
|
|
55
|
+
server: "filesystem"
|
|
56
|
+
tool: "list_directory"
|
|
57
|
+
args:
|
|
58
|
+
path: "$.input.directory"
|
|
59
|
+
next: "count_files_node"
|
|
60
|
+
|
|
61
|
+
- id: "count_files_node"
|
|
62
|
+
type: "transform"
|
|
63
|
+
transform:
|
|
64
|
+
expr: |
|
|
65
|
+
{ "count": $count($split(list_directory_node, "\n")) }
|
|
66
|
+
next: "exit_count_files"
|
|
67
|
+
|
|
68
|
+
- id: "exit_count_files"
|
|
69
|
+
type: "exit"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This graph:
|
|
73
|
+
1. Receives a directory path as input
|
|
74
|
+
2. Calls the filesystem MCP server's `list_directory` tool
|
|
75
|
+
3. Transforms the result to count files using JSONata
|
|
76
|
+
4. Returns the count
|
|
77
|
+
|
|
78
|
+
## Node Types
|
|
79
|
+
|
|
80
|
+
- **`entry`**: Entry point for a tool's graph execution. Receives tool arguments.
|
|
81
|
+
- **`mcp_tool`**: Calls an MCP tool on an internal or external MCP server.
|
|
82
|
+
- **`transform`**: Applies [JSONata](https://jsonata.org/) expressions to transform data between nodes.
|
|
83
|
+
- **`switch`**: Uses [JSON Logic](https://jsonlogic.com/) to conditionally route to different nodes.
|
|
84
|
+
- **`exit`**: Exit point that returns the final result to the MCP tool caller.
|
|
85
|
+
|
|
86
|
+
## For Developers
|
|
87
|
+
|
|
88
|
+
If you're interested in contributing to mcpGraph or working with the source code, see [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions, development guidelines, and project structure.
|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
Install mcpGraph from npm:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm install -g mcpgraph
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Or install locally in your project:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm install mcpgraph
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Configuration
|
|
105
|
+
|
|
106
|
+
### As an MCP Server
|
|
107
|
+
|
|
108
|
+
To use `mcpgraph` as an MCP server in an MCP client (such as Claude Desktop), add it to your MCP client's configuration file.
|
|
109
|
+
|
|
110
|
+
#### Claude Desktop Configuration
|
|
111
|
+
|
|
112
|
+
Add `mcpgraph` to your Claude Desktop MCP configuration (typically located at `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"mcpgraph": {
|
|
118
|
+
"command": "node",
|
|
119
|
+
"args": [
|
|
120
|
+
"/path/to/node_modules/mcpgraph/dist/main.js",
|
|
121
|
+
"-c",
|
|
122
|
+
"/path/to/your/config.yaml"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Or if installed globally, you can use the global installation path:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"mcpgraph": {
|
|
135
|
+
"command": "node",
|
|
136
|
+
"args": [
|
|
137
|
+
"/usr/local/lib/node_modules/mcpgraph/dist/main.js",
|
|
138
|
+
"-c",
|
|
139
|
+
"/path/to/your/config.yaml"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Note:** The exact path depends on your Node.js installation. You can find the global installation path by running `npm root -g` and appending `/mcpgraph/dist/main.js`.
|
|
147
|
+
|
|
148
|
+
#### Using tsx for Development
|
|
149
|
+
|
|
150
|
+
For development with TypeScript source files:
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"mcpServers": {
|
|
155
|
+
"mcpgraph": {
|
|
156
|
+
"command": "npx",
|
|
157
|
+
"args": [
|
|
158
|
+
"-y",
|
|
159
|
+
"tsx",
|
|
160
|
+
"/path/to/mcpGraph/src/main.ts",
|
|
161
|
+
"-c",
|
|
162
|
+
"/path/to/your/config.yaml"
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Note:** Replace `/path/to/your/config.yaml` with the actual path to your YAML configuration file. The `-c` flag specifies the configuration file to use.
|
|
170
|
+
|
|
171
|
+
## Usage
|
|
172
|
+
|
|
173
|
+
After installation, you can use mcpGraph as an MCP server by providing a YAML configuration file:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
mcpgraph -c path/to/config.yaml
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Or using the long form:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
mcpgraph --config path/to/config.yaml
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Documentation
|
|
186
|
+
|
|
187
|
+
- [Contributing Guide](CONTRIBUTING.md) - Setup, development, and contribution guidelines
|
|
188
|
+
- [Design Document](docs/design.md) - Complete design and architecture
|
|
189
|
+
- [Implementation](docs/implementation.md) - Implementation details and architecture
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/config/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAgBhE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML parser for mcpGraph configuration
|
|
3
|
+
*/
|
|
4
|
+
import { load } from "js-yaml";
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { mcpGraphConfigSchema } from "./schema.js";
|
|
7
|
+
import { logger } from "../logger.js";
|
|
8
|
+
export function parseYamlConfig(filePath) {
|
|
9
|
+
try {
|
|
10
|
+
const fileContents = readFileSync(filePath, "utf-8");
|
|
11
|
+
const parsed = load(fileContents);
|
|
12
|
+
// Validate against schema
|
|
13
|
+
const validated = mcpGraphConfigSchema.parse(parsed);
|
|
14
|
+
return validated;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (error instanceof Error) {
|
|
18
|
+
logger.error(`Failed to parse YAML config: ${error.message}`);
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
throw new Error("Unknown error parsing YAML config");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/config/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAY,CAAC;QAE7C,0BAA0B;QAC1B,MAAM,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAErD,OAAO,SAA2B,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,CAAC,KAAK,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9D,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for validating mcpGraph configuration
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export declare const mcpGraphConfigSchema: z.ZodObject<{
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
server: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
version: z.ZodString;
|
|
10
|
+
description: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
description: string;
|
|
13
|
+
name: string;
|
|
14
|
+
version: string;
|
|
15
|
+
}, {
|
|
16
|
+
description: string;
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
}>;
|
|
20
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
description: z.ZodString;
|
|
23
|
+
inputSchema: z.ZodObject<{
|
|
24
|
+
type: z.ZodString;
|
|
25
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
description: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
type: string;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
type: string;
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
}>>>;
|
|
35
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
36
|
+
description: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
type: string;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
properties?: Record<string, {
|
|
41
|
+
type: string;
|
|
42
|
+
description?: string | undefined;
|
|
43
|
+
}> | undefined;
|
|
44
|
+
required?: string[] | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
type: string;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
properties?: Record<string, {
|
|
49
|
+
type: string;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
}> | undefined;
|
|
52
|
+
required?: string[] | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
outputSchema: z.ZodObject<{
|
|
55
|
+
type: z.ZodString;
|
|
56
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
57
|
+
type: z.ZodString;
|
|
58
|
+
description: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
type: string;
|
|
61
|
+
description?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
type: string;
|
|
64
|
+
description?: string | undefined;
|
|
65
|
+
}>>>;
|
|
66
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
+
description: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
type: string;
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
properties?: Record<string, {
|
|
72
|
+
type: string;
|
|
73
|
+
description?: string | undefined;
|
|
74
|
+
}> | undefined;
|
|
75
|
+
required?: string[] | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
type: string;
|
|
78
|
+
description?: string | undefined;
|
|
79
|
+
properties?: Record<string, {
|
|
80
|
+
type: string;
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
}> | undefined;
|
|
83
|
+
required?: string[] | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
entryNode: z.ZodString;
|
|
86
|
+
exitNode: z.ZodString;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
description: string;
|
|
89
|
+
name: string;
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: string;
|
|
92
|
+
description?: string | undefined;
|
|
93
|
+
properties?: Record<string, {
|
|
94
|
+
type: string;
|
|
95
|
+
description?: string | undefined;
|
|
96
|
+
}> | undefined;
|
|
97
|
+
required?: string[] | undefined;
|
|
98
|
+
};
|
|
99
|
+
outputSchema: {
|
|
100
|
+
type: string;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
properties?: Record<string, {
|
|
103
|
+
type: string;
|
|
104
|
+
description?: string | undefined;
|
|
105
|
+
}> | undefined;
|
|
106
|
+
required?: string[] | undefined;
|
|
107
|
+
};
|
|
108
|
+
entryNode: string;
|
|
109
|
+
exitNode: string;
|
|
110
|
+
}, {
|
|
111
|
+
description: string;
|
|
112
|
+
name: string;
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: string;
|
|
115
|
+
description?: string | undefined;
|
|
116
|
+
properties?: Record<string, {
|
|
117
|
+
type: string;
|
|
118
|
+
description?: string | undefined;
|
|
119
|
+
}> | undefined;
|
|
120
|
+
required?: string[] | undefined;
|
|
121
|
+
};
|
|
122
|
+
outputSchema: {
|
|
123
|
+
type: string;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
properties?: Record<string, {
|
|
126
|
+
type: string;
|
|
127
|
+
description?: string | undefined;
|
|
128
|
+
}> | undefined;
|
|
129
|
+
required?: string[] | undefined;
|
|
130
|
+
};
|
|
131
|
+
entryNode: string;
|
|
132
|
+
exitNode: string;
|
|
133
|
+
}>, "many">;
|
|
134
|
+
nodes: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
135
|
+
id: z.ZodString;
|
|
136
|
+
} & {
|
|
137
|
+
type: z.ZodLiteral<"entry">;
|
|
138
|
+
next: z.ZodString;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
type: "entry";
|
|
141
|
+
id: string;
|
|
142
|
+
next: string;
|
|
143
|
+
}, {
|
|
144
|
+
type: "entry";
|
|
145
|
+
id: string;
|
|
146
|
+
next: string;
|
|
147
|
+
}>, z.ZodObject<{
|
|
148
|
+
id: z.ZodString;
|
|
149
|
+
next: z.ZodOptional<z.ZodString>;
|
|
150
|
+
} & {
|
|
151
|
+
type: z.ZodLiteral<"exit">;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
type: "exit";
|
|
154
|
+
id: string;
|
|
155
|
+
next?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
type: "exit";
|
|
158
|
+
id: string;
|
|
159
|
+
next?: string | undefined;
|
|
160
|
+
}>, z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
} & {
|
|
163
|
+
type: z.ZodLiteral<"mcp_tool">;
|
|
164
|
+
server: z.ZodString;
|
|
165
|
+
tool: z.ZodString;
|
|
166
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
167
|
+
next: z.ZodString;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
type: "mcp_tool";
|
|
170
|
+
id: string;
|
|
171
|
+
next: string;
|
|
172
|
+
server: string;
|
|
173
|
+
tool: string;
|
|
174
|
+
args: Record<string, unknown>;
|
|
175
|
+
}, {
|
|
176
|
+
type: "mcp_tool";
|
|
177
|
+
id: string;
|
|
178
|
+
next: string;
|
|
179
|
+
server: string;
|
|
180
|
+
tool: string;
|
|
181
|
+
args: Record<string, unknown>;
|
|
182
|
+
}>, z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
} & {
|
|
185
|
+
type: z.ZodLiteral<"transform">;
|
|
186
|
+
transform: z.ZodObject<{
|
|
187
|
+
expr: z.ZodString;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
expr: string;
|
|
190
|
+
}, {
|
|
191
|
+
expr: string;
|
|
192
|
+
}>;
|
|
193
|
+
next: z.ZodString;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
type: "transform";
|
|
196
|
+
id: string;
|
|
197
|
+
next: string;
|
|
198
|
+
transform: {
|
|
199
|
+
expr: string;
|
|
200
|
+
};
|
|
201
|
+
}, {
|
|
202
|
+
type: "transform";
|
|
203
|
+
id: string;
|
|
204
|
+
next: string;
|
|
205
|
+
transform: {
|
|
206
|
+
expr: string;
|
|
207
|
+
};
|
|
208
|
+
}>, z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
next: z.ZodOptional<z.ZodString>;
|
|
211
|
+
} & {
|
|
212
|
+
type: z.ZodLiteral<"switch">;
|
|
213
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
214
|
+
rule: z.ZodOptional<z.ZodUnknown>;
|
|
215
|
+
target: z.ZodString;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
target: string;
|
|
218
|
+
rule?: unknown;
|
|
219
|
+
}, {
|
|
220
|
+
target: string;
|
|
221
|
+
rule?: unknown;
|
|
222
|
+
}>, "many">;
|
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
|
224
|
+
type: "switch";
|
|
225
|
+
id: string;
|
|
226
|
+
conditions: {
|
|
227
|
+
target: string;
|
|
228
|
+
rule?: unknown;
|
|
229
|
+
}[];
|
|
230
|
+
next?: string | undefined;
|
|
231
|
+
}, {
|
|
232
|
+
type: "switch";
|
|
233
|
+
id: string;
|
|
234
|
+
conditions: {
|
|
235
|
+
target: string;
|
|
236
|
+
rule?: unknown;
|
|
237
|
+
}[];
|
|
238
|
+
next?: string | undefined;
|
|
239
|
+
}>]>, "many">;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
version: string;
|
|
242
|
+
server: {
|
|
243
|
+
description: string;
|
|
244
|
+
name: string;
|
|
245
|
+
version: string;
|
|
246
|
+
};
|
|
247
|
+
tools: {
|
|
248
|
+
description: string;
|
|
249
|
+
name: string;
|
|
250
|
+
inputSchema: {
|
|
251
|
+
type: string;
|
|
252
|
+
description?: string | undefined;
|
|
253
|
+
properties?: Record<string, {
|
|
254
|
+
type: string;
|
|
255
|
+
description?: string | undefined;
|
|
256
|
+
}> | undefined;
|
|
257
|
+
required?: string[] | undefined;
|
|
258
|
+
};
|
|
259
|
+
outputSchema: {
|
|
260
|
+
type: string;
|
|
261
|
+
description?: string | undefined;
|
|
262
|
+
properties?: Record<string, {
|
|
263
|
+
type: string;
|
|
264
|
+
description?: string | undefined;
|
|
265
|
+
}> | undefined;
|
|
266
|
+
required?: string[] | undefined;
|
|
267
|
+
};
|
|
268
|
+
entryNode: string;
|
|
269
|
+
exitNode: string;
|
|
270
|
+
}[];
|
|
271
|
+
nodes: ({
|
|
272
|
+
type: "entry";
|
|
273
|
+
id: string;
|
|
274
|
+
next: string;
|
|
275
|
+
} | {
|
|
276
|
+
type: "exit";
|
|
277
|
+
id: string;
|
|
278
|
+
next?: string | undefined;
|
|
279
|
+
} | {
|
|
280
|
+
type: "mcp_tool";
|
|
281
|
+
id: string;
|
|
282
|
+
next: string;
|
|
283
|
+
server: string;
|
|
284
|
+
tool: string;
|
|
285
|
+
args: Record<string, unknown>;
|
|
286
|
+
} | {
|
|
287
|
+
type: "transform";
|
|
288
|
+
id: string;
|
|
289
|
+
next: string;
|
|
290
|
+
transform: {
|
|
291
|
+
expr: string;
|
|
292
|
+
};
|
|
293
|
+
} | {
|
|
294
|
+
type: "switch";
|
|
295
|
+
id: string;
|
|
296
|
+
conditions: {
|
|
297
|
+
target: string;
|
|
298
|
+
rule?: unknown;
|
|
299
|
+
}[];
|
|
300
|
+
next?: string | undefined;
|
|
301
|
+
})[];
|
|
302
|
+
}, {
|
|
303
|
+
version: string;
|
|
304
|
+
server: {
|
|
305
|
+
description: string;
|
|
306
|
+
name: string;
|
|
307
|
+
version: string;
|
|
308
|
+
};
|
|
309
|
+
tools: {
|
|
310
|
+
description: string;
|
|
311
|
+
name: string;
|
|
312
|
+
inputSchema: {
|
|
313
|
+
type: string;
|
|
314
|
+
description?: string | undefined;
|
|
315
|
+
properties?: Record<string, {
|
|
316
|
+
type: string;
|
|
317
|
+
description?: string | undefined;
|
|
318
|
+
}> | undefined;
|
|
319
|
+
required?: string[] | undefined;
|
|
320
|
+
};
|
|
321
|
+
outputSchema: {
|
|
322
|
+
type: string;
|
|
323
|
+
description?: string | undefined;
|
|
324
|
+
properties?: Record<string, {
|
|
325
|
+
type: string;
|
|
326
|
+
description?: string | undefined;
|
|
327
|
+
}> | undefined;
|
|
328
|
+
required?: string[] | undefined;
|
|
329
|
+
};
|
|
330
|
+
entryNode: string;
|
|
331
|
+
exitNode: string;
|
|
332
|
+
}[];
|
|
333
|
+
nodes: ({
|
|
334
|
+
type: "entry";
|
|
335
|
+
id: string;
|
|
336
|
+
next: string;
|
|
337
|
+
} | {
|
|
338
|
+
type: "exit";
|
|
339
|
+
id: string;
|
|
340
|
+
next?: string | undefined;
|
|
341
|
+
} | {
|
|
342
|
+
type: "mcp_tool";
|
|
343
|
+
id: string;
|
|
344
|
+
next: string;
|
|
345
|
+
server: string;
|
|
346
|
+
tool: string;
|
|
347
|
+
args: Record<string, unknown>;
|
|
348
|
+
} | {
|
|
349
|
+
type: "transform";
|
|
350
|
+
id: string;
|
|
351
|
+
next: string;
|
|
352
|
+
transform: {
|
|
353
|
+
expr: string;
|
|
354
|
+
};
|
|
355
|
+
} | {
|
|
356
|
+
type: "switch";
|
|
357
|
+
id: string;
|
|
358
|
+
conditions: {
|
|
359
|
+
target: string;
|
|
360
|
+
rule?: unknown;
|
|
361
|
+
}[];
|
|
362
|
+
next?: string | undefined;
|
|
363
|
+
})[];
|
|
364
|
+
}>;
|
|
365
|
+
export type McpGraphConfigSchema = z.infer<typeof mcpGraphConfigSchema>;
|
|
366
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8ExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|