secure-api MCP server
2026년 11월 12일 커밋런타임 시 명령 및 API 호출에 비밀 정보를 주입하며, AI 클라이언트에 민감한 데이터가 노출되지 않도록 출력을 정화합니다.
다른 이름 than/secure-api-mcp
- 스타
- 5
- Tools
- 5
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- —
secure-api MCP란?
런타임 시 명령 및 API 호출에 비밀 정보를 주입하며, AI 클라이언트에 민감한 데이터가 노출되지 않도록 출력을 정화합니다. 5개 도구를 제공합니다. 예: get_env_keys, run_with_env, api_call.
프로젝트 README에서 생성된 요약
secure-api MCP server 정보
이 서버는 Claude Code와 같은 AI 클라이언트가 민감한 자격 증명을 캐싱하거나 읽지 못하도록 보호합니다. 개발자는 실제 비밀 값을 대화 컨텍스트에 노출하지 않고도 AI 에이전트가 환경 변수와 설정 파일을 사용할 수 있는 기능을 제공할 수 있습니다. 런타임 시 명령 및 HTTP 요청에 비밀 정보를 주입하고 결과 출력을 편집함으로써, 개인 키와 LLM 사이에 보안 계층을 유지합니다.
사용자는 구조화된 HTTP 요청을 위한 api_call이나 셸 명령 실행을 위한 run_with_env와 같은 특정 도구를 통해 비밀 정보를 관리할 수 있습니다. 또한 이 서버는 read_mycnf를 통해 MySQL 자격 증명을 처리하고 sync_env_example을 사용하여 문서 유지를 돕습니다. 보안을 보장하기 위해 api_call 도구에는 SSRF 보호 기능이 포함되어 있으며, SECURE_API_ALLOWED_HOSTS 환경 변수를 통해 호스트 허용 목록을 지원합니다. 이 설정은 파일 기록에 평문 비밀 정보가 몰래 저장되는 것을 방지하면서 Claude Code를 사용하고자 하는 로컬 개발 환경을 위해 설계되었습니다.
활용 사례
- 1비밀 정보를 포함한 셸 명령 실행AI가 출력값에서 값을 볼 수 없도록 하면서 환경 변수가 필요한 터미널 명령을 실행합니다.
- 2안전한 API 요청 수행목적지가 승인되었는지 확인하면서 Bearer 토큰 또는 사용자 정의 헤더를 포함한 HTTP 호출을 수행합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
secure-api MCP 도구 5
README에서 감지됨get_env_keysrun_with_envapi_callread_mycnfsync_env_example
| get_env_keys | — | |
| run_with_env | — | |
| api_call | — | |
| read_mycnf | — | |
| sync_env_example | — |
구성
SECURE_API_ALLOWED_HOSTS
| 이름 | 설명 | 유형 |
|---|---|---|
| SECURE_API_ALLOWED_HOSTS | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능than/secure-api-mcp is public and reachablegithub.com/than/secure-api-mcp ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)No license결함 발견
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-12github.com/than/secure-api-mcp ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음5 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기secure-api-mcp
MCP server that lets Claude Code use secrets without seeing them.
Claude Code silently reads .env files and caches them in plaintext in ~/.claude/file-history/. This server injects secrets into commands and API calls at runtime, then sanitizes output to strip secret values before they reach Claude's context.
Threat model — read this. The strength of the guard differs by tool:
api_callhas the smallest attack surface: no shell, structured output, SSRF protection, and an optional destination allowlist (see below). Sanitization reliably covers its responses.run_with_envruns an arbitrary shell command. Output sanitization is best-effort, not a hard boundary — a command can re-encode, reverse, chunk, or otherwise transform a secret into a form the sanitizer won't recognize before printing it. Treat it as defense-in-depth.
A secret can only be protected if you control where it goes. Both tools can send a secret to an external destination by design; restrict that with deny rules, the api_call allowlist, and review of run_with_env commands.
Tools
get_env_keys(project_dir)— Returns key names from.env. No values exposed.run_with_env(project_dir, command, env_keys?, timeout_ms?, include_mycnf?)— Runs a shell command with.envvars injected. Output is sanitized — secret values replaced with[REDACTED:KEY_NAME]. Setinclude_mycnfto also sanitize MySQL credentials from.my.cnfin command output.api_call(project_dir, url, method?, headers?, body?, auth_env_key?, timeout_ms?)— HTTP request with secret injection.auth_env_keyadds a Bearer token. Headers support{{KEY_NAME}}template syntax. When a secret is injected, the destination host is checked againstSECURE_API_ALLOWED_HOSTS(see below). Redirects are followed manually, up to 5 hops, with the SSRF guard and the allowlist re-applied to every hop. Times out aftertimeout_ms(default 30s).read_mycnf(project_dir, section?)— Reads MySQL.my.cnfconfiguration. Returns section names and safe fields (port,database,socket) with credentials (user,password,host) redacted as[REDACTED:section.field]. Checks~/.my.cnfand project-local.my.cnf.sync_env_example(project_dir)— Generates/updates.env.examplefrom.env. Preserves comments and structure, strips values, uses smart placeholders.
Setup
npm install && npm run build
Register in Claude Code:
claude mcp add secure-api -- node /path/to/secure-api-mcp/dist/index.js
Pair with deny rules in ~/.claude/settings.json to block direct .env reads:
"deny": [
"Read(.env)", "Read(**/.env)",
"Read(.env.local)", "Read(**/.env.local)",
"Edit(.env)", "Edit(**/.env)"
]
Keeping .env.example in sync
Run sync_env_example to generate or update .env.example from your .env. It:
- Preserves comments and blank lines from
.env - Strips secret values, replacing them with smart placeholders (URLs stay URL-shaped, booleans stay as-is, numbers stay as-is, everything else blanked)
- Merges with any existing
.env.example— custom placeholders you've added won't be overwritten - Lets Claude read
.env.examplefreely (since deny rules only block.env) so it knows what config exists without seeing values
Pair this with get_env_keys and Claude has full awareness of your project's config without any secret exposure.
Restricting where api_call can send secrets
By default api_call will attach a secret to a request bound for any public host (internal/private IPs are always blocked for SSRF). To restrict this, set SECURE_API_ALLOWED_HOSTS to a comma-separated list of permitted hosts:
export SECURE_API_ALLOWED_HOSTS="api.stripe.com,api.github.com,*.internal.example.com"
- Set — a request that injects a secret is blocked unless its host matches.
*.example.commatches any subdomain and the apexexample.com. Matching is case-insensitive. - Unset — secrets are still sent (so existing setups keep working), but the response includes a
warningsentry naming the destination host.
Requests that inject no secret are never gated.
MySQL .my.cnf support
Claude can work with MySQL configs without seeing your credentials. read_mycnf exposes structural fields (port, database, socket) while redacting user, password, and host. When running MySQL commands via run_with_env, set include_mycnf: true to sanitize any credential values that appear in command output — the mysql CLI reads ~/.my.cnf natively, so no env var injection is needed.
Resolution order matches MySQL's own: ~/.my.cnf (global), then <project_dir>/.my.cnf (project-local overrides global per-field). !include and !includedir directives are followed. Includes in the project-local chain are contained to the project directory (resolved through symlinks) so a crafted project .my.cnf can't disclose files elsewhere on disk; the trusted global ~/.my.cnf chain is unrestricted.
How sanitization works
Secret values of 4 or more characters are replaced in all output, sorted longest-first to prevent partial matches. A value like sk-abc123xyz becomes [REDACTED:API_KEY]. The literal value, its base64 form, and its URL-encoded form are all matched, followed by a pattern pass for common token shapes (AWS, GitHub, Stripe, Slack, JWTs, private keys). Values transformed in other ways (hex, reversed, split across lines) are not caught — this is why run_with_env output is best-effort, not a guarantee.
License
MIT
secure-api MCP 질문
secure-api MCP는 어떤 도구를 제공하나요?
5개 도구를 제공합니다. 예: get_env_keys, run_with_env, api_call, read_mycnf, sync_env_example.
서버가 Claude에게 비밀 정보가 노출되지 않도록 어떻게 보호하나요?
서버는 런타임 시 명령 및 API 호출에 비밀 정보를 주입한 후, 해당 값이 AI의 컨텍스트에 도달하기 전에 출력을 정화하여 비밀 값을 제거합니다.
셸 명령 출력의 정화가 보장되나요?
아니요, 셸 명령에 대한 정화는 최선의 노력을 다하는 방식(best-effort)입니다. 명령이 비밀 정보를 재인코딩하거나 변형하여 정화 도구가 인식하지 못할 가능성이 있습니다.
api_call 도구가 비밀 정보를 보낼 수 있는 호스트를 제한할 수 있나요?
네, SECURE_API_ALLOWED_HOSTS 환경 변수를 사용하여 허용된 호스트 목록을 쉼표로 구분하여 설정함으로써 비밀 정보가 주입되는 요청을 제어할 수 있습니다.