Skip to main content
Glama
mocchalera

xserver-files-mcp

by mocchalera

xserver-files-mcp

XServer のファイル操作を SFTP 経由で安全に行うローカル stdio MCP サーバー & CLI。

前提条件: Node.js 20+、SSH アクセスが有効な XServer アカウント。

セットアップガイド

以下の手順を上から順に進めてください。AI エージェント(Claude Code、Codex など)に依頼する場合も、この手順に沿って自動実行されます。[要ユーザー操作] のマークがあるステップのみ人間の操作が必要です。

Step 1: インストール

git clone https://github.com/mocchalera/xserver-files-mcp.git
cd xserver-files-mcp
npm install

動作確認(サーバー接続不要):

XSERVER_FILES_CONFIG=config/example.config.json node src/cli.js servers

Step 2: XServer の情報を確認 [要ユーザー操作]

設定ファイルを作成するために、以下の情報が必要です。XServer サーバーパネル(https://secure.xserver.ne.jp/xapanel/login/xserver/server/)にログインして確認してください。

必要な情報

確認場所

サーバー ID

サーバーパネル上部に表示

sv12345

ホスト名

サーバー情報 → ホスト名

sv12345.xsrv.jp

操作対象のドメイン

ドメイン設定 → ドメイン一覧

example.com

ドキュメントルート

ドメイン設定 → ドメイン一覧の「ドキュメントルート」列

/home/sv12345/example.com/public_html

ヒント: XServer のドキュメントルートは通常 /home/<サーバーID>/<ドメイン>/public_html の形式です。

Step 3: 設定ファイルの作成

mkdir -p ~/.config/xserver-files-mcp
cp config/example.config.json ~/.config/xserver-files-mcp/config.json

~/.config/xserver-files-mcp/config.json を Step 2 で確認した情報に書き換えます:

{
  "defaultServer": "<サーバーID>",
  "localWorkspaceRoot": "~/Dev/xserver-sites",
  "servers": {
    "<サーバーID>": {
      "host": "<サーバーID>.xsrv.jp",
      "port": 10022,
      "username": "<サーバーID>",
      "privateKeyPath": "~/.ssh/xserver_<サーバーID>",
      "roots": {
        "<ドメイン>": "/home/<サーバーID>/<ドメイン>/public_html"
      }
    }
  }
}

localWorkspaceRoot はサイトファイルの pull 先です。このリポジトリの外であれば任意のパスで構いません。

Step 4: SSH 鍵の作成

ssh-keygen -t ed25519 -f ~/.ssh/xserver_<サーバーID> -C xserver-<サーバーID>

パスフレーズを設定した場合は、設定ファイルの passphraseEnv にパスフレーズを格納する環境変数名を指定し、その環境変数にパスフレーズを設定してください。

Step 5: SSH 公開鍵を XServer に登録 [要ユーザー操作]

この操作は XServer サーバーパネルで手動で行う必要があります。

  1. 公開鍵の内容を確認:

    cat ~/.ssh/xserver_<サーバーID>.pub
  2. XServer サーバーパネルにログイン

  3. 「SSH設定」 を開く

  4. SSH 設定が 「ON」 になっていることを確認(OFF なら ON に変更)

  5. 「公開鍵登録・更新」 タブを開く

  6. 上記の公開鍵の内容を全文貼り付けて 「確認画面へ進む」「登録する」

Step 6: 接続テスト

ssh -p 10022 -i ~/.ssh/xserver_<サーバーID> <サーバーID>@<サーバーID>.xsrv.jp 'pwd'

Step 7: doctor で最終確認

node src/cli.js doctor

すべて [PASS] になればセットアップ完了です。

トラブルシューティング

doctor の出力

原因

対処

[FAIL] Config loaded

設定ファイルが見つからないか JSON が不正

~/.config/xserver-files-mcp/config.json の存在と JSON 構文を確認

[FAIL] SSH key exists

秘密鍵ファイルが見つからない

Step 4 の鍵作成を確認。パスが設定ファイルの privateKeyPath と一致しているか確認

[FAIL] SFTP connection

SSH 接続に失敗

Step 5 の公開鍵登録を確認。ssh -p 10022 ... で手動テスト

Related MCP server: mcp_shell_tools

MCP 登録

Claude Code でこのリポジトリを開くと .mcp.json により自動登録されます。

他の MCP クライアント(Claude Desktop、VS Code など)では、設定に以下を追加:

{
  "mcpServers": {
    "xserver-files": {
      "command": "node",
      "args": ["/絶対パス/xserver-files-mcp/src/server.js"],
      "env": {
        "XSERVER_FILES_CONFIG": "/ホームディレクトリ/.config/xserver-files-mcp/config.json"
      }
    }
  }
}

パスは自分のマシンの絶対パスに置き換えてください。

CLI の使い方

node src/cli.js <command> [options]

診断

コマンド

説明

doctor

設定ファイル、SSH 鍵、SFTP 接続をチェック

servers

設定済みサーバー一覧を表示(接続不要)

roots

設定済みドメインルート一覧を表示

--version

バージョンを表示

ファイル操作

コマンド

説明

ls <domain> [path]

リモートファイル一覧

read <domain> <path>

リモートの UTF-8 テキストファイルを読み取り

write <domain> <path> --from <file>

リモートにファイルを書き込み(既存ファイルは自動バックアップ)

replace <domain> <path> --find <text> --replace <text>

テキストの完全一致置換(自動バックアップ)

backup <domain> <path>

タイムスタンプ付きリモートバックアップを作成

backups <domain> <path>

ファイルのリモートバックアップ一覧

cleanup-backups <domain> <path> [--keep N]

古いバックアップを削除し、最新 N 件を保持(デフォルト 5)

ワークスペース操作

コマンド

説明

workspace <domain>

ドメイン用のローカルワークスペースを作成

pull <domain> <path>

リモートファイルをローカルワークスペースに取得

push <domain> <path>

ローカルワークスペースのファイルをサーバーに送信(自動バックアップ)

pull/push は wp-config.php、uploads、logs、backups、データベースダンプ、アーカイブをデフォルトで拒否します。--allow-sensitive はリスクを確認してから使用してください。

リダイレクト

node src/cli.js redirect old-site.example.com https://new-site.example.com --dry-run
node src/cli.js redirect old-site.example.com https://new-site.example.com

.htaccess にマーク付き 301 リダイレクトブロックを挿入・更新します:

# BEGIN xserver-files-mcp redirect old-site.example.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-site\.example\.com$ [NC]
RewriteRule ^(.*)$ https://new-site.example.com/$1 [R=301,L]
</IfModule>
# END xserver-files-mcp redirect old-site.example.com

共通オプション

すべての書き込みコマンドは --dry-run で変更をプレビューできます。--no-backup で自動バックアップをスキップ。--server <id> でデフォルト以外のサーバーを指定。

MCP ツール一覧

ツール

説明

list_servers

設定済みサーバー一覧

list_roots

プロファイルのドメインルート一覧

init_site_workspace

ドメイン用のローカルワークスペースを作成

list_files

リモートファイル一覧

read_file

UTF-8 テキストファイルを読み取り

pull_file_to_workspace

リモートファイルをローカルワークスペースに取得

push_file_from_workspace

ローカルワークスペースのファイルをリモートに送信

backup_file

リモートファイルのタイムスタンプ付きバックアップを作成

write_file

UTF-8 ファイルを書き込み(既存ファイルは自動バックアップ)

replace_in_file

テキストの完全一致置換(自動バックアップ)

set_domain_redirect

.htaccess にマーク付き 301 リダイレクトブロックを挿入・更新

複数サーバー

設定ファイルの servers にエントリを追加。MCP では server_id、CLI では --server で指定:

node src/cli.js --server sv67890 roots

省略時は defaultServer が使われます。

安全性について

  • すべてのパスは設定済みの roots[domain] 配下で解決されます。絶対パスと .. によるトラバーサルは拒否されます。

  • 書き込み操作は既存ファイルをデフォルトで自動バックアップします。

  • pull/push はリスクの高いパスをデフォルトで除外します: wp-config.php、uploads、logs、backups、SQL ダンプ、アーカイブ。

  • replaceInFileset_domain_redirect は読み取り・変換・書き込みを別々の SFTP 操作で行います。他のプロセスが同時に同じファイルを編集すると上書きされる可能性があります。

  • 書き込み前に必ず --dry-run で変更をプレビューしてください。

  • 秘密鍵はこのプロジェクトディレクトリの外に保管してください。

エージェント向け情報

このリポジトリは公開配布向けに、エージェント手順の正本を skills/ に置いています。

  • リポジトリ運用ルール: AGENTS.md

  • 初期セットアップスキル: skills/xserver-files-setup/SKILL.md

  • SFTP ファイル操作スキル: skills/xserver-files-operator/SKILL.md

  • XServer パネル API スキル: skills/xserver-mcp-operator/SKILL.md

互換性のため、同じスキルを以下の project-local view からも参照できます:

  • .claude/skills/

  • .agents/skills/

  • .gemini/skills/

  • .cursor/skills/

  • .grok/skills/

  • .antigravity/skills/

Cursor 向けには .cursor/rules/xserver-files.mdc も同梱しています。CLAUDE.mdGEMINI.mdGROK.mdANTIGRAVITY.mdAGENTS.mdskills/ への薄い入口です。

GitHub から clone した場合は上記 view が symlink として含まれます。npm tarball では symlink view は含めず、skills/ の正本と .agent-support/ の再生成スクリプトを配布します。

agent view を再生成・検証するには:

npm run agent:install
npm run validate:agent-support

symlink が使えない環境では copy view を生成できます:

npm run agent:install -- --copy --force

Available Tools

13 tools
add_rootAdd domain root to configA

Register a new domain root for a server profile. Infers the remote path from the server username if not specified, verifies the directory exists via SFTP, and saves to the config file.

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNoAbsolute remote path. Defaults to /home/{username}/{domain}/public_html.
domainYesDomain name to add, e.g. saiyoken.jp.
dry_runNoVerify without saving to config.
server_idNoServer profile id. Defaults to config.defaultServer.

TDQS

A4.2/5.0
Behavior4/5

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

Annotations indicate it is a write operation (readOnlyHint false) but not destructive (destructiveHint false). The description adds key behaviors beyond annotations: it infers the remote path from the server username if not specified, verifies the directory exists via SFTP, and saves to the config file. This gives the agent insight into side effects and failure modes.

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

Conciseness5/5

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

The description is a single sentence that packs all essential information—purpose, behavioral details, and default behavior—without fluff. Every phrase adds value, making it concise and well-structured.

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

Completeness4/5

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

Given the tool has a relative simple role, the description covers the main operation, default behavior, verification step, and persistence. It does not mention error cases or interaction with existing entries, but the rich schema and annotations reduce the need for exhaustive detail. The description is complete enough for an agent to invoke correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds minimal extra meaning for parameters—it mentions the inference of the remote path (relevant to 'root') and verification via SFTP, which enriches the schema but does not significantly change understanding of parameters like 'domain', 'dry_run', or 'server_id'.

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 uses a specific verb 'Register' with a clear resource ('a new domain root') and context ('for a server profile'). It clearly distinguishes itself from sibling tools like list_roots and discover_roots by focusing on the add operation.

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

Usage Guidelines4/5

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

The description provides clear context: it is for registering a new domain root and verifies the directory existence, implying it is for adding rather than listing or discovering. It does not explicitly name alternatives or exclusions, but the context is sufficient for an agent to infer appropriate use.

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

backup_fileBackup remote fileA

Create a timestamped dotfile backup next to a remote file.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the configured domain root.
labelNoBackup label used in the generated filename.
domainYesConfigured domain root to operate under.
server_idNoServer profile id. Defaults to config.defaultServer.

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the agent knows this is a write operation that is safe. The description adds that the backup is timestamped and located next to the original file, which is useful behavioral context. However, it does not mention edge cases such as file existence or overwrite behavior.

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

Conciseness5/5

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

The description is a single sentence that starts with the action verb and conveys the essential information without waste. It is appropriately sized for the tool's simplicity.

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

Completeness4/5

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

For a simple two-required-parameter tool with full schema coverage, the description is adequate. It lacks an explicit mention of return values, but no output schema exists, and the behavior is clear enough to invoke the tool correctly.

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

Parameters3/5

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

Schema descriptions cover all 4 parameters, so the baseline is 3. The tool description does not add any parameter-specific details beyond what the schema already provides.

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 uses the specific verb 'create' and identifies the resource as a 'timestamped dotfile backup' with location 'next to a remote file.' This clearly distinguishes it from sibling read/write/push/pull tools.

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

Usage Guidelines3/5

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

The description explains what the tool does but does not explicitly state when to use it or when to prefer alternatives. The context is clear (backup creation), but no exclusions or alternative tool references are provided, so it falls short of explicit guidance.

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

discover_rootsDiscover domain roots on serverA
Read-only

Scan the server home directory for domains with public_html and show which ones are not yet configured. Use add_root to register any you want to manage.

ParametersJSON Schema
NameRequiredDescriptionDefault
server_idNoServer profile id. Defaults to config.defaultServer.

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false; description reinforces with 'scan' and 'show' and adds context about what is inspected (home directory, public_html presence). No contradiction and useful detail about the discovery criteria. Simple read-only tool needs little more.

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

Conciseness5/5

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

Two sentences, front-loaded with action and output, then a clear follow-up pointer. No filler or repetition of schema/annotations.

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 one optional parameter, readOnly annotations, and no output schema, the description fully conveys the tool's input, action, and result. It also directs the agent to a sibling tool for the next action. No significant gaps.

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

Parameters3/5

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

Input schema covers the single optional server_id parameter with a description and default behavior, so schema coverage is 100%. Description does not add parameter-level details, but baseline 3 is appropriate since the schema carries the meaning.

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?

Specific verb 'scan' with explicit resource (server home directory, domains with public_html). It contrasts with list_roots by focusing on unconfigured domains, and references add_root as the next step. Clear differentiation from siblings.

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

Usage Guidelines4/5

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

Provides clear context: use to find domains on the server that have public_html but are not yet configured. Recommends add_root for managing discovered domains. Does not explicitly contrast with list_roots or other alternatives, but the context is strong enough.

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

init_site_workspaceInitialize local site workspaceA

Create the local workspace directory for a configured domain outside this repository and add a protective .gitignore.

ParametersJSON Schema
NameRequiredDescriptionDefault
domainYesConfigured domain root to operate under.
dry_runNoReturn paths without creating directories.
server_idNoServer profile id. Defaults to config.defaultServer.
workspace_rootNoLocal workspace root. Defaults to config.localWorkspaceRoot or ~/Dev/xserver-sites.

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description adds that it creates a directory and adds a .gitignore outside the repo. This clarifies the non-destructive write nature without contradicting annotations.

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

Conciseness5/5

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

The description is a single, front-loaded sentence that conveys the verb, resource, scope, and side effect with zero waste.

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

Completeness4/5

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

The tool is a straightforward initializer; the schema covers all parameters, and the description covers purpose and main side effects. Lacks edge-case behavior (e.g., existing directory) but is adequate given the simplicity and no output schema.

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

Parameters3/5

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

Schema coverage is 100% with detailed parameter descriptions, so the description doesn't need to explain parameters. It adds no additional semantic value beyond the schema, earning the baseline 3.

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 uses a specific verb 'Create' with a clear resource: 'local workspace directory' and '.gitignore', scoped to a configured domain outside this repository. This clearly distinguishes it from sibling tools like add_root or file operations.

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

Usage Guidelines4/5

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

Provides clear context: the tool operates on a configured domain and outside this repository, implying a setup step before file tools. It does not explicitly name alternatives or exclusions, so it misses a top score.

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

list_filesList remote filesA
Read-only

List files under a configured domain root over SFTP.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoPath relative to the configured domain root..
domainYesConfigured domain root to operate under.
server_idNoServer profile id. Defaults to config.defaultServer.

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare the operation as read-only and non-destructive, so the safety bar is lower. The description adds some context about the scope ('configured domain root') and transport ('SFTP'), but does not disclose additional behavioral traits such as recursiveness or return format.

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

Conciseness5/5

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

The description is a single efficient sentence with no filler. Every word contributes to the core meaning, and it is front-loaded with the primary action.

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

Completeness4/5

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

For a simple list tool with full schema coverage and read-only annotations, the description is mostly complete. However, it does not clarify whether listing is recursive, what metadata is returned, or how the path parameter behaves by default, though the schema covers the default. The lack of output schema means a small gap in expected return behavior.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description does not add any meaning beyond the schema; it only reinforces the domain parameter concept without explaining the other parameters or their interactions.

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 uses a specific verb ('List') and resource ('files') with the scoping context ('under a configured domain root over SFTP'). This clearly distinguishes it from siblings like read_file (reads a specific file), list_roots (lists roots), and list_servers (lists server profiles).

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, no explicit exclusion scenarios, and no mention of when not to use it. It simply states the function without additional usage context.

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

list_rootsList domain rootsA
Read-only

List configured domain roots for a server profile.

ParametersJSON Schema
NameRequiredDescriptionDefault
server_idNoServer profile id. Defaults to config.defaultServer.

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds the 'configured' and 'server profile' scoping, but does not disclose return format, ordering, or potential empty results. This is adequate but minimal beyond annotations.

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

Conciseness5/5

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

The description is a single clear sentence with no filler. It immediately states the action and scope, earning its place efficiently.

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

Completeness4/5

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

For a simple list operation with one optional parameter and good annotation coverage, the description is mostly complete. It could be slightly richer in explaining what 'roots' are or what a successful response contains, but the title and context fill most gaps.

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

Parameters3/5

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

Schema coverage is 100% for the single parameter 'server_id', and the description repeats the role of a server profile without adding extra meaning. Baseline 3 applies because the schema already documents the parameter.

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 uses a specific verb ('List') and resource ('configured domain roots') with a clear scope ('for a server profile'). It distinguishes from the sibling tool 'discover_roots' by emphasizing 'configured' roots rather than discovery or scanning.

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?

No explicit guidance is provided about when to use this tool versus alternatives like 'discover_roots' or 'add_root'. The context implies list operations but does not state exclusions or alternative conditions.

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

list_serversList configured XServer profilesA
Read-only

List configured XServer connection profiles and domain roots without connecting to SFTP.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds the behavioral detail that it does not connect to SFTP, clarifying that it is a purely local, non-network operation, which goes beyond the annotations.

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

Conciseness5/5

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

The description is a single, front-loaded sentence that conveys the action, object, and key qualifier without any unnecessary words or redundancy.

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?

For a zero-parameter, read-only listing tool, the description is fully sufficient. It states what is listed, the scope (configured profiles), and the key behavioral nuance (no SFTP connection). The lack of an output schema is not an issue since the purpose is clear.

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 tool has zero parameters, and the input schema is an empty object. The description does not need to explain parameters, and the baseline of 4 applies. No additional parameter information is required.

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 lists configured XServer connection profiles and domain roots, with the specific qualifier 'without connecting to SFTP.' This distinguishes it from sibling tools like list_roots or discover_roots, which might involve network connections.

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

Usage Guidelines3/5

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

The description implies usage for safely listing local configuration without network access, but it gives no explicit guidance on when to prefer this over alternatives like list_roots or discover_roots. It does not mention exclusions or preferred scenarios.

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

pull_file_to_workspacePull remote file to local workspaceA

Read one remote UTF-8 file and write it under the matching local site workspace path. Existing local files are backed up by default.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the configured domain root.
domainYesConfigured domain root to operate under.
dry_runNoReturn what would happen without reading or writing.
server_idNoServer profile id. Defaults to config.defaultServer.
local_backupNoBack up an existing local file before overwriting it.
workspace_rootNoLocal workspace root. Defaults to config.localWorkspaceRoot or ~/Dev/xserver-sites.
allow_sensitiveNoAllow default-excluded paths such as wp-config.php, uploads, logs, backups, and dumps.

TDQS

A3.9/5.0
Behavior4/5

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

Annotations indicate this is not read-only and not destructive. The description adds valuable context by noting that 'Existing local files are backed up by default,' which clarifies the non-destructive behavior and the default backup mechanism. It also specifies the UTF-8 encoding, providing additional behavioral detail beyond the annotations.

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

Conciseness5/5

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

The description is a single, concise sentence that front-loads the core functionality and includes the key backup behavior. There is no redundant or extraneous information.

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?

With 7 parameters and no output schema, the description covers the primary purpose and a key behavior (backups), but it does not mention return values, error handling, or prerequisites like server connectivity. It is adequate for a straightforward file operation but lacks detail for a complex tool with many configuration options.

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

Parameters3/5

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

Schema description coverage is 100%, so the parameters are already well-documented in the schema. The description mentions 'backed up by default,' which aligns with the local_backup parameter, but does not add new parameter meaning beyond what the schema provides. Baseline of 3 is appropriate.

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 action: 'Read one remote UTF-8 file and write it under the matching local site workspace path.' This specifies the verb, resource, and destination, and distinguishes it from siblings like push_file_from_workspace (which does the reverse) and read_file (which only reads without writing).

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

Usage Guidelines3/5

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

The description implies this tool is used for copying a remote file into the local workspace, but it does not explicitly state when to choose this over alternatives or when not to use it. Sibling tools like read_file or backup_file could overlap, but the description gives no direct comparison or exclusion guidance.

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

push_file_from_workspacePush local workspace fileA
Destructive

Read one local workspace file and write it to the matching remote path. Existing remote files are backed up by default.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the configured domain root.
backupNoBack up existing remote file before writing.
domainYesConfigured domain root to operate under.
dry_runNoReturn what would happen without writing.
server_idNoServer profile id. Defaults to config.defaultServer.
backup_labelNoBackup label used in the generated filename.
workspace_rootNoLocal workspace root. Defaults to config.localWorkspaceRoot or ~/Dev/xserver-sites.
allow_sensitiveNoAllow default-excluded paths such as wp-config.php, uploads, logs, backups, and dumps.

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already mark the tool as destructive and not read-only. The description adds a valuable safety behavior: existing remote files are backed up by default. It does not mention sensitive-path exclusions or dry-run, but those are covered in the parameter schema, so the description adds appropriate context beyond annotations.

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

Conciseness5/5

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

The description is two concise sentences that front-load the core action and include a key behavioral detail. Every word earns its place, with no redundancy.

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 (8 parameters, no output schema), the description only covers the basic operation and backup default. While the schema explains parameters, the description lacks broader deployment context (e.g., typical use cases, behavior when duplicate paths exist, or interaction with domain roots) that would help an agent understand when to invoke it.

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

Parameters3/5

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

Schema description coverage is 100%, and each parameter already has a clear description. The description clarifies the overall flow (local to remote) but does not add meaning beyond the schema, fitting the baseline for high schema coverage.

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 states the specific action: reading a local workspace file and writing it to the matching remote path. This clearly distinguishes it from reverse operations like pull_file_to_workspace and direct write tools like write_file.

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?

No guidance is provided on when to use this tool vs alternatives. It does not mention deployment workflows, nor does it indicate when to avoid it (e.g., for creating new files or inline edits). The sibling tools suggest related operations, but no comparative context is given.

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

read_fileRead remote fileB
Read-only

Read a UTF-8 text file under a configured domain root over SFTP.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the configured domain root.
domainYesConfigured domain root to operate under.
server_idNoServer profile id. Defaults to config.defaultServer.

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds minor context (UTF-8 encoding, SFTP protocol, configured domain root) but does not disclose behavior like error handling, size limits, or authentication requirements. This meets the baseline with annotations but adds limited extra value.

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

Conciseness5/5

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

The description is a single, front-loaded sentence that conveys the essential purpose without any wasted words. It is concise and well-structured.

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

Completeness4/5

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

Given the tool's simplicity, the schema fully documents parameters, and annotations cover safety, the description is largely complete. It could optionally mention the return value format, but this is not essential for a simple read operation. Sibling differentiation is missing, which prevents a 5.

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

Parameters3/5

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

Schema description coverage is 100%, with all parameters described (domain, path, server_id). The description does not add additional meaning beyond the schema, so a baseline score of 3 is appropriate.

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 verb 'Read' and the resource ('a UTF-8 text file under a configured domain root over SFTP'). However, it does not explicitly differentiate from the sibling tool pull_file_to_workspace, which also involves reading remote files, so it falls short of a 5.

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 gives no explicit guidance on when to use this tool versus alternatives (e.g., pull_file_to_workspace or list_files). It implies usage for reading file content, but there is no stated context, exclusions, or alternative recommendations.

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

replace_in_fileReplace text in remote fileA
Destructive

Read a file, replace all exact text matches, and write it back with backup by default.

ParametersJSON Schema
NameRequiredDescriptionDefault
findYesExact text to replace.
pathYesFile path relative to the configured domain root.
backupNoBack up existing file before writing.
domainYesConfigured domain root to operate under.
dry_runNoReturn preview without writing.
replaceNoReplacement text.
server_idNoServer profile id. Defaults to config.defaultServer.
backup_labelNoBackup label used in the generated filename.

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already indicate destructive behavior (destructiveHint=true). The description adds context by noting that replacements are exact text matches and that a backup is created by default, which goes beyond the annotation's binary safety signal.

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

Conciseness5/5

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

A single sentence that is front-loaded with the core operation and includes the key default behavior. Every word earns its place with no redundancy.

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

Completeness4/5

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

Given the 8-parameter schema with 100% coverage and destructive annotations, the description adequately captures the overall workflow. It does not mention return values, but no output schema exists, and the process is clear enough for an agent to invoke correctly.

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 schema covers all 8 parameters with descriptions, so the baseline is 3. The description adds slight value by clarifying that 'find' replaces ALL exact matches and that backup is default, reinforcing parameter semantics beyond the 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 action: read a file, replace all exact text matches, and write it back with backup by default. This specific verb+resource+behavior distinguishes it from siblings like read_file, write_file, and backup_file.

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

Usage Guidelines3/5

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

The description implies usage for find-and-replace operations but does not explicitly state when to prefer this tool over a combination of read_file and write_file, nor does it mention exclusions or alternatives. No sibling tools are named.

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

set_domain_redirectSet domain redirectA
Destructive

Insert or update a marked .htaccess 301 redirect block for a configured source domain. Creates a backup by default.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoRelative .htaccess path under the source domain root..htaccess
backupNoBack up existing .htaccess before writing.
createNoCreate .htaccess if it does not exist.
domainYesSource domain to redirect, such as old-site.example.com.
to_urlYesDestination URL, such as https://new-site.example.com.
dry_runNoReturn resulting content without writing.
server_idNoServer profile id. Defaults to config.defaultServer.
preserve_pathNoAppend the original request path to the destination.

TDQS

A4/5.0
Behavior4/5

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

The description adds meaningful behavior beyond annotations: it states that a backup is created by default, which is important for a destructive operation (destructiveHint=true). It also mentions 'marked' blocks, implying a tracked/replaceable pattern. This supplements the annotation with useful operational detail without contradicting it.

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

Conciseness5/5

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

The description is two sentences long and front-loads the core action and backup behavior. Every word adds value; there is no filler or repetition. It is appropriately sized for the tool's complexity.

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

Completeness4/5

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

Given the tool's complexity (8 parameters, 2 required) and lack of an output schema, the description provides enough context to understand the tool's core behavior. It does not mention return values, but the absence of an output schema lowers the expectation. The description covers the essential purpose and side effects, though it could mention the 'dry_run' capability or effect on existing redirects for full completeness.

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

Parameters3/5

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

Schema coverage is 100% with each parameter having a descriptive explanation. The description itself does not add semantic detail beyond saying 'creates a backup by default' which aligns with the backup parameter. Since the schema already documents all parameters thoroughly, this dimension meets the baseline but does not exceed it.

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 function: 'Insert or update a marked .htaccess 301 redirect block for a configured source domain.' It specifies a concrete verb (insert/update), a resource (.htaccess redirect block), and a clear scope (for a configured source domain). It is distinct from sibling tools like write_file or replace_in_file by focusing specifically on redirect management.

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

Usage Guidelines3/5

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

The description implies usage for setting up 301 redirects via .htaccess, which is a clear context. However, it does not explicitly mention when to prefer this tool over alternatives like write_file or replace_in_file, nor does it provide exclusion criteria. The guidance is implied but not explicit.

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

write_fileWrite remote fileA
Destructive

Write a UTF-8 text file under a configured domain root. Existing files are backed up by default.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the configured domain root.
backupNoBack up existing file before writing.
domainYesConfigured domain root to operate under.
contentYesUTF-8 text content to write.
dry_runNoReturn what would happen without writing.
server_idNoServer profile id. Defaults to config.defaultServer.
backup_labelNoBackup label used in the generated filename.

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already mark the tool as destructive. The description adds useful context by noting that existing files are backed up by default, which goes beyond the bare annotations. No contradiction found.

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

Conciseness5/5

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

Two concise sentences with front-loaded purpose and a key behavioral note. Every word earns its place with no redundancy or filler.

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 has 7 parameters and no output schema, the description is adequate but lacks details about return values or failure behavior. The schema covers the parameters, but the description doesn't add broader operational context such as dry-run semantics or how backups are labeled.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters are fully documented. The description's mention of UTF-8 and backup default restates schema information but adds no new parameter-level meaning, so it meets the baseline for high coverage.

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 action: 'Write a UTF-8 text file under a configured domain root.' It specifies the resource and verb, but does not explicitly differentiate from sibling tools like replace_in_file or push_file_from_workspace, though the scope is clear.

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

Usage Guidelines3/5

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

Usage is implied: use when you need to write a UTF-8 text file within a configured domain root. However, there are no explicit exclusions or references to alternatives, so the guidance is minimal.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 13 tool updatesv0.1.0
    • First observedadd_root
    • First observedbackup_file
    • First observeddiscover_roots
    • First observedinit_site_workspace
    • First observedlist_files
    • First observedlist_roots
    • First observedlist_servers
    • First observedpull_file_to_workspace
    • First observedpush_file_from_workspace
    • First observedread_file
    • First observedreplace_in_file
    • First observedset_domain_redirect
    • First observedwrite_file

TDQS

A3.8/5.0
Disambiguation4/5

Most tools have clear distinct purposes (listing, reading, writing, backing up, configuring). However, pull_file_to_workspace overlaps with read_file (both read remote content) and push_file_from_workspace overlaps with write_file (both write remote), which could cause misselection without careful descriptions.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (e.g., list_files, read_file, write_file, set_domain_redirect). Even the longer names like pull_file_to_workspace and push_file_from_workspace maintain the pattern with clear prepositions, so the naming convention is uniform.

Tool Count5/5

13 tools is well-scoped for a file management server covering configuration, file operations, backups, and workspace sync. Each tool addresses a specific need without unnecessary bloat, making the count appropriate for the domain.

Completeness2/5

The tool surface covers core file operations (create, read, update) and backups, but notably lacks a delete tool and directory management (mkdir/move/copy). This is a significant gap for a file management server, as agents cannot complete full file lifecycle workflows.

Maintenance

ActivityStale
ResponsivenessNo issues

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

Related MCP Servers

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/mocchalera/xserver-files-mcp'

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