Simple Subprocess MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Simple Subprocess MCP Serverlist all Python files in the current directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Simple Subprocess MCP Server
シェルコマンドを実行するシンプルなModel Context Protocol (MCP) サーバー
概要
このMCPサーバーは、LLMアプリケーションから任意のシェルコマンドを安全に実行できるツールを提供します。FastMCPフレームワークを使用して構築されており、subprocessモジュールを通じてコマンドを実行します。
Related MCP server: PermShell MCP
機能
任意のシェルコマンドの実行
30秒のタイムアウト設定
エラーハンドリング
標準出力とエラー出力の取得
必要条件
Python 3.11+
uv (パッケージマネージャー)
インストール
# 依存関係をインストール
uv sync使用方法
1. サーバーの起動
# 直接実行
uv run python server.py
# または fastmcp コマンドを使用
uv run fastmcp run server.py2. テストクライアントの実行
uv run python test_client.py3. LLMアプリケーションとの統合
Claude Desktop等のMCP対応アプリケーションで使用する場合、設定ファイルにサーバーのパスを追加してください。
API
run_command(command: str) -> str
指定されたシェルコマンドを実行し、結果を返します。
パラメータ:
command: 実行するシェルコマンド(文字列)
戻り値:
成功時: コマンドの標準出力
エラー時: エラーメッセージ(終了コードとエラー出力を含む)
例:
# ファイル一覧を取得
result = await client.call_tool("run_command", {"command": "ls -la"})
# Webサイトから連絡先情報を抽出
result = await client.call_tool("run_command", {
"command": "curl -sL \"[URL]\" | grep -i contact"
})セキュリティ考慮事項
⚠️ 注意: このサーバーは任意のシェルコマンドを実行できるため、信頼できる環境でのみ使用してください。
推奨される対策
サンドボックス環境での実行
コマンドフィルタリングの実装
実行権限の制限
ログ監視の実装
ファイル構造
simple-subprocess/
├── server.py # MCPサーバーのメイン実装
├── test_client.py # テスト用クライアント
├── pyproject.toml # プロジェクト設定
├── uv.lock # 依存関係ロックファイル
└── README.md # このファイル実装例
Webスクレイピング
curl -sL "[URL]" | grep -i -E "(contact|お問い合わせ|連絡|メール|mail|email|tel|電話)"ファイル操作
# ディレクトリ内容の確認
ls -la
# ファイルの検索
find . -name "*.py" -type f
# テキストファイルの内容確認
cat README.mdシステム情報の取得
# システム情報
uname -a
# ディスク使用量
df -h
# プロセス一覧
ps auxトラブルシューティング
タイムアウトエラー
コマンドの実行時間が30秒を超える場合、タイムアウトエラーが発生します。長時間実行されるコマンドの場合は、server.pyのtimeout値を調整してください。
パーミッションエラー
実行権限が不足している場合は、適切な権限を付与するか、sudo を使用してください(ただし、セキュリティリスクを考慮してください)。
ライセンス
MIT License
貢献
プルリクエストやイシューの報告を歓迎します。
Available Tools
1 toolrun_commandC
Execute a shell command using subprocess and return the output
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions execution and output return, but fails to disclose critical traits such as security implications, error handling, timeouts, or side effects. This is a significant gap for a tool that executes shell commands, which can be destructive or resource-intensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded, consisting of a single sentence that directly states the tool's function. Every word earns its place, with no unnecessary elaboration or redundancy, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of executing shell commands, the description is incomplete. With no annotations, 0% schema coverage, and only an output schema (which doesn't explain behavior), it lacks essential context such as safety warnings, execution environment, or error details. This makes it inadequate for safe and effective use by an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for the lack of parameter documentation. It only implies that 'command' is a shell command without adding meaning beyond the schema's basic type. No details on command format, allowed syntax, or constraints are provided, failing to adequately explain the parameter's semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Execute a shell command') and resource ('using subprocess'), making the purpose immediately understandable. It distinguishes the tool's function well, though without sibling tools, differentiation isn't applicable. However, it lacks specificity about the type of shell or environment, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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, prerequisites, or any context for its application. It merely states what the tool does without indicating scenarios, limitations, or best practices, leaving the agent with insufficient usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is clearly defined and distinct by default.
A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The name 'run_command' follows a clear verb_noun pattern.
One tool is too few for a server's purpose, as it severely limits functionality and scope. This feels thin and inadequate for handling subprocess operations beyond basic command execution.
The server is severely incomplete for subprocess management. It only offers command execution, lacking essential operations like checking process status, handling input/output streams, or managing subprocess lifecycle (e.g., kill, wait).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.7MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that allows LLMs to execute shell commands with explicit user permission through desktop notifications.2201MIT
- AlicenseAqualityAmaintenanceA Model Context Protocol server that allows LLMs to securely execute shell commands on remote Linux and Windows systems via SSH. It supports password and key-based authentication, command timeouts, and sudo elevation for administrative tasks.1114,123688MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables users to execute arbitrary shell commands through a terminal tool. It supports custom working directories, configurable execution timeouts, and safe command parsing using shlex.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/yonaka15/simple-subprocess-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server