Skip to main content
Glama
nwnusun-cool

MCP SSH Tools Server

by nwnusun-cool

add_server_config

Add a new server configuration to the SSH Tools Server by specifying name, IP address, SSH credentials, and optional port for remote management.

Instructions

动态添加服务器配置 参数:

  • name: 服务器名称

  • ip: 服务器IP地址

  • user: SSH用户名

  • password: SSH密码

  • port: SSH端口,默认22

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
ipYes
userYes
passwordYes
portNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:532-559 (handler)
    The primary handler function for the 'add_server_config' tool. It is decorated with @mcp.tool() which registers it with the MCP server. Validates inputs via type hints, delegates to MCPManager.add_server, and returns a standardized JSON response.
    @mcp.tool()
    def add_server_config(name: str, ip: str, user: str, password: str, port: int = 22) -> Dict[str, Any]:
        """
        动态添加服务器配置
        参数:
        - name: 服务器名称
        - ip: 服务器IP地址
        - user: SSH用户名
        - password: SSH密码
        - port: SSH端口,默认22
        """
        try:
            mcp_manager.add_server(name, ip, user, password, port)
            return {
                "success": True,
                "message": f"服务器配置添加成功: {name}",
                "server": {
                    "name": name,
                    "ip": ip,
                    "user": user,
                    "port": port
                }
            }
        except Exception as e:
            return {
                "success": False,
                "error": str(e)
            }
  • main.py:69-78 (helper)
    Helper method in the MCPManager class that performs the actual server configuration addition by instantiating a ServerConfig object and storing it in the server's config dictionary.
    def add_server(self, name: str, ip: str, user: str, password: str, port: int = 22):
        """添加服务器配置"""
        self.server_configs[name] = ServerConfig(
            name=name,
            ssh_ip=ip,
            ssh_user=user,
            ssh_password=password,
            ssh_port=port
        )
        logger.info(f"添加服务器配置: {name} ({ip}:{port})")
  • main.py:532-532 (registration)
    The @mcp.tool() decorator registers the add_server_config function as an MCP tool.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool adds server configuration but doesn't describe what 'add' entails—whether it creates a persistent entry, requires authentication, has side effects (e.g., restarting services), or handles errors. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the tool's purpose followed by a bulleted list of parameters. Each sentence earns its place by explaining the action and parameters concisely. Minor improvements could include combining the purpose and parameter sections more fluidly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation with 5 parameters), no annotations, and an output schema (which reduces the need to describe return values), the description is partially complete. It covers parameters well but lacks behavioral context (e.g., permissions, side effects) and usage guidelines. The presence of an output schema helps, but gaps remain for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description lists all 5 parameters with brief explanations (e.g., '服务器名称' for name, 'SSH端口,默认22' for port), adding meaning beyond the input schema which has 0% description coverage. It clarifies that port defaults to 22 and that parameters relate to SSH connectivity. However, it doesn't specify formats (e.g., IP validation) or constraints beyond defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as '动态添加服务器配置' (dynamically add server configuration), which specifies the verb 'add' and the resource 'server configuration'. This distinguishes it from sibling tools like list_servers or test_connection. However, it doesn't explicitly differentiate from potential configuration management alternatives beyond the sibling list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing admin access), when not to use it (e.g., for temporary configurations), or how it relates to sibling tools like list_servers or test_connection. The agent receives no usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/nwnusun-cool/mcp-server-ssh-tools'

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