Skip to main content
Glama

CS2 RCON MCP Server

by v9rt3x

CS2 RCON MCP

Python MCP 兼容 许可证:MIT

用于 CS2 RCON 管理的模型上下文协议服务器。

描述

该项目提供了一个模型上下文协议 (MCP) 服务器接口,用于通过 RCON 管理 CS2 游戏服务器。它允许通过标准化协议对 CS2 服务器进行远程控制和监控。

CS2 RCON MCP 演示

特征

  • 使用自然语言管理您的 CS2 服务器

  • RCON命令执行

  • 服务器状态监控

  • 基于SSE的通信

  • Docker 支持

安装

pip install -e .

用法

运行服务器

python -m rcon_mcp

可用命令

  • rcon <command> :执行任何 RCON 命令

  • status :获取当前服务器状态

  • changelevel <map_name> :更改当前地图

  • mp_warmup_end :结束预热阶段

  • mp_restartgame 1 :重新开始游戏

  • 还有更多 CS2 服务器命令

环境变量

  • HOST :CS2服务器IP

  • SERVER_PORT :CS2 服务器端口

  • RCON_PASSWORD :RCON 密码

Docker(推荐)

从 GitHub Container Registry 拉取 Docker 镜像:

docker pull ghcr.io/v9rt3x/cs2-rcon-mcp:main

Docker 环境变量

使用Docker运行时,可以通过两种方式设置环境变量:

  1. 直接在命令中

    docker run -p 8080:8080 \ -e HOST=your_server_ip \ -e SERVER_PORT=your_server_port \ -e RCON_PASSWORD=your_password \ ghcr.io/v9rt3x/cs2-rcon-mcp:main
  2. 使用:创建一个名为.server-env的文件,其内容如下:

    HOST=your_server_ip SERVER_PORT=your_server_port RCON_PASSWORD=your_password

    然后像这样运行容器:

    docker run -p 8080:8080 --env-file .server-env ghcr.io/v9rt3x/cs2-rcon-mcp:main

这为用户提供了设置环境变量的替代方法,从而更容易管理密码等敏感信息。

从 Visual Studio Code 连接 (GitHub Copilot)

要配置 Visual Studio Code 以与 MCP 服务器配合使用,请按照以下步骤操作:

  1. 启动 MCP 服务器:在尝试从 VS Code 连接之前,请确保您的 MCP 服务器正在运行。

  2. 打开 Visual Studio Code :启动 VS Code 并确保已安装并配置 GitHub Copilot 扩展。

  3. 配置 GitHub Copilot

    • 将模式从“询问”更改为“代理”模式。

  4. 添加 MCP 服务器配置

    • 单击 Copilot 提示左上角的工具箱图标。

    • 选择“添加 MCP 服务器”并选择HTTP - 服务器发送事件的选项。

  5. 输入服务器网址

    • 对于 URL,请输入: http://localhost:8080/cs2server/sse 。这是 MCP 服务器的 SSE 连接端点。

备选方案:从 Cursor(或任何其他 MCP 客户端)连接

  1. 启动 MCP 服务器

  2. 通过创建或更新~/.cursor/mcp.json来配置 Cursor 的 MCP 设置:

    { "mcpServers": { "cs2server": { "url": "http://localhost:8080/cs2server/sse" } } }
  3. 在 Cursor 中,打开 MCP 面板(通常在侧边栏)

  4. 服务器应该使用配置的 URL 自动连接

一旦连接,您就可以使用自然语言管理您的服务器。

提示示例:

  1. “在服务器中添加 5 个机器人并在 de_dust2 上开始竞技比赛”

  2. “当前服务器状态如何?有多少玩家在线?我们在哪张地图上?”

祝你玩得开心!😊

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器允许使用自然语言通过 RCON 命令管理反恐精英 2 游戏服务器。

  1. 描述
    1. 特征
      1. 安装
        1. 用法
          1. 运行服务器
          2. 可用命令
        2. 环境变量
          1. Docker(推荐)
            1. Docker 环境变量
            2. 从 Visual Studio Code 连接 (GitHub Copilot)
            3. 备选方案:从 Cursor(或任何其他 MCP 客户端)连接

          Related MCP Servers

          • -
            security
            F
            license
            -
            quality
            Model Context Protocol server that enables LLMs and AI assistants to retrieve real-time Dota 2 statistics, match data, player information, and game metrics through a standardized interface.
            Last updated -
            4
            • Linux
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables powerful PostgreSQL database management capabilities including analysis, schema management, data migration, and monitoring through natural language interactions.
            Last updated -
            18
            1,751
            124
            AGPL 3.0
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables AI models and applications to interact directly with Twitter/X, providing capabilities to create posts, reply to tweets, retrieve user data, and manage account actions.
            Last updated -
            2
            10
            MIT License
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server implementation that enables secure remote command execution via SSH, with features for managing and using SSH credentials.
            Last updated -
            5
            18
            9

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/v9rt3x/cs2-rcon-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server