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 ¶
- func Connect(ctx context.Context, cc *mcp.ServerSession, ...) (*mcp.CallToolResultFor[any], error)
- func Disconnect(ctx context.Context, cc *mcp.ServerSession, ...) (*mcp.CallToolResultFor[any], error)
- func Execute(ctx context.Context, cc *mcp.ServerSession, ...) (*mcp.CallToolResultFor[any], error)
- func ListSessions(ctx context.Context, cc *mcp.ServerSession, ...) (*mcp.CallToolResultFor[any], error)
- func Serve()
- type ConnectParams
- type DisconnectParams
- type ExecuteParams
- type ListSessionsParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[ConnectParams]) (*mcp.CallToolResultFor[any], error)
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 ¶
func Disconnect(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[DisconnectParams]) (*mcp.CallToolResultFor[any], error)
Disconnect terminates an existing RCON connection and removes the session. Returns an error if the session doesn't exist.
func Execute ¶
func Execute(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[ExecuteParams]) (*mcp.CallToolResultFor[any], error)
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 ¶
func ListSessions(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[ListSessionsParams]) (*mcp.CallToolResultFor[any], error)
ListSessions retrieves information about all active RCON sessions. It returns session IDs, names, addresses, and connection/authentication status.
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