YM

yonaka15/mcp-server-runner

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

19 stars 8 forks 质量 58 趋势 22MIT

一个用于运行"模型背景协议"(MCP)服务器的WebSocket服务器执行. 这个应用程序使得MCP服务器可以通过WebSocket连接访问,为与Web的集成提供便利. .

概览

:该项目目前正在积极发展之中,处于WIP(在进展中的工作)状态。 特征和API可能会有显著变化. 一个用于运行"模型背景协议"(MCP)服务器的WebSocket服务器执行. 该应用程序使MCP服务器能够通过WebSocket连接访问,为与Web应用程序和其他网络化客户端的整合提供便利. - 🚧:这个软件正在积极开发中 -- -- ⚠️:API和特性可能会不通知而改变 -- -- 🧪:目前正在测试和完善 -- -- 📝:正在积极更新文件 MCP Server Runner作为WebSocket客户端与MCP服务器执行之间的桥梁.

概述(AI 翻译)

** 注**: 该项目目前正在积极发展之中,并处于WIP(在进展中的工作)状态。 特征和API可能会有显著变化.

一个用于运行"模型背景协议"(MCP)服务器的WebSocket服务器执行. 该应用程序使MCP服务器能够通过WebSocket连接访问,为与Web应用程序和其他网络化客户端的整合提供便利.

□ 发展状况

  • 工作进展**: 这个软件正在积极开发中
  • ** API 稳定性**:API和特性可不经通知而改变
  • 测试**:目前正在测试和完善中
  • 文件: 文件正在积极更新

□ 概览

MCP Server Runner作为WebSocket客户端与MCP服务器执行之间的桥梁. 它会:

  • 启动MCP服务器程序
  • 管理 WebSocket 连接
  • 处理客户端与MCP服务器之间的双向通信
  • 支持优雅的关闭和错误处理

□ 特性

  • 在单一客户支持下实施WebSocket服务器
  • MCP服务器实例的程序管理
  • 客户端和服务器之间的双向消息传递
  • 伟大的关闭处理

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Server Runner

Note: This project is currently under active development and in WIP (Work In Progress) status. Features and APIs may change significantly.

A WebSocket server implementation for running Model Context Protocol (MCP) servers. This application enables MCP servers to be accessed via WebSocket connections, facilitating integration with web applications and other network-enabled clients.

Development Status

  • 🚧 Work In Progress: This software is in active development
  • ⚠️ API Stability: APIs and features may change without notice
  • 🧪 Testing: Currently undergoing testing and refinement
  • 📝 Documentation: Documentation is being actively updated

Overview

MCP Server Runner acts as a bridge between WebSocket clients and MCP server implementations. It:

  • Launches an MCP server process
  • Manages WebSocket connections
  • Handles bidirectional communication between clients and the MCP server
  • Supports graceful shutdown and error handling

Features

  • WebSocket server implementation with single-client support
  • Process management for MCP server instances
  • Bidirectional message passing between client and server
  • Graceful shutdown handling
  • Comprehensive error logging
  • Cross-platform support (Unix/Windows)

Prerequisites

  • Rust 1.70 or higher
  • An MCP server implementation executable

Configuration

Environment Variables

The application can be configured through environment variables:

PROGRAM=        # Path to the MCP server executable (required if no config file)
ARGS=           # Comma-separated list of arguments for the MCP server
HOST=0.0.0.0    # Host address to bind to (default: 0.0.0.0)
PORT=8080       # Port to listen on (default: 8080)
CONFIG_FILE=    # Path to JSON configuration file

Additional environment variables will be passed through to the MCP server process.

JSON Configuration

Alternatively, you can provide a JSON configuration file:

{
  "servers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/workspace"
      ]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
      }
    }
  },
  "default_server": "filesystem",
  "host": "0.0.0.0",
  "port": 8080
}

You can specify the configuration file in two ways:

  1. As a command-line argument: mcp-server-runner config.json
  2. Using the CONFIG_FILE environment variable: CONFIG_FILE=config.json mcp-server-runner

The JSON configuration allows you to define multiple server configurations and select one as the default.

Configuration Priority

  1. Command-line specified config file
  2. CONFIG_FILE environment variable
  3. Environment variables (PROGRAM, ARGS, etc.)
  4. Default values

Usage

在 GitHub 查看完整 README

安装

npx -y @modelcontextprotocol/server-filesystem /path/to/workspace
新手?先看 mcpskill.org 教程 →