You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change mcp_servers map to single mcp_server configuration object in rules only (#164)
* Initial plan
* Convert mcp_servers map to single mcp_server string field
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Clarify MCPServer() comment about rules being ignored
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Change mcp_servers map to single mcp_server config object
Convert from map of server configs to single MCPServerConfig object.
Each task/rule now specifies one MCP server configuration with
standard fields (command, args, env, type, url, headers) plus
arbitrary custom fields via the Content map.
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Remove empty MCP server detection checks
Remove the empty server detection logic from MCPServers() method
as requested. The agent will handle filtering empty configs. Updated
tests to expect empty MCPServerConfig structs in the returned slice.
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Remove MCPServer field from TaskFrontMatter
Tasks no longer have mcp_server field. MCP servers are now only
specified in rules. Result.MCPServers() now only returns configs
from rules. Updated tests, examples, and documentation.
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Merge main branch and resolve conflicts
Fetched from main and merged to resolve conflicts. All conflicts resolved:
- Removed old task_frontmatter.go and rule_frontmatter.go files
- Applied changes to new pkg/codingcontext/markdown/frontmatter.go structure
- Removed MCPServer field from TaskFrontMatter
- Changed RuleFrontMatter.MCPServers to MCPServer (single config)
- Updated Result.MCPServers() to return []mcp.MCPServerConfig from rules only
- Updated all tests to match new structure
- All tests pass, linter passes
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Update examples/agents/tasks/example-mcp-arbitrary-fields.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update examples/agents/tasks/example-mcp-arbitrary-fields.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Filter empty MCP configs and fix documentation
- Filter out empty MCP server configs in MCPServers() method
- Only return configs with Command or URL set
- Update tests to expect empty configs to be filtered
- Remove duplicate standard fields list from example doc
- Add documentation that empty configs are filtered
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: Alex Collins <alexec@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/reference/file-formats.md
+25-41Lines changed: 25 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,35 +137,6 @@ timeout: 10m
137
137
-`1h` - 1 hour
138
138
-`1h30m` - 1 hour 30 minutes
139
139
140
-
#### `mcp_servers` (optional, standard field)
141
-
142
-
**Type:** Map (from server name to server configuration)
143
-
**Purpose:** Specifies the MCP (Model Context Protocol) servers that the task should use; stored in frontmatter output but does not filter rules
144
-
145
-
The `mcp_servers` field is a **standard frontmatter field** following the industry standard for MCP server definition. It does not act as a selector. The field is a map where keys are server names and values are server configurations.
**Note:** The format follows the MCP specification for server identification. Each server configuration includes a `type` field (e.g., "stdio", "http", "sse") and other fields specific to that transport type.
168
-
169
140
#### `agent` (optional, standard field)
170
141
171
142
**Type:** String
@@ -625,25 +596,38 @@ agent: cursor
625
596
- If task/CLI specifies `agent: cursor`, only rules with `agent: cursor` or no agent field are included
626
597
- Rules without an agent field are considered generic and always included (unless other selectors exclude them)
627
598
628
-
#### `mcp_servers` (rule metadata)
599
+
#### `mcp_server` (rule metadata)
629
600
630
-
Specifies MCP servers that need to be running for this rule. Does not filter rules. The field is a map where keys are server names and values are server configurations.
601
+
Specifies an MCP server configuration for this rule. Each rule can specify one MCP server configuration with standard and arbitrary custom fields. Does not filter rules.
602
+
603
+
**Important:** MCP servers are specified in rules only, not in tasks. Tasks select rules (and thus MCP servers) via selectors.
You can include any custom fields for your specific server needs (e.g., `custom_config`, `monitoring`, `cache_enabled`, etc.). All fields are preserved in the configuration.
629
+
630
+
**Note:** This field is metadata and does not affect rule selection.
# Example with standard fields plus arbitrary custom fields
11
-
custom-database:
12
-
type: stdio
13
-
command: database-mcp
14
-
args: ["--verbose"]
15
-
# Arbitrary fields below
16
-
cache_enabled: true
17
-
max_cache_size: 1000
18
-
connection_pool_size: 10
19
-
20
-
# Example HTTP server with custom metadata
21
-
api-server:
22
-
type: http
23
-
url: https://api.example.com
24
-
headers:
25
-
Authorization: Bearer token123
26
-
# Arbitrary fields below
27
-
api_version: v2
28
-
rate_limit: 100
29
-
timeout_seconds: 30
30
-
retry_policy: exponential
31
-
region: us-west-2
32
-
33
-
# Example with nested custom configuration
34
-
advanced-server:
35
-
type: stdio
36
-
command: python
37
-
args: ["-m", "server"]
38
-
env:
39
-
PYTHON_PATH: /usr/bin/python3
40
-
# Arbitrary nested fields below
41
-
custom_config:
42
-
host: localhost
43
-
port: 5432
44
-
ssl: true
45
-
pool:
46
-
min: 2
47
-
max: 10
48
-
monitoring:
49
-
enabled: true
50
-
metrics_port: 9090
51
4
---
52
5
53
-
# Example Task with Arbitrary MCP Server Fields
6
+
# Example Rule with MCP Server Configuration
7
+
8
+
This example demonstrates how rules can specify MCP server configuration with arbitrary custom fields.
9
+
10
+
Note: MCP servers are specified in rules, not in tasks. Tasks can select which rules (and thus which MCP servers) to use via selectors.
11
+
12
+
## The `mcp_server` Field in Rules
13
+
14
+
Rules can specify a single MCP server configuration with both standard and arbitrary custom fields.
15
+
16
+
The `mcp_server` field, when present in a rule, specifies that rule's single MCP server configuration with both standard and arbitrary custom fields. Tasks cannot define MCP servers directly.
17
+
18
+
**Standard fields:**
19
+
-`command`: The executable to run (e.g., "python", "npx", "docker")
20
+
-`args`: Array of command-line arguments
21
+
-`env`: Environment variables for the server process
-`headers`: Custom HTTP headers for HTTP/SSE types
25
+
26
+
## Example Rule with MCP Server
27
+
28
+
```yaml
29
+
---
30
+
rule_name: python-mcp-server
31
+
mcp_server:
32
+
command: python
33
+
args: ["-m", "server"]
34
+
env:
35
+
PYTHON_PATH: /usr/bin/python3
36
+
custom_config:
37
+
host: localhost
38
+
port: 5432
39
+
ssl: true
40
+
pool:
41
+
min: 2
42
+
max: 10
43
+
monitoring:
44
+
enabled: true
45
+
metrics_port: 9090
46
+
---
47
+
48
+
# Python MCP Server Rule
54
49
55
-
This task demonstrates the ability to add arbitrary fields to MCP server configurations, just like we can with FrontMatter.
50
+
This rule provides the Python MCP server configuration.
51
+
```
56
52
57
53
## Why Arbitrary Fields?
58
54
59
-
Different MCP servers may need different configuration options beyond the standard fields (`type`, `command`, `args`, `env`, `url`, `headers`). Arbitrary fields allow you to:
55
+
Different MCP servers may need different configuration options beyond the standard fields. Arbitrary fields allow you to:
60
56
61
57
1.**Add custom metadata**: Version info, regions, endpoints, etc.
0 commit comments