Skip to main content
Glama
JumpServer MCP Server

JumpServer MCP Server

by xingrong0598

JumpServer MCP Server

Configure JumpServer Environment File (.env)

# JumpServer base URL
jumpserver_url=http://jumpserverhost

# Optional: Bearer token to access the JumpServer Swagger Json API
api_token=xxxxxxx

# Optional: Access Key authentication for JumpServer API
access_key_id=your-access-key-id
access_key_secret=your-access-key-secret

# Optional: JumpServer organization ID
jms_org_id=00000000-0000-0000-0000-000000000002

# Optional: Protect MCP HTTP endpoint with an API key
api_key=your-mcp-http-api-key

# Optional: JumpServer SSH gateway (for SSH command execution tool)
ssh_gateway_host=your-ssh-gateway-host
ssh_gateway_port=2222
ssh_gateway_username=your-gateway-username
ssh_gateway_password=your-gateway-password
default_system_user=root

Copy .env.example to .env and fill in your values. Do not commit .env (it is in .gitignore).

Related MCP server: jumpserver-ssh-mcp

Start Docker Container

docker run -d -it -p 8099:8099 --env-file .env --name jms_mcp ghcr.io/jumpserver/mcp:latest

Create JumpServer API Bearer Token for MCP Server


TOKEN=$(curl -s -X POST http://jumpserver_host/api/v1/authentication/auth/ \
  -H "Content-Type: application/json" \
  -d '{
    "username": "admin",
    "password": "xxxx"
  }' \
  --insecure | jq -r '.token')

echo "Your Bearer token: $TOKEN"

MCP Server Configuration

{
    "type": "sse",
    "url": "http://127.0.0.1:8099/sse",
    "headers": {
        "Authorization": "Bearer xxxxxxxx"
    }
}

Custom SSH and SFTP Tools

In addition to the tools generated from the JumpServer OpenAPI schema, this MCP server exposes custom tools that use the JumpServer SSH gateway (same config as ssh_gateway_* in .env):

  • jumpserver_ssh_command — execute a shell command on an asset (e.g. df -h).

  • jumpserver_sftp_upload — upload text or Base64 content to a remote file path.

  • jumpserver_sftp_download — download file content from a remote path (text or Base64).

  • jumpserver_sftp_list — list directory contents on an asset (returns JSON).

jumpserver_ssh_command

Input schema:

  • asset_ip (string, required): Target asset IP (e.g. 192.168.1.100)

  • system_user (string, optional): System username on the target asset (default: default_system_user from .env)

  • command (string, required): Shell command to execute (for example df -h)

This tool uses the SSH gateway configuration from .env (ssh_gateway_host, ssh_gateway_port, ssh_gateway_username, ssh_gateway_password) to open an SSH session to the asset and run the requested command. The result is returned as plain text (stdout and stderr).

Warning: These are high‑privilege operations. Make sure the SSH gateway account and asset permissions are strictly controlled.

For AI clients: see docs/ai-mcp-ssh-usage.md for connection config, all four tools (SSH + SFTP), parameters, and examples.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to securely execute commands, transfer files, and manage port forwarding on remote servers via SSH.
      114 npm
      38
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to securely execute remote commands via SSH or JumpServer, with flexible gateway configuration and plugin-based matchers for JumpServer login interfaces.
      2
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to execute commands on remote servers via SSH with dynamic host discovery through JumpServer and automatic username fallback.
      6
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to list and administer JumpServer assets, execute commands, and upload, download, or relay files through pooled, audited bastion connections.
      3
      MIT