-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
106 lines (95 loc) · 2.74 KB
/
config.example.yaml
File metadata and controls
106 lines (95 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# mcprouter config — annotated example
#
# This file shows every option mcprouter supports. Remove sections you
# do not need. Durations accept Go-style strings (e.g. "5s", "2m").
server:
host: 127.0.0.1
port: 8080
read_timeout: 30s
write_timeout: 60s
idle_timeout: 120s
shutdown_timeout: 10s
# Backends are the upstream MCP servers mcprouter will fan requests out to.
backends:
# Local filesystem MCP server (stdio transport)
- name: fs
transport: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
priority: 10
weight: 2
# Capability hints. Optional — discovery will fill these in too.
tools: [read_file, write_file, list_directory]
resources: ["file://"]
health:
interval: 30s
timeout: 5s
method: ping
timeout: 30s
# GitHub MCP server (remote HTTP transport with bearer auth)
- name: github
transport: http
url: https://mcp.example.com/github/rpc
priority: 8
weight: 1
tools: [create_issue, get_pr, list_repos]
auth:
type: bearer
token: ghp_YOUR_TOKEN_HERE
health:
interval: 60s
timeout: 10s
# Postgres MCP server (SSE transport with API key auth)
- name: postgres
transport: sse
url: https://mcp.example.com/postgres/sse
tools: [query, describe_table, list_databases]
auth:
type: api_key
header: X-API-Key
token: pg_SECRET_KEY
health:
interval: 30s
timeout: 5s
# Backup filesystem used only if 'fs' goes down (see fallback below)
- name: fs-backup
transport: stdio
command: node
args: ["./backup-fs-server.js"]
weight: 1
tools: [read_file, write_file]
health:
interval: 30s
timeout: 5s
routing:
# Strategy used when multiple backends can serve the same capability.
# Options: round_robin | weighted | least_connections | sticky
strategy: round_robin
# When true, aggregated tools/list responses are namespaced with
# "<backend><sep><tool>" so clients can disambiguate duplicates.
namespace: true
namespace_sep: "__"
# If no capability-based routing matches, send to this backend.
default_backend: fs
# Fallback chains: ordered lists of backends to try for a capability.
# Capability keys:
# "tool:NAME" — fallback for a specific tool name
# "tools/call" — fallback for every tools/call request
fallback:
- capability: "tool:read_file"
chain: [fs, fs-backup]
retries: 2
backoff: 200ms
- capability: "tool:create_issue"
chain: [github]
retries: 1
backoff: 500ms
logging:
file: /var/log/mcprouter/requests.log
level: info
max_size_mb: 50
max_backups: 5
redact: true # scrub token/password/api_key fields from logged params
metrics:
enabled: true
path: /metrics