Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

http4k MCP Desktop Client

License

NotificationsYou must be signed in to change notification settings

http4k/mcp-desktop

Repository files navigation

http4k Logo

A command-line desktop client for connecting to MCP (Model Context Protocol) servers via standard input/output (StdIO). This client is designed to workseamlessly with AI assistants and applications that communicate through StdIO, such as Claude and other desktop AI applications.

Overview

The http4k MCP Desktop Client serves as a proxy that enables communication between desktop applications and MCP servers. While it works with any MCP-compliantserver, it's specially optimized for servers built using thehttp4k MCP SDK.

Features

  • Multiple remote transport options: HTTP Streaming, SSE (Server-Sent Events), JSON-RPC, WebSocket
  • Various authentication methods: API Key, Bearer Token, Basic Auth, and OAuth
  • Customizable reconnection strategy
  • Simple StdIO interface for easy integration with desktop applications when using natively compiled Kotlin apps.

Remote Protocol Comparison

TheMCP Standard remote protocol is HTTP Streaming, which superceded the previous standard (SSE) in the2025-03-26 version. http4k has implemented other standard transports into the http4k-mcp-desktop, as these will be more appropriate for distributed/hosted MCP servers.

ProtocolStandard/ExtensionStateDefault server pathSettingDescription
HTTP Non-streamingMCP StandardStatelesshttp://host/mcphttp-nonstreamPure HTTP-based streaming communicationUse this setting for Cursor!
HTTP StreamingMCP StandardStatefulhttp://host/mcphttp-streamHTTP/SSE-based streaming communication. Supports sessions and replaying/reconnection of stram
SSEMCP (Legacy)Statefulhttp://host/ssesseServer-Sent Events, part of HTML5 spec, ideal for streaming data from server to client
WebSocketProtocol ExtensionStatefulhttp://host/wswebsocketFull-duplex communication protocol, maintains persistent connection
JSON-RPCProtocol ExtensionStatelesshttp://host/jsonrpcjsonrpcRemote Procedure Call protocol encoded in JSON, request/response model

Installation

Via Homebrew

brew tap http4k/tapbrew install http4k-mcp-desktop

Via GitHub Releases

Download the latest release fromGitHub Releases.

Usage

http4k-mcp-desktop --url http://localhost:3001/<protocol> [OPTIONS]

Command Line Options

OptionDescriptionDefault
--transportMCP transport mode:http-stream,http-nonstream,sse (legacy),jsonrpc (non-streaming),websocket (streaming)http-stream
--urlURL of the MCP server to connect to (required)N/A
--reconnectDelayReconnect delay in seconds if disconnected0
--versionGet the version information for the appN/A

Authentication Options

At time of writing, the MCP auth standards are in flux, but http4k-mcp-desktop has implemented some standard HTTP mechanisms into the http4k-mcp-desktop.

  • Basic Auth
  • Bearer Token
  • API Key
  • *OAuth via standardised auto-discovery
  • This is the OAuth standard which is currently in the post 2025-03-26 draft specification which uses auto discovery of the authentication token usingOAuth Protected Resource and OAuth Client Credentials. This requires:

    • The MCP server to list its authentication servers in it's OAuth Protected Resource metadata endpoint (/.well-knwon/oauth-protected-resource)
    • The Authentication server to support the OAuth Client Credentials flow and auto discovery endpoint (/.well-knwon/oauth-authorization-server)

MCP servers built using thehttp4k MCP SDK do support the above, but other servers may not.

OptionDescriptionFormat
--apiKeyAPI key for server authenticationString
--apiKeyHeaderCustom header name for API keyX-Api-key (default)
--bearerTokenBearer token for server authenticationString
--basicAuthBasic authentication credentials<user>:<password>
--oauthScopesOAuth scopes to requestComma-separated list
--oauthClientCredentialsOAuth client credentials<client>:<secret>

Examples

Basic connection: HTTP Streaming (HTTP+SSE) HTTP Connection

http4k-mcp-desktop --url http://localhost:3001/mcp...orhttp4k-mcp-desktop --url http://localhost:3001/mcp --transport http-stream

Basic connection: HTTP Non-streaming (HTTP) + Cursor

http4k-mcp-desktop --url http://localhost:3001/mcp --transport http-nonstream

Basic SSE Connection (legacy MCP standard)

http4k-mcp-desktop --url http://localhost:3001/sse --transport sse

HTTP Streaming with auto-discovered (Protected Resource) OAuth Authentication.

http4k-mcp-desktop --url http://localhost:3001/mcp --oauthClientCredentials client:secret

JSON-RPC with API Key Auth w

http4k-mcp-desktop --transport jsonrpc --url http://localhost:3001/jsonrpc --apiKey your-api-key

WebSocket with Bearer Token and Reconnect

http4k-mcp-desktop --transport websocket --url ws://localhost:3001/ws --bearerToken your-token --reconnectDelay 5

Integration with AI Applications

This client is specifically designed to work with desktop AI applications that use StdIO for communication. It handles:

  1. Reading input from the AI application via stdin
  2. Sending that input to the MCP server
  3. Receiving responses from the server
  4. Passing those responses back to the application via stdout

This enables seamless connections between desktop AI applications like Claude and remote MCP servers.

Configuring Claude Desktop

To configure Claude Desktop to use the http4k MCP Desktop Client, you'll need to create a JSON configuration file. Note that if you're on mac and installed theapp via Brew, it will already be on your path. Here's how to set it up:

  1. Create aconfig.json file with the following structure:
{"command":"/path/to/http4k-mcp-desktop","args": ["--url","http://your-mcp-server:port/mcp"    ],"env": {}}
  1. Adjust the parameters as needed:

    • Update the path to where you've installed the http4k-mcp-desktop binary. For brew users it's already on your path so just usehttp4k-mcp-desktop
    • Set the correct URL and protocol options for your MCP server (see examples)
    • Add any authentication options required (see examples)
  2. In the Claude Desktop application settings, specify the path to yourconfig.json file.

Example Configurations

Basic MCP Server Connection:

{"command":"/usr/local/bin/http4k-mcp-desktop","args": ["--url","http://localhost:3001/sse"    ],"env": {}}

With API Key Authentication:

{"command":"/usr/local/bin/http4k-mcp-desktop","args": ["--url","http://localhost:3001/sse","--apiKey","your-api-key"    ],"env": {}}

With OAuth Authentication:

{"command":"/usr/local/bin/http4k-mcp-desktop","args": ["--url","http://localhost:3001/sse","--oauthTokenUrl","http://localhost:3001/token","--oauthClientCredentials","client:secret"    ],"env": {}}

Learn More

FAQ

  • Q: I'm using Cursor but I get an error message when installing my MCP connection
  • A: Cursor users should currently use HTTP Non-streaming mode (--transport http-nonstream)

License

This project is licensed under thehttp4k Commercial License, which is totally free for non-commercial, non-profitand research use.

About

http4k MCP Desktop Client

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp