mcp

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package mcp implements the Model Context Protocol server for RCON connections. It provides tools for connecting to, managing, and executing commands on RCON servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

Connect establishes a new RCON connection to a server. It creates a session, connects to the server, and authenticates using the provided password. Returns an error if the session already exists, connection fails, or authentication fails.

func Disconnect

Disconnect terminates an existing RCON connection and removes the session. Returns an error if the session doesn't exist.

func Execute

Execute sends a command to the RCON server and returns the response. The session must exist and be authenticated. Returns an error if the session is not found or if command execution fails.

func ListSessions

ListSessions retrieves information about all active RCON sessions. It returns session IDs, names, addresses, and connection/authentication status.

func Serve

func Serve()

Serve initializes and runs the MCP server. It registers all RCON tools and starts listening for MCP connections via stdio. The function blocks until the server is terminated or encounters a fatal error.

Types

type ConnectParams

type ConnectParams struct {
	SessionID string `json:"session_id" jsonschema:"Unique identifier for this RCON session"`
	Name      string `json:"name,omitempty" jsonschema:"Friendly name for this connection (optional)"`
	Address   string `json:"address" jsonschema:"RCON server address (host:port)"`
	Password  string `json:"password" jsonschema:"RCON server password"`
}

ConnectParams represents parameters for the connect tool

type DisconnectParams

type DisconnectParams struct {
	SessionID string `json:"session_id" jsonschema:"Session ID to disconnect"`
}

DisconnectParams represents parameters for the disconnect tool

type ExecuteParams

type ExecuteParams struct {
	SessionID string `json:"session_id" jsonschema:"Session ID to use for execution"`
	Command   string `json:"command" jsonschema:"Command to execute on the RCON server"`
}

ExecuteParams represents parameters for the execute tool

type ListSessionsParams

type ListSessionsParams struct{}

ListSessionsParams represents parameters for the list_sessions tool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL