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.
curl -O https://raw.githubusercontent.com/shenjingnan/home-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/shenjingnan/home-mcpWrote 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.
[](https://agentmods.dev/instructions/shenjingnan/home-mcp/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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 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- 服务器启动和错误处理
开发指南
添加新工具
- 在
ListToolsRequestSchema处理器中添加工具定义 - 在
CallToolRequestSchema处理器中实现工具逻辑 - 添加适当的参数验证和错误处理
- 返回标准格式的响应
文档开发流程
重要:更新文档后必须进行本地验证,避免Vercel部署失败
-
创建或更新文档
- 使用
/docs-create [type] [title]创建新文档 - 或直接编辑现有的
.mdx文件
- 使用
-
本地验证(必须执行)
# 启动文档开发服务器 nr dev:docs # 等待服务启动(约10-15秒) # 验证首页访问 curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 # 应返回200状态码 -
检查常见问题
- 编译错误:查看终端输出,修复MDX语法或组件导入问题
- _meta.ts配置:确保新文档在对应的_meta.ts文件中正确配置
- 组件导入:避免使用有问题的Nextra组件,出现问题时可用普通HTML元素替代
-
验证成功标准
- 服务启动无报错
- 首页返回200状态码
- 新文档页面正常访问
- 拼写检查通过:
pnpm spellcheck
-
停止服务
# 使用 Ctrl+C 停止服务
文档问题排查经验
根据实际遇到的问题总结:
-
TypeError: Cannot convert undefined or null to object
- 通常由Nextra组件导入问题引起
- 解决方案:移除有问题的组件,使用普通HTML或CSS样式替代
-
Validation of "_meta" file has failed
- _meta.ts文件引用了不存在的文档
- 解决方案:从_meta.ts中移除无效引用,或创建对应的文档文件
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.
- 10d ago First seen · 335 lines · 3,130 tokens per session scan A 85de38357081
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.
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.
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.
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).
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.
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).
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.