Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ function buildGateConnectorYaml(upstreamPort: number, resourceName: string, hasP
lines.push(
"",
"policies:",
" - path: \"gate/policies/mcp_tool_allowlist.rego\"",
" - path: \"policies/mcp_tool_allowlist.rego\"",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recording dir path not updated for config-relative resolution

Medium Severity

The policy path was changed from gate/policies/mcp_tool_allowlist.rego to policies/mcp_tool_allowlist.rego to account for gate-connector resolving paths relative to the config file (gate/connector.yaml). However, the recording.dir value ".data/gate-mcp-recordings" was not similarly adjusted. If gate-connector resolves all relative paths against the config location, this recording dir now resolves to gate/.data/gate-mcp-recordings instead of the project-root .data/gate-mcp-recordings. It likely needs to be "../.data/gate-mcp-recordings" to preserve the original behavior.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cf511fa. Configure here.

" stage: \"pre_request\""
);
}
Expand Down Expand Up @@ -888,7 +888,8 @@ function buildGateReadme(upstreamPort: number, hasPolicy: boolean): string {
"",
"## Generated Policy",
"",
"The generated `gate/policies/mcp_tool_allowlist.rego` file allowlists the OpenAPI-derived tool names from this project."
"The generated `gate/policies/mcp_tool_allowlist.rego` file allowlists the OpenAPI-derived tool names from this project.",
"Its connector reference is config-relative, so `gate-connector -config <this-project>/gate/connector.yaml` works regardless of your current working directory."
);
}
return `${lines.join("\n")}\n`;
Expand Down
1 change: 1 addition & 0 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test("generate command creates project files", async () => {
assert.match(serverTs, /--spec/);
assert.match(gateReadme, /Point your MCP client at Gate/);
assert.match(gateConnector, /protocol: "mcp"/);
assert.match(gateConnector, /path: "policies\/mcp_tool_allowlist\.rego"/);
assert.match(gatePolicy, /approved_tools/);
assert.match(gatePolicy, /getHealth/);
assert.match(gatePolicy, /postEcho/);
Expand Down
Loading