nostr-mcp
nostr-mcp
Nostr를 안전하게 탐색하기 위한 읽기 전용 Model Context Protocol 서버입니다. 에이전트에게 Nostr 식별자 해석, 프로필 및 이벤트 읽기, 노트 조회, 릴레이 메타데이터 검사 기능을 제공하는 의미론적 도구를 제공합니다.
이 첫 번째 릴리스는 의도적으로 개인 키를 받지 않으며 이벤트를 게시하지 않습니다. 서명은 NIP-46과 같은 원격 서명자를 통해 추가될 예정이며, 명시적인 사용자 승인 경계가 적용됩니다.
도구
도구 | 용도 |
| hex, |
| pubkey에 대한 가장 최신의 유효한 kind |
| hex ID, |
| 제한된 필터로 검증된 kind |
| 릴레이의 NIP-11 정보 문서를 가져와 정규화 |
반환되는 모든 이벤트에는 해당 이벤트를 제공한 릴레이가 포함됩니다. 유효하지 않은 서명은 폐기되고, 중복 이벤트는 병합되며, 일부 릴레이의 실패는 숨기지 않고 보고됩니다.
Related MCP server: stellar-agent-search
요구 사항
Node.js 20.19 이상
stdio 서버를 지원하는 MCP 호스트
Codex용 설치
한 번의 명령으로 서버를 설치하고 등록합니다:
npx -y @diegoyegros/nostr-mcp install등록을 확인합니다:
npx -y @diegoyegros/nostr-mcp doctor
codex mcp list설치 프로그램은 이 stdio 명령을 Codex에 저장합니다:
npx -y @diegoyegros/nostr-mcp@latest등록을 제거하려면:
npx -y @diegoyegros/nostr-mcp uninstallCodex 플러그인으로 설치
이 저장소는 MCP 서버와 번들된 Nostr 스킬을 포함하는 Codex 플러그인 마켓플레이스이기도 합니다:
codex plugin marketplace add DiegoYegros/nostr-mcp --ref masterCodex를 열고 /plugins를 실행한 다음 Nostr Plugins를 선택하고 Nostr MCP를 설치합니다. 이 플러그인은 읽기 전용이며 식별자 해석, 공개 노트 조회, 이벤트 검사, 릴레이 출처 보고에 대한 지침을 추가합니다.
직접 MCP 설치 프로그램과 플러그인 설치는 대안입니다. 플러그인을 설치하면 번들된 MCP 서버도 함께 제공됩니다.
모든 MCP 클라이언트에서 실행
npm 패키지가 게시된 후, stdio 호환 MCP 호스트는 다음 명령으로 실행할 수 있습니다:
npx -y @diegoyegros/nostr-mcp@latestMCP 클라이언트 구성 예시:
{
"mcpServers": {
"nostr": {
"command": "npx",
"args": ["-y", "@diegoyegros/nostr-mcp@latest"],
"env": {
"NOSTR_RELAYS": "wss://relay.damus.io,wss://nos.lol"
}
}
}
}소스에서 실행
npm install
npm run build
node dist/index.js소스 체크아웃을 Codex에 등록합니다:
codex mcp add nostr -- "$(command -v node)" "$PWD/dist/index.js"구성
변수 | 기본값 | 의미 |
|
| 쉼표로 구분된 기본 릴레이 URL |
|
| 쿼리당 제한 시간, 500-30000ms로 제한 |
|
| 도구 호출당 최대 릴레이 수, 1-20으로 제한 |
기본적으로 공개 wss:// 릴레이 URL만 허용됩니다. 자격 증명, 프래그먼트, 루프백 호스트 또는 사설 네트워크 IP 주소가 포함된 URL은 거부됩니다.
도구 호출에서 relay_urls를 제공하면 해당 릴레이만 조회됩니다. 그렇지 않은 경우, NIP-19 식별자의 안전한 릴레이 힌트가 구성된 기본값보다 먼저 시도됩니다.
개발
npm run check검사에는 타입 검사, 54개의 단위 및 통합 테스트, 최신 MCP stdio 협상 스모크 테스트, 설치 프로그램 CLI, 플러그인 메타데이터 일관성, npm 패키지 내용이 포함됩니다. 릴레이 테스트는 가짜 릴레이와 서명된 픽스처를 사용하므로 결정적이며 공개 릴레이 가용성에 의존하지 않습니다.
게시하지 않고 npm 아티팩트를 미리 보려면:
npm pack --dry-run게시
npm 이름은 @diegoyegros/nostr-mcp입니다. 수동 첫 릴리스는 다음으로 게시할 수 있습니다:
npm login
npm publish --access public포함된 prepublishOnly 훅은 게시 전에 전체 검증 스위트를 실행합니다. 이후 릴리스는 저장소의 NPM_TOKEN 시크릿을 구성한 후 GitHub 릴리스를 생성하여 자동화할 수 있습니다. 릴리스 워크플로는 npm 출처(provenance)와 함께 패키지를 게시합니다.
보안 모델
읽기 전용 MCP 도구 주석
nsec또는 원시 개인 키 입력 없음이벤트가 에이전트에 도달하기 전 서명 검증
SSRF 위험을 줄이기 위한 엄격한 릴레이 URL 검증
제한된 릴레이 수, 결과 크기 및 제한 시간
쿼리 결과의 릴레이 출처 및 릴레이별 오류
보고 및 신뢰 경계 세부 사항은 SECURITY.md를 참조하세요.
라이선스
MIT
Available Tools
5 toolsnostr_get_eventGet Nostr eventARead-onlyIdempotent
Fetch one signature-verified Nostr event by hex ID, note, or nevent and report which relays supplied it.
Inputs: event (required), relay_urls.
nostr_get_profileGet Nostr profileARead-onlyIdempotent
Fetch the newest signature-verified, valid JSON kind 0 profile for an npub, nprofile, or hex pubkey.
Inputs: identity (required), relay_urls.
nostr_inspect_relayInspect Nostr relayARead-onlyIdempotent
Fetch a relay's NIP-11 information document without following redirects. Only public wss:// relay URLs are accepted.
Inputs: relay_url (required), timeout_ms.
nostr_query_notesQuery Nostr notesARead-onlyIdempotent
Query signature-verified kind 1 notes with bounded author, time, text-search, event-reference, and pubkey-mention filters.
Inputs: limit, since, until, search, +4 more.
nostr_resolve_identityResolve Nostr identityARead-onlyIdempotent
Decode a hex, npub, nprofile, note, nevent, or naddr identifier. nsec and encrypted private-key identifiers are rejected.
Inputs: identifier (required), expected.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct Nostr operation: identifier resolution, profile fetch, specific event fetch, note querying, and relay inspection. No two tools overlap in purpose; boundaries are clear.
All tools use the consistent prefix 'nostr_' followed by a verb_noun pattern (resolve_identity, get_profile, get_event, query_notes, inspect_relay). Perfectly uniform and predictable.
With 5 tools, the server is well-scoped for a read-oriented Nostr client. Each tool provides a distinct capability without redundancy, fitting the typical 3-15 range ideal.
The surface covers core read operations: identity decoding, profiles, single events, filtered note queries, and relay metadata. Missing publishing and multi-event/list fetching, but these are minor gaps for a query-focused server.
Maintenance
Related MCP Connectors
Public read-only MCP server for HODLXXI agent identity, trust, receipts, and verification.
Read-only, no-auth MCP server over Human x AI's Content Hub and confirmed 2027 facts.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Read-only MCP gateway. Paid verify is $0.01 USDC on Base.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server for AI agents to access Nostr profiles, notes, search, and relay lists through user-chosen relays, without requiring an account or keys.MIT
- AlicenseAqualityBmaintenanceRead-only MCP server for discovering and ranking on-chain agents on Stellar mainnet via natural language search, reputation probes, and profile lookups.1365 npm1MIT
- AlicenseNot gradedqualityBmaintenanceRead-only MCP server for the Dant3 social network, exposing public feeds, rooms, agents, jobs, and platform stats to AI agents with no write capabilities.1MIT No Attribution
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server that provides tools to fetch SealChat public protocol docs, manifest, channel counts, and chat messages via the HTTP Agent API, without write access or database access.MIT