Skip to main content
Glama
RuoJi6

Memory Shell Detector MCP

by RuoJi6

remove_memory_shell

Remove malicious Java memory shells from running JVM processes without restarting services. This tool unloads specified classes by deregistering them from web containers, removing Spring beans, or restoring hooked methods after AI confirmation.

Instructions

执行 memory-shell-detector-cli.jar 从 JVM 内存中移除指定的内存马类

底层命令: java -jar memory-shell-detector-cli.jar -r <class_name> -p

此工具通过 Java Agent 技术从运行中的 JVM 进程中卸载/禁用指定的恶意类, 实现不重启服务的情况下清除内存马。

移除机制:

  • 对于 Filter/Servlet/Listener:从 Web 容器中注销

  • 对于 Spring 组件:从 Spring 容器中移除 Bean

  • 对于 Agent 类型:尝试还原被 hook 的方法

安全机制:首次调用时会先反编译目标类源码供 AI 分析确认, 确认是内存马后需设置 ai_confirmed=True 再次调用才会执行移除。

Args: class_name: 要移除的内存马完整类名 pid: 目标 Java 进程的 PID tools_dir: 检测工具 jar 包所在目录 ai_confirmed: AI 是否已确认该类为内存马(首次调用设为 False) use_ssh: 是否通过 SSH 在远程服务器执行 ssh_host/ssh_username/ssh_password/ssh_key_path/ssh_port: SSH 连接参数

Returns: 首次调用返回反编译源码供分析,确认后返回移除结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYes
pidYes
tools_dirNo
ai_confirmedNo
use_sshNo
ssh_hostNo
ssh_usernameNo
ssh_passwordNo
ssh_key_pathNo
ssh_portNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries full burden and excels: it explains the removal mechanism for different component types (Filter/Servlet/Listener, Spring components, Agent types), details the safety mechanism requiring AI confirmation, describes the two-phase execution (analysis then removal), and mentions remote execution via SSH. This provides comprehensive behavioral context beyond basic parameters.

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 well-structured with clear sections (purpose, underlying command, mechanism, safety, parameters, returns) and appropriately sized. While comprehensive, it's not overly verbose; every sentence adds value. Minor deduction because the parameter explanations could be slightly more concise.

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

Completeness5/5

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

Given the tool's high complexity (destructive operation, 10 parameters, no annotations, but with output schema), the description is remarkably complete: it covers purpose, usage workflow, behavioral details, parameter meanings, safety mechanisms, and return behavior. The output schema handles return values, so the description appropriately focuses on operational context.

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

Parameters5/5

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

With 0% schema description coverage for 10 parameters, the description fully compensates: it explains all parameters in the Args section with clear semantics (class_name, pid, tools_dir, ai_confirmed, use_ssh, and SSH connection parameters), including their purposes and the critical ai_confirmed workflow. This adds substantial meaning beyond the bare schema.

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

Purpose5/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: '从 JVM 内存中移除指定的内存马类' (remove specified memory shell classes from JVM memory). It specifies the exact action (remove), target (memory shell classes), and mechanism (Java Agent technology), distinguishing it from siblings like scan_process or view_class_code which only detect or view.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: it explains the two-step process (first call with ai_confirmed=False to get decompiled source for analysis, then call with ai_confirmed=True to execute removal), mentions the underlying command, and implicitly distinguishes from siblings by focusing on removal rather than detection or listing.

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/RuoJi6/memory-shell-mcp'

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