open-code-review/cmd/opencodereview
kite 6b24e224c3
feat(mcp): support remote MCP servers via Streamable HTTP (#360)
* feat(mcp): add remote MCP server support via Streamable HTTP transport

Support connecting to remote MCP servers using the Streamable HTTP
transport from go-sdk. Users configure remote servers with type=remote,
a URL, and optional headers (with environment variable expansion for
secrets). Authentication stays outside OCR — users provide tokens via
headers, matching CLI tool conventions.

Closes #335

* docs(mcp): document remote MCP server support and shell expansion warning

Add remote transport (Streamable HTTP) documentation to MCP Server
sections in all READMEs and CLI help text. Include type/url/headers
field descriptions, remote server examples (CLI and JSON config),
and a tip about using single quotes to prevent shell expansion.

* fix(mcp): harden remote MCP client validation and error handling

- Reject URLs with missing host (e.g. "http://") in config validation
- Make empty-after-expansion header values a fatal error instead of a warning
- Detect HTTP 401/403 responses and surface clear authentication error messages
- Drain response body before closing to preserve connection pool reuse

* test(mcp): add tests for header env var expansion failure in NewRemoteClient

Verify that NewRemoteClient returns a clear error when header values
expand to empty strings, covering both explicitly empty env vars and
completely unset env vars.
2026-07-27 20:29:29 +08:00
..
background_file.go fix(background-file) Manage path at git repository root directory Refs:#324 (#327) 2026-07-13 11:27:54 +08:00
background_file_test.go fix(background-file) Manage path at git repository root directory Refs:#324 (#327) 2026-07-13 11:27:54 +08:00
config_cmd.go feat(mcp): support remote MCP servers via Streamable HTTP (#360) 2026-07-27 20:29:29 +08:00
config_cmd_test.go feat(mcp): support remote MCP servers via Streamable HTTP (#360) 2026-07-27 20:29:29 +08:00
config_dispatch_test.go test: improve coverage for cmd/opencodereview package from 42% to 70% 2026-06-27 01:47:48 +08:00
delegate_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
emit_run_result_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
flags.go feat(mcp): support remote MCP servers via Streamable HTTP (#360) 2026-07-27 20:29:29 +08:00
flags_test.go feat(review): add resumable sessions and session inspection (#306) 2026-07-09 11:43:11 +08:00
git.go fix(tool): resolve file_read paths against git top-level in monorepos (#309) 2026-07-07 20:06:28 +08:00
git_test.go test: fix golangci-lint errcheck/staticcheck issues in test code (#323) 2026-07-08 22:46:18 +08:00
llm_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
main.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
output.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
output_helpers_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
output_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
procattr_unix.go feat: add standard MCP tool support (#212) 2026-07-01 19:10:16 +08:00
procattr_windows.go feat: add standard MCP tool support (#212) 2026-07-01 19:10:16 +08:00
provider_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
provider_cmd_test.go test: fix golangci-lint errcheck/staticcheck issues in test code (#323) 2026-07-08 22:46:18 +08:00
provider_tui.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
provider_tui_funcs_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
provider_tui_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
review_cmd.go feat(mcp): support remote MCP servers via Streamable HTTP (#360) 2026-07-27 20:29:29 +08:00
review_cmd_test.go fix(cli): reject --to without --from in review flags (#151) 2026-06-16 20:26:22 +08:00
rules_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
scan_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
scan_cmd_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
session_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
session_cmd_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
shared.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
shared_test.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00
shell_unix.go feat: add standard MCP tool support (#212) 2026-07-01 19:10:16 +08:00
shell_windows.go feat: add standard MCP tool support (#212) 2026-07-01 19:10:16 +08:00
smallfiles_test.go test: improve coverage for cmd/opencodereview package from 42% to 70% 2026-06-27 01:47:48 +08:00
version.go feat(cli): display GitHub repository URL in version and help output 2026-06-02 22:50:36 +08:00
viewer_cmd.go fix: align Go module path with actual GitHub repository (#526) 2026-07-27 19:52:35 +08:00