junos-mcp: Instructions file for Claude Code

CLAUDE.md

junos-mcp CLAUDE.md is an instructions file for Claude Code from shigechika/junos-mcp. It costs 4,443 tokens per session, scanned A, original, Apache-2.0.

Project instructions for junos-mcp, an MCP server that exposes Juniper network-device operations to AI assistants. They describe the Python codebase, its modules, supported connection methods, dependencies, and tests.

In plain words
What is it for?
Use them when asking Claude Code to work on the shigechika/junos-mcp repository. They are useful for navigating the file structure and checking changes with the project’s stated tests and tools.
Why use it?
They provide the background an AI coding assistant needs to understand the repository before editing it. This reduces confusion about which files handle connections, server tools, packaging, and validation.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is shigechika/junos-mcp's own configuration. It tells Claude Code how to work on junos-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything junos-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shigechika/junos-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shigechika/junos-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/shigechika/junos-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for junos-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shigechika/junos-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/shigechika/junos-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/shigechika/junos-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shigechika/junos-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for junos-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/shigechika/junos-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shigechika/junos-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,443 This file is loaded in full into every session.
When invoked 4,443 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.04443 $0.04443
Opus 5.5 $0.01777 $0.01777
Sonnet 5.5 $0.00889 $0.00889
Haiku 4.5 $0.00444 $0.00444

Measured 18d ago against content hash 2c223c41ff21, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

junos-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 18d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

このファイルはClaude Codeがリポジトリを理解するためのコンテキストを提供します。

プロジェクト概要

junos-mcpは、junos-ops の機能を MCP (Model Context Protocol) サーバーとして公開するパッケージです。Claude Desktop、Claude Code などの MCP 対応 AI アシスタントから Juniper Networks デバイスの操作が可能になります。

  • junos-ops: CLI ツール + ライブラリ(人間が直接使う)
  • junos-mcp: junos-ops を MCP サーバーとして公開(AI アシスタントが使う)

技術スタック

  • 言語: Python 3(3.12以上)
  • 主要ライブラリ: MCP Python SDK(MCPServer)、junos-ops(junos-eznc)
  • トランスポート: STDIO(デフォルト)または Streamable HTTP(--transport で選択、JSON-RPC)
  • パッケージ管理: pyproject.toml(pip installable)
  • テスト: pytest + モック
  • ライセンス: Apache License 2.0

ファイル構成

junos_mcp/
├── __init__.py         # パッケージ定義、__version__
├── __main__.py         # python -m junos_mcp 対応
├── pool.py             # per-host NETCONF 接続プール(ConnectionPool、get_pool)
└── server.py           # MCPServer サーバー定義、28ツール実装
tests/
├── __init__.py
├── test_pool.py                # 27 ユニットテスト(ConnectionPool)
├── test_server.py              # 128 ユニットテスト
└── test_version_consistency.py # 2 ユニットテスト(バージョン整合性)
pyproject.toml          # パッケージメタデータ、依存関係
LICENSE                 # Apache License 2.0
README.md               # 英語版
README.ja.md            # 日本語版

モジュール構成

pool.py — 接続プール

  • ConnectionPool — per-host NETCONF 接続プール。acquire(hostname, config_path) context manager で checkout/checkin。per-host threading.Lock を操作全体で保持し PyEZ Device のスレッドセーフ問題を回避。アイドルタイムアウト超過・dev.connected==False で自動退場・再接続。
  • PoolConnectionError — 接続失敗時に acquire() が raise する例外。
  • PoolBusyError — acquire(timeout=...) で per-host lock が時間内に空かなかったときに raise する例外。_connect_and_run は push 以外の呼び出しで、JUNOS_DEADLINE の残りを timeout に渡し「host busy」を返す(push の確認と lock 取得の間に push が lock を取っても無期限に待たない)
  • get_pool() — モジュールレベルシングルトンを lazy init して返す。JUNOS_MCP_POOL=0 で None を返す(プール無効)。
  • 環境変数: JUNOS_MCP_POOL(無効化)・JUNOS_MCP_POOL_IDLE(アイドルタイムアウト秒、デフォルト 60)・JUNOS_MCP_POOL_CONNECT_ATTEMPTS(一過性接続失敗のリトライ回数、デフォルト 2=1 回リトライ)・JUNOS_MCP_POOL_CONNECT_DELAY(リトライ間隔秒、デフォルト 1.0)
  • 接続リトライの不変条件(PR #37): リトライ対象は _RETRYABLE_CONNECT_ERRORS(ConnectError / ConnectTimeoutError のみ)に限定。ConnectAuthError(認証失敗)は意図的に除外 — 誤った資格情報でリトライするとアカウントロックの恐れがあるため即座に fail-fast する。リトライの sleep は per-host entry.lock を保持したまま実行する(設計どおり — 同一ホストの呼び出しのみをブロックし他ホストは妨げない)

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 18d ago Changed · +3 lines · +776 tokens per session 2c223c41ff21
  2. 1mo ago Changed · -1 tokens per session 49a7939d6066
  3. 2mo ago First seen · 177 lines · 3,668 tokens per session scan A 00b4e3eb186c

Subscribe to this mod's changes

junos-mcp CLAUDE.md is an instructions file published in the GitHub repository shigechika/junos-mcp (1 stars, last pushed 11d ago), licensed Apache-2.0. It adds 4,443 tokens to every session, about $0.0178 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

junos-mcp CLAUDE.md compared with instructions from other repositories

junos-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
junos-mcp CLAUDE.mdshigechika/junos-mcpInstructions file111d agoApache-2.0A4,443Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode