Skip to content

feat(mcp): HTTP/remote MCP server support (closes #96)#210

Merged
Shooksie merged 1 commit intomainfrom
feat/http-remote-mcp-support
Apr 1, 2026
Merged

feat(mcp): HTTP/remote MCP server support (closes #96)#210
Shooksie merged 1 commit intomainfrom
feat/http-remote-mcp-support

Conversation

@Shooksie
Copy link
Copy Markdown
Contributor

@Shooksie Shooksie commented Apr 1, 2026

Summary

  • Config layer: transport + url fields added to McpServerDefinition (workflow YAML) and ProjectMcpServerEntry (.ao/config.json). command now has #[serde(default)] so HTTP-only servers can omit it.
  • Validation: transport restricted to "stdio" | "http"; "http" requires url; "stdio" (or absent) requires command.
  • Runtime contract injection: all three inject functions (inject_project_mcp_servers, inject_workflow_mcp_servers, inject_named_mcp_servers) forward transport + url into the additional_servers JSON.
  • Agent lockdown (Claude, Codex, Gemini, OpenCode): additional servers with a url now emit the correct vendor-native HTTP config instead of being silently dropped.
  • oai-runner: McpServerConfig accepts url/transport; connect() uses rmcp::StreamableHttpClientTransport for HTTP; reqwest upgraded 0.12 → 0.13 to match rmcp.

Example workflow YAML (now works)

mcp_servers:
  remote-context7:
    transport: http
    url: "https://mcp.context7.com/mcp"

  local-ao:
    command: ao
    args: [mcp, serve]

Test plan

  • cargo ao-fmt — clean
  • cargo ao-lint — clean
  • cargo test -p agent-runner — 113/113 pass
  • cargo test -p oai-runner — pass
  • cargo test -p protocol — pass
  • Pre-existing failures in orchestrator-config and workflow-runner-v2 confirmed unchanged on main

🤖 Generated with Claude Code

Add first-class HTTP/remote MCP server support across the config, runtime
contract, and agent lockdown layers.

## Changes

### Config types
- `protocol::ProjectMcpServerEntry`: add `transport` (Option<String>) and
  `url` (Option<String>) fields; `command` now has `#[serde(default)]`
  so HTTP-only servers don't need an empty command string.
- `orchestrator_config::McpServerDefinition`: same additions.

### Validation
- `transport` must be "stdio" or "http" when set.
- `transport = "http"` requires a non-empty `url`.
- `transport = "stdio"` (or absent) continues to require a non-empty `command`.

### Runtime contract injection
- All three injection sites (`inject_project_mcp_servers`,
  `inject_workflow_mcp_servers`, `inject_named_mcp_servers`) now forward
  `transport` and `url` into the `additional_servers` JSON passed to agent
  runners.

### Agent lockdown (agent-runner)
- `AdditionalMcpServer` gains a `url: Option<String>` field.
- Parsing in `resolve_mcp_tool_enforcement` reads `url`; filters allow
  servers with a URL even if `command` is empty.
- Claude, Codex, Gemini, and OpenCode lockdown functions each emit the
  correct vendor-native HTTP config when `url` is set:
  - Claude: `{ "type": "http", "url": "..." }`
  - Codex: `mcp_servers.<name>.url = "..."`
  - Gemini: `{ "type": "http", "url": "..." }`
  - OpenCode: `{ "type": "remote", "url": "...", "enabled": true }`
- `apply_oai_runner_native_mcp_lockdown` now emits an HTTP entry
  (`[{ "url": "...", "transport": "http" }]`) instead of a no-op return.

### OAI runner
- `McpServerConfig` adds `url` and `transport` fields.
- `connect()` branches on HTTP when `url` is set or `transport = "http"`,
  using `rmcp::StreamableHttpClientTransport`.
- Enable `transport-streamable-http-client-reqwest` rmcp feature.
- Upgrade `reqwest` from 0.12 to 0.13 to match rmcp's internal reqwest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Shooksie Shooksie merged commit 8507cfa into main Apr 1, 2026
24 checks passed
This was referenced Apr 1, 2026
@Shooksie Shooksie mentioned this pull request Apr 8, 2026
Shooksie added a commit that referenced this pull request Apr 8, 2026
feat(mcp): HTTP/remote MCP server support — closes #96

Adds transport+url fields to MCP server config, HTTP validation, runtime contract injection for all agents (Claude, Codex, Gemini, OpenCode), and oai-runner StreamableHttpClientTransport. reqwest 0.12→0.13.

Dispatched by ao-product conductor sweep #16, implemented by implement-rust workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant