home-mcp: Instructions file for Claude Code

CLAUDE.md

home-mcp CLAUDE.md is an instructions file for Claude Code from shenjingnan/home-mcp. It costs 3,130 tokens per session, scanned A, original, MIT.

Project instructions for Home-MCP, a Model Context Protocol server intended to let AI assistants interact with smart-home devices. The documented implementation currently includes basic addition and subtraction tools.

In plain words
What is it for?
Building, running, testing, linting, formatting, and spell-checking the Home-MCP TypeScript project.
Why use it?
They give an agent the commands, architecture, file locations, and checks needed to work consistently in the repository.

Instructions file for Claude Code

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

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { HassState } from "../types";.

Reuse

Borrowing it

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/shenjingnan/home-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shenjingnan/home-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,130 This file is loaded in full into every session.
When invoked 3,130 The same file — it is already loaded in full.
Security scan A 1 finding. 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.03130 $0.03130
Opus 5 $0.01565 $0.01565
Sonnet 5 $0.00626 $0.00626
Haiku 4.5 $0.00313 $0.00313

Measured 10d ago against content hash 85de38357081, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

home-mcp CLAUDE.md scanned grade A with 1 finding 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 10d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "%{http_code}" http://localhost:3000
CLAUDE.md · 335 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目概述

Home-MCP 是一个基于 Model Context Protocol (MCP) 的智能家居集成服务器,旨在为 AI 助手提供标准化的 Home Assistant 设备控制接口。当前实现包含基础的数学运算工具(add、subtract),为后续扩展智能家居功能做准备。

开发命令

基础命令

# 构建项目
pnpm build

# 开发模式(热重载)
pnpm dev

# 生产模式启动
pnpm start

# 运行测试
pnpm test

# 测试覆盖率
pnpm test:coverage

代码规范

# 代码检查
pnpm lint

# 自动修复
pnpm lint:fix

# 格式化代码
pnpm format

# 综合检查和修复
pnpm check:fix

拼写检查

# 检查所有文件的拼写
pnpm spellcheck

# 仅检查源代码拼写
pnpm spellcheck:src

# 仅检查文档拼写
pnpm spellcheck:docs

# 导出拼写错误单词列表
pnpm spellcheck:fix

技术架构

核心组件

  • MCP 服务器:使用 @modelcontextprotocol/sdk 实现的 stdio 服务器
  • 工具系统:基于 MCP 协议的工具定义和调用处理
  • 类型安全:完整的 TypeScript 类型定义和 JSON Schema 验证

项目结构

src/
├── index.ts          # MCP 服务器入口点,包含工具定义和请求处理

关键实现

  • 服务器配置src/index.ts:7-17 - MCP 服务器基础配置
  • 工具列表src/index.ts:20-61 - 可用工具的定义和 schema
  • 请求处理src/index.ts:64-119 - 工具调用逻辑和错误处理
  • 启动逻辑src/index.ts:121-130 - 服务器启动和错误处理

开发指南

添加新工具

  1. ListToolsRequestSchema 处理器中添加工具定义
  2. CallToolRequestSchema 处理器中实现工具逻辑
  3. 添加适当的参数验证和错误处理
  4. 返回标准格式的响应

文档开发流程

重要:更新文档后必须进行本地验证,避免Vercel部署失败

  1. 创建或更新文档

    • 使用 /docs-create [type] [title] 创建新文档
    • 或直接编辑现有的 .mdx 文件
  2. 本地验证(必须执行)

    # 启动文档开发服务器
    nr dev:docs
    
    # 等待服务启动(约10-15秒)
    
    # 验证首页访问
    curl -s -o /dev/null -w "%{http_code}" http://localhost:3000
    # 应返回200状态码
    
  3. 检查常见问题

    • 编译错误:查看终端输出,修复MDX语法或组件导入问题
    • _meta.ts配置:确保新文档在对应的_meta.ts文件中正确配置
    • 组件导入:避免使用有问题的Nextra组件,出现问题时可用普通HTML元素替代
  4. 验证成功标准

    • 服务启动无报错
    • 首页返回200状态码
    • 新文档页面正常访问
    • 拼写检查通过:pnpm spellcheck
  5. 停止服务

    # 使用 Ctrl+C 停止服务
    

文档问题排查经验

根据实际遇到的问题总结:

  • TypeError: Cannot convert undefined or null to object

    • 通常由Nextra组件导入问题引起
    • 解决方案:移除有问题的组件,使用普通HTML或CSS样式替代
  • Validation of "_meta" file has failed

    • _meta.ts文件引用了不存在的文档
    • 解决方案:从_meta.ts中移除无效引用,或创建对应的文档文件

Read the full file on GitHub · 335 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. 10d ago First seen · 335 lines · 3,130 tokens per session scan A 85de38357081

Subscribe to this mod's changes

home-mcp CLAUDE.md is an instructions file published in the GitHub repository shenjingnan/home-mcp (21 stars, last pushed 7mo ago), licensed MIT. It adds 3,130 tokens to every session, about $0.0157 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

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

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,104 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

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