ref-mcp-module-organization

ref-mcp-module-organization is a skill for Claude Code, Codex from deephaven/deephaven-mcp. It costs 28 tokens per session (1,979 once invoked), scanned A, original, Apache-2.0.

A set of code-organization rules for MCP tool modules. MCP, or Model Context Protocol, is a way for AI agents to call tools provided by another program.

In plain words
What is it for?
Use it when creating or changing MCP tools, including deciding where modules, helper functions, and constants should live.
Why use it?
It keeps related tools and helper code together and avoids mixing MCP server patterns with the project's separate command-line interface code.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/deephaven/deephaven-mcp/ref-mcp-module-organization
Any agent
npx skills add deephaven/deephaven-mcp --skill ref-mcp-module-organization
Clone the repo
git clone --depth 1 https://github.com/deephaven/deephaven-mcp

Made for: Claude Code, Codex.

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 ref-mcp-module-organization

README.md
[![agentmods](https://agentmods.dev/badge/skills/deephaven/deephaven-mcp/ref-mcp-module-organization.svg)](https://agentmods.dev/skills/deephaven/deephaven-mcp/ref-mcp-module-organization)
Your own site
<a href="https://agentmods.dev/skills/deephaven/deephaven-mcp/ref-mcp-module-organization"><img src="https://agentmods.dev/badge/skills/deephaven/deephaven-mcp/ref-mcp-module-organization.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,979 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00028 $0.01979
Opus 5 $0.00014 $0.00989
Sonnet 5 $0.00006 $0.00396
Haiku 4.5 $0.00003 $0.00198

Measured 5d ago against content hash 59b4056a1364, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

ref-mcp-module-organization 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 5d 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.

.agents/skills/ref-mcp-module-organization/SKILL.md · 109 lines

How it starts

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

MCP Tools Module Organization Guidelines

Scope. This skill applies only to MCP server tool modules under src/deephaven_mcp/mcp_systems_server/_tools/. For commands in the local dhcli CLI under src/deephaven_mcp/cli/_commands/, apply the cli-command-add skill instead — the CLI uses a different framework (click), a different async pattern (@run_async from cli/_async.py), and a different error contract (CliError from cli/_errors.py). Do not transplant patterns between the two.

File Organization Principles

  1. Module Cohesion: Each file in _tools/ should contain MCP tools and helpers for a single, well-defined domain (e.g., table operations, session lifecycle, script execution).

  2. Helper Function Placement:

    • If used by 1 module → keep it in that module (private with _ prefix).
    • If used by 2 modules → duplicate is acceptable. Promote to _tools/shared.py when a third consumer appears (rule below).
    • If used by 3+ modules → move to _tools/shared.py.
  3. Constant Placement:

    • Module-specific constants → keep in that module after imports
    • Shared constants → place in _tools/shared.py or the most relevant module
    • Always include a docstring explaining the constant's purpose
    • Operator-tunable values (timeouts, defaults, thresholds) are not module constants — see the ref-configuration-conventions skill for where they live and how to read them.
  4. New MCP Tool Placement:

    • Before creating a new file, check if the tool fits an existing domain
    • Only create a new module if the tool represents a distinct new domain
    • Module size is a consequence of one-domain-per-module, not a target to hit
  5. Registering New Tool Modules:

    • CRITICAL: Every tool module must define a register_tools(server: FastMCP) -> None function
    • This function calls server.tool()(tool_fn) for each tool in the module
    • After creating a new module, add a module.register_tools(server) call to _register_tools() in src/deephaven_mcp/mcp_systems_server/_fastmcp.py. Registration is not gated by configuration — every tool module registers unconditionally, so the tool surface is stable and self-describing across all deployment shapes (and matches the static dhcli CLI command tree). A tool that needs a configuration section the deployment lacks self-reports applicability when invoked: it returns an empty result where one is meaningful (e.g. enterprise_systems_status{"systems": []}) or a structured user-facing error otherwise. The section accessors enforce this — get_enterprise_settings raises EnterpriseNotConfiguredError and get_community_settings/get_community_registry raise CommunityNotConfiguredError (both ConfigurationError subclasses), which each tool's except handler converts to a success=False response. Do not gate registration on multi_config.community/multi_config.enterprise. See _register_tools in mcp_systems_server/_fastmcp.py.

Read the full file on GitHub · 109 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. 5d ago First seen · 109 lines · 28 tokens per session scan A 59b4056a1364

Subscribe to this mod's changes

ref-mcp-module-organization is a skill published in the GitHub repository deephaven/deephaven-mcp (5 stars, last pushed today), licensed Apache-2.0. It adds 28 tokens to every session and 1,979 once invoked, about $0.0001 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 skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens