seoul-timeavg-air-mcp: Instructions file for Claude Code

CLAUDE.md

seoul-timeavg-air-mcp CLAUDE.md is an instructions file for Claude Code from hlucent/seoul-timeavg-air-mcp. It costs 2,494 tokens per session, scanned A, original, MIT.

A set of project instructions for building and testing a Seoul air-quality MCP server, which lets an AI agent call air-quality services.

In plain words
What is it for?
Use it when modifying the server, reading JSON or XML API responses, handling environment files, running local tests, and preparing code for deployment without deploying it.
Why use it?
It sets rules for implementation, response parsing, retries, local testing, and deployment so work follows the project's existing specification.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

Nothing to install: this file belongs to hlucent/seoul-timeavg-air-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/hlucent/seoul-timeavg-air-mcp/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/hlucent/seoul-timeavg-air-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 seoul-timeavg-air-mcp CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hlucent/seoul-timeavg-air-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/hlucent/seoul-timeavg-air-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,494 This file is loaded in full into every session.
When invoked 2,494 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.02494 $0.02494
Opus 5 $0.01247 $0.01247
Sonnet 5 $0.00499 $0.00499
Haiku 4.5 $0.00249 $0.00249

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

Security

Grade A, and why

seoul-timeavg-air-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 9d 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 · 181 lines

How it starts

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

CLAUDE.md — seoul-timeavg-air-mcp

Claude Code는 이 문서만 먼저 읽고 시작한다. 다른 문서(README, DEVLOG) 재탐색 금지. DEVPLAN.md는 API 스펙과 툴 설계를 위해 참고하되, 스펙 재해석/재설계는 하지 않는다.

0. 절대 규칙

  • 웹서치 금지. API 스펙은 DEVPLAN.md에 이미 있다.
  • 불확실하면 추측성 재설계 대신 기본값 1개로 구현 후 DEVLOG.md에 "확인 필요"로 기록한다.
  • 동일 오류 최대 3회까지만 재시도. 3회 실패 시 기록하고 사용자에게 보고한다.
  • 네 역할은 "코드 구현 + 로컬 실측 테스트"까지다. fly launch, fly secrets set, flyctl deploy, fly logs 등 fly.io 관련 명령은 절대 스스로 실행하지 않는다.
  • 배포 준비(코드 구현, 로컬 테스트, git commit/push)가 끝나면 아래 "정지 시점"에서 멈추고, "사용자 안내 문구"를 그대로 출력한다.

1. 기술적으로 반드시 적용할 것

1-1. .env

  • 항상 UTF-8(BOM 없음)으로 저장한다. BOM이 있으면 python-dotenv가 키를 못 읽는 사례가 있었다.

1-2. server.pymcp.run()

mcp.run(transport="streamable-http", host="0.0.0.0", port=port, stateless_http=True)

stateless_http=True를 반드시 포함한다. 빠뜨리면 fly.io 멀티머신 환경에서 세션 404가 발생하고 Claude.ai 커넥터에서 "사용 가능한 도구 없음"으로 보인다.

1-3. 응답 파싱 — JSON 우선, XML 폴백 필수

정상 응답은 TYPE에 따라 오지만, 일부 에러 응답은 TYPE=json 요청에도 XML로 돌아올 수 있다. response.json()이 실패하면 정규식으로 <CODE>/<MESSAGE> 패턴을 추출하는 폴백을 구현한다.

import re

def parse_response(text: str) -> dict:
    try:
        return json.loads(text)
    except ValueError:
        code_match = re.search(r"<CODE>(.*?)</CODE>", text)
        msg_match = re.search(r"<MESSAGE>(.*?)</MESSAGE>", text)
        return {
            "RESULT": {
                "CODE": code_match.group(1) if code_match else "UNKNOWN",
                "MESSAGE": msg_match.group(1) if msg_match else text[:200],
            }
        }

정상 XML 응답(TYPE=xml 요청 시)도 파싱해야 하므로, XML 파싱은 xml.etree.ElementTree<row> 반복 요소를 순회하는 로직을 별도로 둔다. 기본 TYPE은 json으로 요청하되, JSON 파싱 실패 시 XML 파서로 재시도하는 이중 폴백 구조를 권장한다.

1-4. 인증키는 URL 경로 세그먼트

쿼리 파라미터(?KEY=)가 아니라 경로 세그먼트다:

http://openAPI.seoul.go.kr:8088/{KEY}/{TYPE}/TimeAverageCityAir/{START}/{END}/{MSRMT_DT}

ERROR-300(필수값 누락)이 반복되면 이 구조부터 의심한다.

2. API 키 취급 원칙

  • 실제 키 값은 코드에 하드코딩하지 않고 항상 os.environ으로 읽는다.
  • .env를 갱신했다는 말을 들으면, 재테스트 전에 실제로 값이 바뀌었는지 파일 크기나 앞 몇 글자로 비교 확인한다.
  • 키를 표준출력에 그대로 찍지 않는다. 필요하면 앞 4자리 + ... + 길이만 출력한다.
  • 재테스트 요청을 받으면 "이전과 동일한 키인지, 새 키인지" 먼저 확인한다.

Read the full file on GitHub · 181 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. 9d ago First seen · 181 lines · 2,494 tokens per session scan A e7c813da84b0

Subscribe to this mod's changes

seoul-timeavg-air-mcp CLAUDE.md is an instructions file published in the GitHub repository hlucent/seoul-timeavg-air-mcp (0 stars, last pushed 19d ago), licensed MIT. It adds 2,494 tokens to every session, about $0.0125 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

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