Skip to content

MCP: [Low priority] Bridge for stdio-only clients #1045

Open

Description

@kyasbal

Part of #1049 / Depends on #1038

Summary

Add a command that relays standard I/O MCP messages to a running KHI server for MCP clients that cannot connect using a URL.

Background

Some MCP clients only support launching a configured command as a child process and communicating over standard I/O. KHI is a resident application used in a browser and holds inspection data in memory. Even if a client launches KHI as a separate process, it cannot reach the KHI data opened by the user in the browser. This has low priority because it is unnecessary for clients that can connect directly over HTTP.

Specification

  • The khi mcp subcommand only performs relaying without starting KHI itself.
  • Specify the destination using the --mcp-server-url flag or the KHI_SERVER_URL environment variable, with a default of http://127.0.0.1:8080.
  • The relay destination is /mcp/sse from MCP: Server foundation and HTTP transport #1038. Relay messages as-is without changing their contents.

Client configuration example

{
  "mcpServers": {
    "khi": {
      "command": "khi",
      "args": ["mcp", "--mcp-server-url", "http://127.0.0.1:8080"]
    }
  }
}

Message written to standard input

{"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"khi://inspections"}}

The message returned to standard output is the exact response from the KHI server.

{"jsonrpc":"2.0","id":3,"result":{"contents":[{"uri":"khi://inspections","mimeType":"text/markdown","text":"# Inspections\n\n..."}]}}

If the target KHI is not running, write the following to standard error and exit with code 1:

Error: failed to connect to KHI server at http://127.0.0.1:8080/mcp/sse: connection refused (please start KHI first)

Acceptance criteria

  • Tools and resources of a running KHI can be used from stdio-only clients via khi mcp.
  • If the target KHI is not running, exit with an error that explains the cause.

Related code

Activity

  1. added
    type:feature
    area:backend-core
    on Sep 25, 2026
  2. Ackberry commented on Nov 20, 2026

    @Ackberry
    Contributor

    Hi @kyasbal , can I take this issue?

  3. kyasbal commented on Nov 20, 2026

    @kyasbal
    MemberAuthor

    yes, you can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backend-coretype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions