local-llm-mcp: Instructions file for Claude Code

CLAUDE.md

local-llm-mcp CLAUDE.md is an instructions file for Claude Code from naka-koma/local-llm-mcp. It costs 2,102 tokens per session, scanned A, original, MIT.

A set of project instructions for working on `local-llm-mcp`, a small Python MCP server that forwards requests through LiteLLM. It documents the technology, files, setup, release approach, and coding rules.

In plain words
What is it for?
Use it as guidance when reading, changing, validating, documenting, or releasing this repository.
Why use it?
It gives an agent the project’s assumptions and boundaries, including how configuration, documentation, errors, and validation should be handled.

Instructions file for Claude Code

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

This is naka-koma/local-llm-mcp's own configuration. It tells Claude Code how to work on local-llm-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 local-llm-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to naka-koma/local-llm-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/naka-koma/local-llm-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/naka-koma/local-llm-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 local-llm-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/naka-koma/local-llm-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/naka-koma/local-llm-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/naka-koma/local-llm-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/naka-koma/local-llm-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 local-llm-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/naka-koma/local-llm-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/naka-koma/local-llm-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,102 This file is loaded in full into every session.
When invoked 2,102 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.02102 $0.02102
Opus 5 $0.01051 $0.01051
Sonnet 5 $0.00420 $0.00420
Haiku 4.5 $0.00210 $0.00210

Measured 11d ago against content hash 0106bcf4e1d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

local-llm-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 11d 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 · 123 lines

How it starts

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

CLAUDE.md

Claude Codeがこのリポジトリで作業する際の指針。

プロジェクト概要

Claude Code(またはその他のMCP対応クライアント)から、LiteLLM経由でローカル/クラウドのLLMに軽量タスクを委譲するための、薄いMCPサーバー。特定のプロジェクトに依存しない汎用ツールとして設計している。

技術スタック

  • 言語: Python 3.10+
  • 主要ライブラリ: mcp(MCP SDK), requests
  • 依存先: LiteLLM(別途起動しておく前提。このリポジトリはMCPサーバー本体のみを提供する)

フォルダ構成と役割

server.py           MCPサーバー本体。ask_local_llmツールを1つ公開する(main()がエントリポイント)
pyproject.toml       パッケージ定義。uvx実行用のscriptエントリポイント(local-llm-mcp)を定義する
requirements.txt    依存パッケージ(pip install用。pyproject.tomlのdependenciesと内容を一致させる)
scripts/setup.sh     セットアップスクリプト(macOS/Linux/Git Bash)
scripts/setup.ps1    セットアップスクリプト(Windows PowerShell)
.env.example         環境変数のサンプル(LITELLM_BASE_URL等)
README.md            セットアップ・利用方法(英語)
README.ja.md          セットアップ・利用方法(日本語)

READMEを更新する際は、内容の同期漏れを避けるため両言語版を同じコミットで更新する。

ビルド・デプロイ

単一のPythonスクリプト(server.py)で、CIによるビルド工程はない。バージョンを区切りたい場合は /release スキルでGitHub Releaseを作成する。

pyproject.toml はPyPI公開用ではなく、uvx --from git+https://github.com/naka-koma/local-llm-mcp local-llm-mcp でclone不要に実行できるようにするためのパッケージ定義。PyPIへの公開は現時点で行っていない(行う場合はユーザーの承認を得ること)。

検証はサブエージェントに委譲する

構文チェック(python -m py_compile server.py)は build-runner エージェントに、テスト(pytest、現時点ではテストスイート未整備)は test-runner エージェントに委譲する。どちらも実行と結果報告のみを行う実行専用エージェントで、エラーが出た場合の原因調査・修正はメイン側が行う。

ローカルLLMへの委譲(ドッグフーディング)

このリポジトリ自体の開発でも、local-llm MCPツール(ask_local_llm)が利用可能な場合は積極的に使う。自分がこのツールの開発元である以上、実際に使いながら使い勝手を検証する。

委譲してよい軽量タスクの例:

  • コミットメッセージ・PR本文の下書き作成、表現チェック
  • python -m py_compile / pytest の実行結果(build-runner / test-runner の出力)の要約
  • README.ja.mdやCLAUDE.mdの日本語表現の見直し

委譲すべきでないもの:

  • コードの設計判断、実装そのもの
  • セキュリティやAPIインターフェースに関わる意思決定
  • マージ可否など、ユーザーの承認が必要な判断

ツールが未接続・LiteLLM未起動などで使えない場合は、エラーメッセージが返るだけで例外にはならない(MCPサーバー実装の制約と注意事項参照)。その場合は通常通り自分で作業を続ける。

MCPサーバー実装の制約と注意事項

  • 例外を投げない: ask_local_llm は接続エラー・タイムアウト時も例外を投げず、エラー内容を説明する文字列を返す設計にする(呼び出し元のClaude Codeが例外処理を意識しなくて済むようにするため)
  • 設定は環境変数化する: LITELLM_BASE_URL 等をコードに直書きしない。プロジェクトに依存する値を持たせないのが、このツールの汎用性の根幹
  • 依存を増やしすぎない: 「薄いラッパー」であることが設計思想。新機能を追加する際も、LiteLLM側に既にある機能(ルーティング、フォールバック等)をこちら側で再実装しない
  • main()をエントリポイントとして維持する: pyproject.toml[project.scripts]server:mainを参照している(uvx実行用)。関数名・シグネチャを変える場合はpyproject.toml側も合わせて確認する
  • 依存関係はrequirements.txtpyproject.tomlの両方を更新する: pip installuvxの両方の導線があるため、依存パッケージを追加・変更する際は両ファイルの内容を一致させる

Read the full file on GitHub · 123 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. 11d ago First seen · 123 lines · 2,102 tokens per session scan A 0106bcf4e1d2

Subscribe to this mod's changes

local-llm-mcp CLAUDE.md is an instructions file published in the GitHub repository naka-koma/local-llm-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 2,102 tokens to every session, about $0.0105 per session on Opus 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

Other instructions, from other repositories

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,126 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens