@agiflowai/one-mcp 0.2.3 → 0.2.5
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/README.md +139 -280
- package/dist/cli.cjs +118 -30
- package/dist/cli.mjs +118 -30
- package/dist/{http-CzQfsUEI.mjs → http-BKDyW8YB.mjs} +596 -59
- package/dist/{http-3v8zyDO3.cjs → http-Q8LPwwwP.cjs} +609 -62
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +160 -18
- package/dist/index.d.mts +160 -18
- package/dist/index.mjs +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,95 +1,59 @@
|
|
|
1
1
|
# @agiflowai/one-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> MCP proxy server for progressive tool discovery and reduced token usage
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Connect to multiple MCP servers through a single proxy that loads tools on-demand, reducing initial token usage by 90%+.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
When connecting to multiple MCP servers directly, AI agents load ALL tools from ALL servers at startup:
|
|
8
10
|
|
|
9
|
-
**Example: 10 MCP Servers**
|
|
10
11
|
```
|
|
11
|
-
|
|
12
|
-
Server
|
|
13
|
-
Server
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
10 MCP Servers:
|
|
13
|
+
Server 1: 20 tools × 200 tokens = 4,000 tokens
|
|
14
|
+
Server 2: 15 tools × 200 tokens = 3,000 tokens
|
|
15
|
+
Server 3: 30 tools × 200 tokens = 6,000 tokens
|
|
16
|
+
...
|
|
17
|
+
Total: ~40,000+ tokens consumed BEFORE you even start coding
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
This
|
|
19
|
-
|
|
20
|
-
## The Solution: Progressive Discovery
|
|
21
|
-
|
|
22
|
-
one-mcp acts as a **smart proxy** that only loads tool descriptions when needed:
|
|
23
|
-
|
|
24
|
-
1. **Initial Connection**: Agent sees only 2 meta-tools (`describe_tools` and `use_tool`)
|
|
25
|
-
- Token cost: ~400 tokens (vs 40,000+ tokens)
|
|
20
|
+
This wastes context window on tool descriptions you may never use.
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
- Example: `describe_tools(["filesystem"])` loads only filesystem server tools
|
|
29
|
-
- Token cost: ~4,000 tokens (only what you need, when you need it)
|
|
30
|
-
|
|
31
|
-
3. **Tool Execution**: Agent calls `use_tool` to execute tools through the proxy
|
|
32
|
-
- one-mcp routes the call to the correct server
|
|
33
|
-
- No token overhead - just execution
|
|
34
|
-
|
|
35
|
-
**Result: 90%+ reduction in initial token usage**
|
|
22
|
+
## The Solution
|
|
36
23
|
|
|
37
|
-
|
|
24
|
+
one-mcp acts as a smart proxy with progressive discovery:
|
|
38
25
|
|
|
39
26
|
```
|
|
40
|
-
Traditional
|
|
41
|
-
┌─────────────────┐
|
|
42
|
-
│ AI Agent │ ←
|
|
43
|
-
├─────────────────┤
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
│ ... │
|
|
48
|
-
└─────────────────┘
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
┌─────────────────┐
|
|
52
|
-
│ AI Agent │ ← Loads only 2 meta-tools (400 tokens)
|
|
53
|
-
├─────────────────┤
|
|
54
|
-
│ one-mcp │ ← Proxies to servers on-demand
|
|
55
|
-
│ (2 tools) │
|
|
56
|
-
└────────┬────────┘
|
|
57
|
-
│ Connects to servers as needed
|
|
58
|
-
┌────┴─────┬──────────┬─────────┐
|
|
59
|
-
│ Server 1 │ Server 2 │ Server 3│
|
|
60
|
-
└──────────┴──────────┴─────────┘
|
|
27
|
+
Traditional (High Token Cost): Progressive Discovery (Low Token Cost):
|
|
28
|
+
┌─────────────────┐ ┌─────────────────┐
|
|
29
|
+
│ AI Agent │ ← 40,000+ tokens │ AI Agent │ ← 400 tokens
|
|
30
|
+
├─────────────────┤ ├─────────────────┤
|
|
31
|
+
│ Server 1 (20) │ │ one-mcp │ ← 2 meta-tools
|
|
32
|
+
│ Server 2 (15) │ │ (proxy) │
|
|
33
|
+
│ Server 3 (30) │ └────────┬────────┘
|
|
34
|
+
│ ... │ │ loads on-demand
|
|
35
|
+
└─────────────────┘ ┌────┴────┬────────┐
|
|
36
|
+
│ Srv 1 │ Srv 2 │ ...
|
|
37
|
+
└─────────┴────────┘
|
|
61
38
|
```
|
|
62
39
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- **Faster Startup** - Agent ready in milliseconds, not seconds
|
|
67
|
-
- **Scale Infinitely** - Add 100+ MCP servers without bloating context
|
|
68
|
-
- **Pay-as-you-go** - Only load tools when actually needed
|
|
69
|
-
- **Better Context Budget** - Save tokens for actual code and conversation
|
|
70
|
-
- **Centralized Config** - Manage all servers from one YAML/JSON file
|
|
40
|
+
1. **Initial**: Agent sees only 2 meta-tools (`describe_tools`, `use_tool`) - ~400 tokens
|
|
41
|
+
2. **Discovery**: Agent calls `describe_tools` for specific servers when needed
|
|
42
|
+
3. **Execution**: Agent calls `use_tool` to run tools through the proxy
|
|
71
43
|
|
|
72
|
-
|
|
44
|
+
**Result: 90%+ reduction in initial token usage**
|
|
73
45
|
|
|
74
|
-
|
|
75
|
-
npm install -g @agiflowai/one-mcp
|
|
76
|
-
# or
|
|
77
|
-
pnpm add -g @agiflowai/one-mcp
|
|
78
|
-
# or
|
|
79
|
-
yarn global add @agiflowai/one-mcp
|
|
80
|
-
```
|
|
46
|
+
---
|
|
81
47
|
|
|
82
48
|
## Quick Start
|
|
83
49
|
|
|
84
|
-
### 1.
|
|
85
|
-
|
|
86
|
-
Create an MCP configuration file:
|
|
50
|
+
### 1. Create Configuration
|
|
87
51
|
|
|
88
52
|
```bash
|
|
89
53
|
npx @agiflowai/one-mcp init
|
|
90
54
|
```
|
|
91
55
|
|
|
92
|
-
This creates
|
|
56
|
+
This creates `mcp-config.yaml`:
|
|
93
57
|
|
|
94
58
|
```yaml
|
|
95
59
|
mcpServers:
|
|
@@ -102,20 +66,19 @@ mcpServers:
|
|
|
102
66
|
config:
|
|
103
67
|
instruction: "Access files in the Documents folder"
|
|
104
68
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
69
|
+
scaffold-mcp:
|
|
70
|
+
command: npx
|
|
71
|
+
args:
|
|
72
|
+
- -y
|
|
73
|
+
- "@agiflowai/scaffold-mcp"
|
|
74
|
+
- "mcp-serve"
|
|
110
75
|
config:
|
|
111
|
-
instruction: "
|
|
76
|
+
instruction: "Scaffold projects and features"
|
|
112
77
|
```
|
|
113
78
|
|
|
114
79
|
### 2. Configure Your Agent
|
|
115
80
|
|
|
116
|
-
Add
|
|
117
|
-
|
|
118
|
-
**For Claude Code:**
|
|
81
|
+
Add to your MCP config (`.mcp.json`, `.cursor/mcp.json`, etc.):
|
|
119
82
|
|
|
120
83
|
```json
|
|
121
84
|
{
|
|
@@ -128,33 +91,20 @@ Add one-mcp to your AI coding tool's MCP configuration:
|
|
|
128
91
|
}
|
|
129
92
|
```
|
|
130
93
|
|
|
131
|
-
|
|
94
|
+
### 3. Start Using
|
|
132
95
|
|
|
133
|
-
|
|
134
|
-
{
|
|
135
|
-
"mcpServers": {
|
|
136
|
-
"one-mcp": {
|
|
137
|
-
"command": "npx",
|
|
138
|
-
"args": ["-y", "@agiflowai/one-mcp", "mcp-serve", "--config", "./mcp-config.yaml"]
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### 3. Start Using Tools
|
|
96
|
+
Your agent now has access to all tools from all configured servers through one connection.
|
|
145
97
|
|
|
146
|
-
|
|
98
|
+
---
|
|
147
99
|
|
|
148
100
|
## Configuration
|
|
149
101
|
|
|
150
|
-
###
|
|
151
|
-
|
|
152
|
-
one-mcp supports the standard Claude Code MCP configuration format:
|
|
102
|
+
### Server Types
|
|
153
103
|
|
|
154
104
|
```yaml
|
|
155
105
|
mcpServers:
|
|
156
106
|
# Stdio server (local command)
|
|
157
|
-
server
|
|
107
|
+
local-server:
|
|
158
108
|
command: npx
|
|
159
109
|
args:
|
|
160
110
|
- -y
|
|
@@ -162,11 +112,7 @@ mcpServers:
|
|
|
162
112
|
env:
|
|
163
113
|
API_KEY: "${MY_API_KEY}"
|
|
164
114
|
config:
|
|
165
|
-
instruction: "
|
|
166
|
-
# Optional: Block specific tools from being listed or executed
|
|
167
|
-
toolBlacklist:
|
|
168
|
-
- dangerous_tool
|
|
169
|
-
- another_blocked_tool
|
|
115
|
+
instruction: "Description for the AI agent"
|
|
170
116
|
|
|
171
117
|
# HTTP/SSE server (remote)
|
|
172
118
|
remote-server:
|
|
@@ -175,20 +121,18 @@ mcpServers:
|
|
|
175
121
|
headers:
|
|
176
122
|
Authorization: "Bearer ${TOKEN}"
|
|
177
123
|
config:
|
|
178
|
-
instruction: "Remote server
|
|
179
|
-
toolBlacklist:
|
|
180
|
-
- risky_operation
|
|
124
|
+
instruction: "Remote server description"
|
|
181
125
|
|
|
182
|
-
# Disabled server (
|
|
126
|
+
# Disabled server (skipped)
|
|
183
127
|
disabled-server:
|
|
184
128
|
command: node
|
|
185
129
|
args: ["server.js"]
|
|
186
130
|
disabled: true
|
|
187
131
|
```
|
|
188
132
|
|
|
189
|
-
### Environment
|
|
133
|
+
### Environment Variables
|
|
190
134
|
|
|
191
|
-
Use `${VAR_NAME}` syntax
|
|
135
|
+
Use `${VAR_NAME}` syntax:
|
|
192
136
|
|
|
193
137
|
```yaml
|
|
194
138
|
mcpServers:
|
|
@@ -196,197 +140,142 @@ mcpServers:
|
|
|
196
140
|
command: npx
|
|
197
141
|
args:
|
|
198
142
|
- "@mycompany/mcp-server"
|
|
199
|
-
- "${HOME}/data"
|
|
143
|
+
- "${HOME}/data" # Expands to /Users/username/data
|
|
200
144
|
env:
|
|
201
|
-
API_KEY: "${MY_API_KEY}"
|
|
145
|
+
API_KEY: "${MY_API_KEY}" # Reads from environment
|
|
202
146
|
```
|
|
203
147
|
|
|
204
148
|
### Tool Blacklisting
|
|
205
149
|
|
|
206
|
-
|
|
207
|
-
- Not appear in `list-tools` output
|
|
208
|
-
- Not be shown in `describe_tools` responses
|
|
209
|
-
- Raise an error if attempted to be executed via `use_tool`
|
|
210
|
-
|
|
211
|
-
This is useful for:
|
|
212
|
-
- **Security**: Block dangerous operations (e.g., `write_file`, `delete_file`)
|
|
213
|
-
- **Compliance**: Restrict tools that don't meet your policies
|
|
214
|
-
- **Simplification**: Hide tools you don't want agents to use
|
|
215
|
-
|
|
216
|
-
**Example:**
|
|
150
|
+
Block specific tools from being listed or executed:
|
|
217
151
|
|
|
218
152
|
```yaml
|
|
219
153
|
mcpServers:
|
|
220
154
|
filesystem:
|
|
221
155
|
command: npx
|
|
222
|
-
args:
|
|
223
|
-
- -y
|
|
224
|
-
- "@modelcontextprotocol/server-filesystem"
|
|
225
|
-
- "/workspace"
|
|
156
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
|
|
226
157
|
config:
|
|
227
158
|
instruction: "File system access (read-only)"
|
|
228
159
|
toolBlacklist:
|
|
229
160
|
- write_file
|
|
230
161
|
- create_directory
|
|
231
|
-
-
|
|
162
|
+
- delete_file
|
|
232
163
|
```
|
|
233
164
|
|
|
234
|
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
165
|
+
Blacklisted tools:
|
|
166
|
+
- Won't appear in tool listings
|
|
167
|
+
- Return an error if called
|
|
237
168
|
|
|
238
|
-
### Tool
|
|
169
|
+
### Compact Tool Descriptions
|
|
239
170
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
**Default behavior (omitToolDescription: false or not set):**
|
|
243
|
-
```
|
|
244
|
-
server-name:
|
|
245
|
-
- tool_name1: Full description of what this tool does...
|
|
246
|
-
- tool_name2: Another detailed description...
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
**Compact mode (omitToolDescription: true):**
|
|
250
|
-
```
|
|
251
|
-
server-name:
|
|
252
|
-
tool_name1, tool_name2, tool_name3
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**Example:**
|
|
171
|
+
Reduce token usage by omitting verbose descriptions:
|
|
256
172
|
|
|
257
173
|
```yaml
|
|
258
174
|
mcpServers:
|
|
259
175
|
filesystem:
|
|
260
176
|
command: npx
|
|
261
|
-
args:
|
|
262
|
-
- -y
|
|
263
|
-
- "@modelcontextprotocol/server-filesystem"
|
|
264
|
-
- "/workspace"
|
|
177
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
|
|
265
178
|
config:
|
|
266
|
-
|
|
267
|
-
omitToolDescription: true # Show only tool names, not descriptions
|
|
179
|
+
omitToolDescription: true # Show only tool names
|
|
268
180
|
```
|
|
269
181
|
|
|
270
|
-
**
|
|
271
|
-
- **Reduced Token Usage**: Save context window space by omitting verbose descriptions
|
|
272
|
-
- **Faster Discovery**: Quickly scan available tool names without reading full descriptions
|
|
273
|
-
- **Cleaner Output**: More compact tool listings for familiar servers
|
|
274
|
-
|
|
275
|
-
**When to use:**
|
|
276
|
-
- You're already familiar with the server's tools
|
|
277
|
-
- Working with servers that have many tools with long descriptions
|
|
278
|
-
- Trying to conserve context window tokens
|
|
279
|
-
- Need a quick overview of available tool names
|
|
280
|
-
|
|
281
|
-
## CLI Commands
|
|
282
|
-
|
|
283
|
-
### `mcp-serve`
|
|
284
|
-
|
|
285
|
-
Start the MCP server:
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
npx @agiflowai/one-mcp mcp-serve [options]
|
|
289
|
-
|
|
290
|
-
Options:
|
|
291
|
-
-c, --config <path> Path to local config file (YAML or JSON)
|
|
292
|
-
--no-cache Force reload configuration from source, bypassing cache
|
|
293
|
-
-t, --type <type> Transport mode: stdio (default), http, sse
|
|
294
|
-
-p, --port <number> Port for HTTP/SSE transport (default: 3000)
|
|
295
|
-
--host <host> Host to bind to (HTTP/SSE only, default: localhost)
|
|
182
|
+
**Default output:**
|
|
296
183
|
```
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Initialize an MCP configuration file:
|
|
301
|
-
|
|
302
|
-
```bash
|
|
303
|
-
npx @agiflowai/one-mcp init [options]
|
|
304
|
-
|
|
305
|
-
Options:
|
|
306
|
-
-o, --output <path> Output file path (default: mcp-config.yaml)
|
|
307
|
-
--json Generate JSON config instead of YAML
|
|
308
|
-
-f, --force Overwrite existing config file
|
|
184
|
+
filesystem:
|
|
185
|
+
- read_file: Read contents of a file at the specified path...
|
|
186
|
+
- list_directory: List all files and directories...
|
|
309
187
|
```
|
|
310
188
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
List all available tools from configured servers:
|
|
314
|
-
|
|
315
|
-
```bash
|
|
316
|
-
npx @agiflowai/one-mcp list-tools --config ./mcp-config.yaml
|
|
189
|
+
**With omitToolDescription:**
|
|
317
190
|
```
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
Get detailed information about specific tools:
|
|
322
|
-
|
|
323
|
-
```bash
|
|
324
|
-
npx @agiflowai/one-mcp describe-tools \
|
|
325
|
-
--config ./mcp-config.yaml \
|
|
326
|
-
--tools tool1,tool2
|
|
191
|
+
filesystem:
|
|
192
|
+
read_file, list_directory, search_files
|
|
327
193
|
```
|
|
328
194
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
Execute a tool directly from CLI:
|
|
332
|
-
|
|
333
|
-
```bash
|
|
334
|
-
npx @agiflowai/one-mcp use-tool \
|
|
335
|
-
--config ./mcp-config.yaml \
|
|
336
|
-
--tool-name read_file \
|
|
337
|
-
--args '{"path": "/path/to/file"}'
|
|
338
|
-
```
|
|
195
|
+
---
|
|
339
196
|
|
|
340
197
|
## MCP Tools
|
|
341
198
|
|
|
342
|
-
When running as an MCP server, one-mcp provides
|
|
199
|
+
When running as an MCP server, one-mcp provides:
|
|
343
200
|
|
|
344
|
-
### `
|
|
201
|
+
### `describe_tools`
|
|
345
202
|
|
|
346
|
-
Get
|
|
203
|
+
Get information about available tools:
|
|
347
204
|
|
|
348
|
-
**Input:**
|
|
349
205
|
```json
|
|
350
206
|
{
|
|
351
|
-
"toolNames": ["
|
|
352
|
-
"serverName": "optional
|
|
207
|
+
"toolNames": ["read_file", "write_file"],
|
|
208
|
+
"serverName": "filesystem" // optional
|
|
353
209
|
}
|
|
354
210
|
```
|
|
355
211
|
|
|
356
|
-
### `
|
|
212
|
+
### `use_tool`
|
|
357
213
|
|
|
358
|
-
Execute a tool from any connected server
|
|
214
|
+
Execute a tool from any connected server:
|
|
359
215
|
|
|
360
|
-
**Input:**
|
|
361
216
|
```json
|
|
362
217
|
{
|
|
363
218
|
"toolName": "read_file",
|
|
364
219
|
"toolArgs": {
|
|
365
220
|
"path": "/path/to/file"
|
|
366
221
|
},
|
|
367
|
-
"serverName": "optional-
|
|
222
|
+
"serverName": "filesystem" // optional, auto-detected if unique
|
|
368
223
|
}
|
|
369
224
|
```
|
|
370
225
|
|
|
371
|
-
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## CLI Commands
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Start MCP server (stdio, for Claude Code/Cursor)
|
|
232
|
+
npx @agiflowai/one-mcp mcp-serve --config ./mcp-config.yaml
|
|
372
233
|
|
|
373
|
-
|
|
234
|
+
# Start with HTTP transport
|
|
235
|
+
npx @agiflowai/one-mcp mcp-serve --config ./mcp-config.yaml --type http --port 3000
|
|
374
236
|
|
|
375
|
-
|
|
237
|
+
# Initialize config file
|
|
238
|
+
npx @agiflowai/one-mcp init --output mcp-config.yaml
|
|
376
239
|
|
|
377
|
-
|
|
240
|
+
# List all tools from configured servers
|
|
241
|
+
npx @agiflowai/one-mcp list-tools --config ./mcp-config.yaml
|
|
242
|
+
|
|
243
|
+
# Get tool details
|
|
244
|
+
npx @agiflowai/one-mcp describe-tools --config ./mcp-config.yaml --tools read_file,write_file
|
|
245
|
+
|
|
246
|
+
# Execute a tool directly
|
|
247
|
+
npx @agiflowai/one-mcp use-tool --config ./mcp-config.yaml --tool-name read_file --args '{"path": "/tmp/test.txt"}'
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Server Options
|
|
251
|
+
|
|
252
|
+
| Option | Description | Default |
|
|
253
|
+
|--------|-------------|---------|
|
|
254
|
+
| `-c, --config` | Path to config file (YAML or JSON) | Required |
|
|
255
|
+
| `-t, --type` | Transport: `stdio`, `http`, `sse` | `stdio` |
|
|
256
|
+
| `-p, --port` | Port for HTTP/SSE | `3000` |
|
|
257
|
+
| `--host` | Host for HTTP/SSE | `localhost` |
|
|
258
|
+
| `--no-cache` | Force reload config, bypass cache | `false` |
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Use Cases
|
|
263
|
+
|
|
264
|
+
### 1. Consolidate Multiple Servers
|
|
265
|
+
|
|
266
|
+
**Before (10 server configs):**
|
|
378
267
|
```json
|
|
379
268
|
{
|
|
380
269
|
"mcpServers": {
|
|
381
270
|
"filesystem": { "command": "npx", "args": ["..."] },
|
|
382
271
|
"database": { "command": "npx", "args": ["..."] },
|
|
383
|
-
"web-search": { "command": "npx", "args": ["..."] }
|
|
384
|
-
// ... 7 more
|
|
272
|
+
"web-search": { "command": "npx", "args": ["..."] }
|
|
273
|
+
// ... 7 more
|
|
385
274
|
}
|
|
386
275
|
}
|
|
387
276
|
```
|
|
388
277
|
|
|
389
|
-
**After:**
|
|
278
|
+
**After (1 config):**
|
|
390
279
|
```json
|
|
391
280
|
{
|
|
392
281
|
"mcpServers": {
|
|
@@ -398,15 +287,7 @@ Instead of configuring 10+ MCP servers individually in your agent:
|
|
|
398
287
|
}
|
|
399
288
|
```
|
|
400
289
|
|
|
401
|
-
### 2.
|
|
402
|
-
|
|
403
|
-
Manage all MCP servers from a single YAML/JSON file that can be:
|
|
404
|
-
- Version controlled
|
|
405
|
-
- Shared across teams
|
|
406
|
-
- Hosted remotely
|
|
407
|
-
- Environment-specific
|
|
408
|
-
|
|
409
|
-
### 3. Mix Local and Remote Servers
|
|
290
|
+
### 2. Mix Local and Remote Servers
|
|
410
291
|
|
|
411
292
|
```yaml
|
|
412
293
|
mcpServers:
|
|
@@ -423,9 +304,7 @@ mcpServers:
|
|
|
423
304
|
Authorization: "Bearer ${COMPANY_TOKEN}"
|
|
424
305
|
```
|
|
425
306
|
|
|
426
|
-
###
|
|
427
|
-
|
|
428
|
-
Load different configs based on environment:
|
|
307
|
+
### 3. Environment-Specific Configs
|
|
429
308
|
|
|
430
309
|
```bash
|
|
431
310
|
# Development
|
|
@@ -435,21 +314,7 @@ npx @agiflowai/one-mcp mcp-serve --config ./mcp-dev.yaml
|
|
|
435
314
|
npx @agiflowai/one-mcp mcp-serve --config ./mcp-prod.yaml
|
|
436
315
|
```
|
|
437
316
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
# Install dependencies
|
|
442
|
-
pnpm install
|
|
443
|
-
|
|
444
|
-
# Build
|
|
445
|
-
pnpm build
|
|
446
|
-
|
|
447
|
-
# Run tests
|
|
448
|
-
pnpm test
|
|
449
|
-
|
|
450
|
-
# Run in development mode
|
|
451
|
-
pnpm dev
|
|
452
|
-
```
|
|
317
|
+
---
|
|
453
318
|
|
|
454
319
|
## Architecture
|
|
455
320
|
|
|
@@ -458,27 +323,17 @@ pnpm dev
|
|
|
458
323
|
│ AI Agent │
|
|
459
324
|
│ (Claude/etc) │
|
|
460
325
|
└────────┬────────┘
|
|
461
|
-
│ Single MCP Connection
|
|
326
|
+
│ Single MCP Connection (2 tools)
|
|
462
327
|
│
|
|
463
328
|
┌────────▼────────────────────────────┐
|
|
464
|
-
│ │
|
|
465
329
|
│ @agiflowai/one-mcp │
|
|
466
330
|
│ │
|
|
467
|
-
│
|
|
468
|
-
│ │
|
|
469
|
-
│
|
|
470
|
-
│
|
|
471
|
-
│
|
|
472
|
-
|
|
473
|
-
│ │
|
|
474
|
-
│ ┌─────────────────────────────┐ │
|
|
475
|
-
│ │ McpClientManagerService │ │
|
|
476
|
-
│ │ - Connect to MCP servers │ │
|
|
477
|
-
│ │ - Manage connections │ │
|
|
478
|
-
│ │ - Route tool calls │ │
|
|
479
|
-
│ └─────────────────────────────┘ │
|
|
480
|
-
│ │
|
|
481
|
-
└──────┬──────┬───────┬──────────────┘
|
|
331
|
+
│ • Load configs (YAML/JSON) │
|
|
332
|
+
│ • Environment interpolation │
|
|
333
|
+
│ • Connect to servers on-demand │
|
|
334
|
+
│ • Route tool calls │
|
|
335
|
+
│ • Apply blacklists │
|
|
336
|
+
└──────┬──────┬───────┬───────────────┘
|
|
482
337
|
│ │ │
|
|
483
338
|
│ │ │ Multiple MCP Connections
|
|
484
339
|
│ │ │
|
|
@@ -489,12 +344,16 @@ pnpm dev
|
|
|
489
344
|
└──────┘ └──────┘ └──────────┘
|
|
490
345
|
```
|
|
491
346
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
AGPL-3.0 © AgiflowIO
|
|
347
|
+
---
|
|
495
348
|
|
|
496
349
|
## Related Packages
|
|
497
350
|
|
|
498
|
-
- [@agiflowai/scaffold-mcp](../scaffold-mcp) -
|
|
499
|
-
- [@agiflowai/architect-mcp](../architect-mcp) -
|
|
500
|
-
- [@agiflowai/aicode-toolkit](../../apps/aicode-toolkit) - Unified CLI toolkit
|
|
351
|
+
- [@agiflowai/scaffold-mcp](../scaffold-mcp) - Code scaffolding and templates
|
|
352
|
+
- [@agiflowai/architect-mcp](../architect-mcp) - Design patterns and code review
|
|
353
|
+
- [@agiflowai/aicode-toolkit](../../apps/aicode-toolkit) - Unified CLI toolkit
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## License
|
|
358
|
+
|
|
359
|
+
AGPL-3.0 © AgiflowIO
|