mcp2anp: Instructions file for Claude Code

CLAUDE.md

mcp2anp CLAUDE.md is an instructions file for Claude Code from agent-network-protocol/mcp2anp. It costs 639 tokens per session, scanned A, original, MIT.

Repository instructions for mcp2anp, a bridge that lets MCP-compatible AI clients access ANP networks. They cover setup, commands, authentication, and local or remote server operation.

In plain words
What is it for?
Use them to install dependencies, start the local or HTTP server, run examples and tests, and follow the project's authentication, session, logging, and documentation conventions.
Why use it?
They give an AI coding agent the project context and working commands, reducing guesswork when changing or running the bridge.

Instructions file for Claude Code

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

This is agent-network-protocol/mcp2anp's own configuration. It tells Claude Code how to work on mcp2anp 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 mcp2anp configures →

Reuse

Borrowing it

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

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 mcp2anp CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/agent-network-protocol/mcp2anp/claude-md"><img src="https://agentmods.dev/badge/instructions/agent-network-protocol/mcp2anp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 639 This file is loaded in full into every session.
When invoked 639 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.00639 $0.00639
Opus 5.5 $0.00256 $0.00256
Sonnet 5.5 $0.00128 $0.00128
Haiku 4.5 $0.00064 $0.00064

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

Security

Grade A, and why

mcp2anp 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 2mo 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 · 52 lines

What it actually says

CLAUDE.md

本文件为 Claude Code 在该仓库工作的提示摘要。

项目速览

  • 定位:MCP ↔ ANP 桥接服务,让支持 MCP 的客户端(Claude Desktop、Cursor 等)能够访问 ANP 网络。
  • 工具集:仅暴露 anp.fetchDoc 与 anp.invokeOpenRPC 两个工具;DID 凭证在服务器启动时通过环境变量加载(或退回到 docs/did_public/ 的公共凭证)。
  • 代码结构:
    • mcp2anp/server.py:stdio 传输模式的 MCP 服务器。
    • mcp2anp/server_remote.py:FastMCP HTTP 传输实现,依靠 ServerSession 管理会话。
    • mcp2anp/core/handlers.py:ANPHandler 封装工具逻辑。
    • mcp2anp/utils/:日志、Pydantic 模型等通用工具。
    • docs/:最新的架构、远程部署、会话与鉴权文档。

常用命令

# 安装依赖(需先 uv venv --python 3.11)
uv sync

# 启动本地 stdio 服务器
uv run python -m mcp2anp.server --log-level INFO

# 启动远程 HTTP 服务器
uv run python -m mcp2anp.server_remote --host 0.0.0.0 --port 9880

# 运行官方示例
uv run python examples/mcp_client_demo.py

# 运行测试
uv run pytest

约定与注意事项

  • 认证通过环境变量控制:ANP_DID_DOCUMENT_PATH 与 ANP_DID_PRIVATE_KEY_PATH;未提供时使用公共凭证。
  • 远程模式的访问控制需通过 set_auth_callback() 自定义回调实现(详见 docs/REMOTE_SERVER.md 与 AUTH_EXAMPLE.md)。
  • 会话隔离依赖 FastMCP 的 ServerSession,状态存储在 SESSION_STORE(WeakKeyDictionary);无需手写 SessionManager。
  • 日志使用 structlog;保持新日志字段与现有格式一致。
  • 文档采用 Google Python 风格、注释与日志使用英文。

推荐阅读顺序

  1. README.md – 项目背景、快速开始。
  2. docs/usage.md – 工具调用方式与最佳实践。
  3. docs/REMOTE_SERVER.md – 远程部署、鉴权示例与运维建议。
  4. docs/STATEFUL_SESSION.md – 会话模型与调试技巧。
  5. spec.md – 更详细的设计说明。

协作时请优先维护上述文档的准确性,与代码变更保持同步。

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. 2mo ago First seen · 52 lines · 639 tokens per session scan A 96f1f83b2ccc

Subscribe to this mod's changes

mcp2anp CLAUDE.md is an instructions file published in the GitHub repository agent-network-protocol/mcp2anp (7 stars, last pushed 9mo ago), licensed MIT. It adds 639 tokens to every session, about $0.0026 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

Other instructions, from other repositories

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 · 9,719 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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,516 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 3,048 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,269 tokens