ZEUS LAB
GUIDE

Before you publish an MCP server: a checklist for stdio and for secretsMCPサーバーを公開する前に:stdio と秘密情報のチェックリスト

Seven checks for a local MCP server on the stdio transport: clean standard output, logs on standard error, no secrets in committed configuration, and a folder scan before release.stdio で動く手元のMCPサーバーの7つの確認:標準出力を汚さない、ログは標準エラーへ、設定に秘密を残さない、公開前のフォルダの検査。

1. Standard output carries protocol messages only1. 標準出力には、プロトコルのメッセージだけ

On the stdio transport the client reads JSON-RPC messages from the server's standard output, one per line. A stray print, a banner or a progress line breaks the session. Send every log line to standard error.stdio では、クライアントはサーバーの標準出力から JSON-RPC のメッセージを1行ずつ読みます。余計な print・起動時の表示・進捗の行が混ざると、接続が壊れます。ログはすべて標準エラーへ。

2. Try the handshake by hand2. 最初の握手を手で試す

The first thing on standard output should be one JSON-RPC response to the initialize request: the same id, and a result. Anything else before it is a bug. This is a quick look, not a conformance test; the protocol version in the example is one published version, so use the one your server supports.標準出力の最初に出るのは、initialize への JSON-RPC の応答1つ(同じ id と result)であるはずです。その前に別のものが出たら、不具合です。これは手早い確認で、適合性の試験ではありません。例のプロトコルの版は公開されている版の1つなので、自分のサーバーが対応する版に替えてください。

printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"check","version":"0"}}}' \
  | python3 your_server.py 2>/dev/null | head -c 400

3. No secrets in committed configuration3. commit される設定に、秘密を書かない

Keep keys out of .mcp.json and out of example configurations: read them inside the server from its environment, and commit a placeholder. Whether a ${VAR} placeholder in a client's configuration file is expanded depends on the client, so check yours. In our count of 100 public AI and MCP repositories, 7 had a .mcp.json at the root; we did not read their contents.鍵は .mcp.json にも設定の見本にも書かず、サーバーの中で環境変数から読み、commit するのは仮の値にします。設定ファイルの ${VAR} が展開されるかどうかはクライアントしだいなので、使うクライアントで確かめてください。公開AI・MCPリポジトリ100件の集計では、直下に .mcp.json があったのは7件でした(中身は読んでいません)。

{ "mcpServers": { "example": { "command": "python3", "args": ["server.py"], "env": { "API_TOKEN": "${API_TOKEN}" } } } }

4. Ignore what stays local4. 手元に残すものは除外する

In .gitignore and, if you ship an image, in .dockerignore..gitignore に。イメージを配るなら .dockerignore にも。

.env
.env.*
.claude/settings.local.json
*.pem

5. Tool descriptions say what the tool does, nothing else5. 道具の説明には、道具がすることだけを書く

A description is read by the model as text. Do not put instructions to the model, credentials or internal addresses in it.説明は、モデルが文章として読みます。モデルへの指示・認証情報・内部のアドレスを書かないこと。

6. Default to reading, make writing explicit6. 既定は読み取り。書き込みは明示する

A server that only reports is easier to trust and to review. If a tool changes something, name that in the tool's name and description.報告だけのサーバーは、信頼もレビューもしやすくなります。何かを変える道具は、その名前と説明に、変えることを書きます。

7. Scan the folder you are about to publish7. 公開するフォルダを検査する

The free command lists supported leak patterns in a folder's text files, with the values masked. None found is not proof that nothing is there.無料のコマンドが、フォルダのテキストファイルにある対応済みの型を、値を伏せて一覧にします。検出なしは、何も無いことの証明ではありません。

python3 zero_trace_lite.py .

Questionsよくある質問

Why does my MCP server connect and then fail at once?MCPサーバーが、つながった直後に失敗するのはなぜですか。

A common cause on stdio is something other than a protocol message on standard output: a print for debugging, a library banner, a warning. Move it to standard error.stdio でよくある原因は、標準出力にプロトコル以外のものが出ていることです。確認用の print、ライブラリの起動表示、警告など。標準エラーへ移します。

Where should an MCP server read its API key from?MCPサーバーは、APIキーをどこから読むべきですか。

From the environment at start, set by the user's own configuration. The repository carries a placeholder, never the value.起動時の環境変数から。値は利用者自身の設定で渡します。リポジトリに置くのは仮の値で、本物は置きません。

Is there a free check I can run before publishing?公開の前に走らせられる無料の検査はありますか。

zero-trace-lite is an MIT-licensed command and local MCP server that reports supported leak patterns in a folder. It reports only; it does not stop a commit.zero-trace-lite は MIT の公開ソースで、フォルダ内の対応済みの型を報告するコマンドと手元のMCPサーバーです。報告だけで、commit は止めません。

Next次に

zero-trace-lite (MIT)zero-trace-lite(MIT) →Sovereign Bundle — $199Sovereign Bundle — $199 →All guidesガイド一覧

Written with AI assistance (Claude). The figures are measured or computed as named on the page. The commands are examples: read them and adapt them to your repository before running. Product links lead to our own paid kits.AI(Claude)の補助を使って書いています。数字は、ページに記したとおりの実測値か計算値です。コマンドは例です。実行の前に読み、自分のリポジトリに合わせて直してください。商品のリンク先は、当方の有料のキットです。

ZEUS LAB is an independent software verification and development studio. It is not affiliated with any payment processing company of a similar name, or with any other company or service.※ZEUS LAB は独立したソフトウェア検証・開発スタジオであり、同名の決済代行会社および他社サービスとは一切関係ありません。