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つの確認:標準出力を汚さない、ログは標準エラーへ、設定に秘密を残さない、公開前のフォルダの検査。
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・起動時の表示・進捗の行が混ざると、接続が壊れます。ログはすべて標準エラーへ。
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
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}" } } } }
In .gitignore and, if you ship an image, in .dockerignore..gitignore に。イメージを配るなら .dockerignore にも。
.env
.env.*
.claude/settings.local.json
*.pem
A description is read by the model as text. Do not put instructions to the model, credentials or internal addresses in it.説明は、モデルが文章として読みます。モデルへの指示・認証情報・内部のアドレスを書かないこと。
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.報告だけのサーバーは、信頼もレビューもしやすくなります。何かを変える道具は、その名前と説明に、変えることを書きます。
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 .
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、ライブラリの起動表示、警告など。標準エラーへ移します。
From the environment at start, set by the user's own configuration. The repository carries a placeholder, never the value.起動時の環境変数から。値は利用者自身の設定で渡します。リポジトリに置くのは仮の値で、本物は置きません。
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 は止めません。
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)の補助を使って書いています。数字は、ページに記したとおりの実測値か計算値です。コマンドは例です。実行の前に読み、自分のリポジトリに合わせて直してください。商品のリンク先は、当方の有料のキットです。