Skip to content

Allow arbitrary MCP hostname - #223

Merged
blind-oracle merged 7 commits into
mainfrom
igor/independent-mcp-domain
Aug 27, 2026
Merged

blind-oracle merged 7 commits into
mainfrom
igor/independent-mcp-domain

Conversation

@blind-oracle

Copy link
Copy Markdown
Collaborator

Currently if MCP hostname does not overlap with any of base/custom domains - it doesn't work due to the base domain lookup failure.

This PR fixes it by reworking how MCP calls are handled: they're caught now early on and passed directly to the MCP router before any other middleware kicks in.

@blind-oracle
blind-oracle requested a review from a team as a code owner August 26, 2026 11:46
@zeropath-ai

zeropath-ai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 8b09809.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► src/mcp.rs
    Implement IiType enum with Display and FromStr for custom MCP II instances
► src/mcp.rs
    Add MCP state management (McpState) and middleware to route MCP requests
► src/mcp.rs
    Update setup_mcp to return McpState and handle custom II instances
► src/mcp.rs
    Add tests for IiType parsing (prod, beta, custom) and error cases
Enhancement ► src/routing/mod.rs
    Remove hard dependency on extract_authority and extract_host in routing setup
► src/routing/mod.rs
    Integrate MCP startup logic under feature flag and inject MCP middleware into router when enabled
► src/routing/mod.rs
    Adjust API hostname handling to reflect changed API hostname source

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Routes MCP requests before domain resolution, allowing MCP to use arbitrary hostnames.

Changes:

  • Adds hostname-based MCP middleware.
  • Updates arbitrary-hostname integration coverage.
  • Adds custom Internet Identity configuration parsing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/routing/mod.rs Installs early MCP routing and updates tests.
src/mcp.rs Adds MCP middleware, state, and custom II parsing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/mcp.rs
Comment thread src/routing/mod.rs
Comment thread src/mcp.rs
Comment thread src/routing/mod.rs
Comment thread src/mcp.rs
Comment thread src/mcp.rs Outdated
Comment thread src/routing/mod.rs
@blind-oracle
blind-oracle merged commit 3b09d64 into main Aug 27, 2026
6 checks passed
@blind-oracle
blind-oracle deleted the igor/independent-mcp-domain branch August 27, 2026 08:14
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.

3 participants