Skip to main content
Glama

nostr-mcp

Nostr를 안전하게 탐색하기 위한 읽기 전용 Model Context Protocol 서버입니다. 에이전트에게 Nostr 식별자 해석, 프로필 및 이벤트 읽기, 노트 조회, 릴레이 메타데이터 검사 기능을 제공하는 의미론적 도구를 제공합니다.

이 첫 번째 릴리스는 의도적으로 개인 키를 받지 않으며 이벤트를 게시하지 않습니다. 서명은 NIP-46과 같은 원격 서명자를 통해 추가될 예정이며, 명시적인 사용자 승인 경계가 적용됩니다.

도구

도구

용도

nostr_resolve_identity

hex, npub, nprofile, note, nevent, naddr 식별자 디코딩

nostr_get_profile

pubkey에 대한 가장 최신의 유효한 kind 0 프로필 가져오기

nostr_get_event

hex ID, note 또는 nevent로 이벤트 하나 가져오기

nostr_query_notes

제한된 필터로 검증된 kind 1 노트 조회

nostr_inspect_relay

릴레이의 NIP-11 정보 문서를 가져와 정규화

반환되는 모든 이벤트에는 해당 이벤트를 제공한 릴레이가 포함됩니다. 유효하지 않은 서명은 폐기되고, 중복 이벤트는 병합되며, 일부 릴레이의 실패는 숨기지 않고 보고됩니다.

Related MCP server: nostr-read-mcp

요구 사항

  • 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 uninstall

Codex 플러그인으로 설치

이 저장소는 MCP 서버와 번들된 Nostr 스킬을 포함하는 Codex 플러그인 마켓플레이스이기도 합니다:

codex plugin marketplace add DiegoYegros/nostr-mcp --ref master

Codex를 열고 /plugins를 실행한 다음 Nostr Plugins를 선택하고 Nostr MCP를 설치합니다. 이 플러그인은 읽기 전용이며 식별자 해석, 공개 노트 조회, 이벤트 검사, 릴레이 출처 보고에 대한 지침을 추가합니다.

직접 MCP 설치 프로그램과 플러그인 설치는 대안입니다. 플러그인을 설치하면 번들된 MCP 서버도 함께 제공됩니다.

모든 MCP 클라이언트에서 실행

npm 패키지가 게시된 후, stdio 호환 MCP 호스트는 다음 명령으로 실행할 수 있습니다:

npx -y @diegoyegros/nostr-mcp@latest

MCP 클라이언트 구성 예시:

{
  "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"

구성

변수

기본값

의미

NOSTR_RELAYS

wss://relay.damus.io,wss://nos.lol,wss://relay.primal.net

쉼표로 구분된 기본 릴레이 URL

NOSTR_QUERY_TIMEOUT_MS

5000

쿼리당 제한 시간, 500-30000ms로 제한

NOSTR_MAX_RELAYS

8

도구 호출당 최대 릴레이 수, 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 tools
nostr_get_eventGet Nostr eventA
Read-onlyIdempotent

Fetch one signature-verified Nostr event by hex ID, note, or nevent and report which relays supplied it.

ParametersJSON Schema
NameRequiredDescriptionDefault
eventYes
relay_urlsNoOptional relay URLs to query instead of identifier hints and configured defaults

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and idempotentHint, so the description is not required to repeat safety. It adds valuable context: signature verification and relay reporting, which go beyond annotations. No contradiction found.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that immediately conveys the core purpose and key behaviors. No unnecessary words; it is front-loaded and easily parsed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only fetch with two parameters, the description covers purpose, verification, and relay reporting. It lacks explicit mention of return format or error behavior, but annotations and schema (relay_urls description) fill most gaps. It is sufficiently complete for the tool's low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides no description for 'event', but the tool description compensates by explaining accepted formats (hex ID, note, nevent). The 'relay_urls' parameter already has a schema description, and the description reinforces 'instead of identifier hints and configured defaults'. This coverage is adequate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it fetches a single signature-verified Nostr event, specifying accepted ID formats (hex, note, nevent) and the relay reporting behavior. This distinguishes it from siblings like nostr_query_notes (multiple events) and nostr_get_profile (profile-specific).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving a single event by its identifier, but does not explicitly contrast with sibling tools or state when not to use it. The scope (one event vs. querying many) is evident, yet no explicit exclusions or alternatives are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nostr_get_profileGet Nostr profileA
Read-onlyIdempotent

Fetch the newest signature-verified, valid JSON kind 0 profile for an npub, nprofile, or hex pubkey.

ParametersJSON Schema
NameRequiredDescriptionDefault
identityYes
relay_urlsNoOptional relay URLs to query instead of identifier hints and configured defaults

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint false, so the description doesn't need to repeat safety traits. It adds context by specifying 'signature-verified' and 'valid JSON kind 0', implying data quality guarantees and potential filtering behavior. It does not mention network behavior, timeouts, or fallback logic, but the annotation coverage is strong, so this is acceptable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the key purpose and constraints. It is concise and has no filler words, earning its place with specific technical details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has simple parameters, no output schema, and strong annotations, the description offers sufficient context for correct selection and invocation. It lacks a list of possible output fields, but that might be okay for a profile fetch; however, it could mention that it returns a parsed profile object. Still, the description is adequate for a straightforward read operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The identity parameter is not described in the schema, but the description clarifies it accepts npub, nprofile, or hex pubkey. The relay_urls parameter is partially described in the schema as 'Optional relay URLs to query instead of identifier hints and configured defaults', which matches the description's intent. The description adds meaning for the key parameter, compensating for the 50% schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches the newest signature-verified, valid JSON kind 0 profile for an npub, nprofile, or hex pubkey. It specifies the verb (fetch), the resource (Nostr profile), and the exact scope (newest, signature-verified, valid JSON kind 0), which distinguishes it from sibling tools like nostr_get_event or nostr_query_notes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is used when you need a user's profile data, and the parameter 'relay_urls' suggests optional customization. However, it does not explicitly state when to use this tool versus alternatives like nostr_resolve_identity or nostr_get_event, nor does it provide exclusions or alternative recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nostr_inspect_relayInspect Nostr relayA
Read-onlyIdempotent

Fetch a relay's NIP-11 information document without following redirects. Only public wss:// relay URLs are accepted.

ParametersJSON Schema
NameRequiredDescriptionDefault
relay_urlYes
timeout_msNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool as read-only, idempotent, and non-destructive. The description adds meaningful behavioral details: it does not follow redirects and only accepts public wss:// URLs. This goes beyond the annotations and clarifies potential edge cases, though it doesn't explain what happens on redirects or invalid URLs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences that front-load the main action (fetch) and immediately state the key constraints. Every word earns its place with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the core purpose is clear. However, with no output schema and no parameter descriptions, the description leaves a gap around the timeout_ms parameter and does not describe what the returned NIP-11 document might contain. Given the tool's narrow scope, it is adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema lists two parameters (relay_url and timeout_ms) with no descriptions (0% schema description coverage). The description does not explain either parameter, leaving timeout_ms entirely unexplained. The meaning of relay_url is inferable from the tool's purpose, but the timeout behavior is undocumented, so the description fails to compensate for the schema gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (fetch) and the resource (relay's NIP-11 information document). It also adds specific constraints (doesn't follow redirects, only public wss:// URLs). This distinctly separates it from sibling tools like nostr_get_profile or nostr_query_notes, which handle different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use the tool (fetching relay metadata) and includes a strict input requirement (public wss://). It does not explicitly mention alternatives, but the sibling tools have obviously different purposes, so the usage context is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nostr_query_notesQuery Nostr notesA
Read-onlyIdempotent

Query signature-verified kind 1 notes with bounded author, time, text-search, event-reference, and pubkey-mention filters.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
sinceNo
untilNo
searchNo
authorsNo
relay_urlsNoOptional relay URLs to query instead of identifier hints and configured defaults
mentioned_pubkeyNo
referenced_eventNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide idempotentHint, readOnlyHint, etc., but the description adds the important behavioral detail that results are 'signature-verified', which is not in annotations. It also mentions 'bounded' filters, implying limits. This adds value beyond the structured fields, though it doesn't cover pagination or relay behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, dense sentence that front-loads the core purpose and adds key context (signature-verified) without fluff. Every word contributes value, and it is easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 parameters, no output schema, and low schema coverage, the description is too thin. It doesn't explain how filters combine (AND/OR), output ordering, pagination, default limit, or what 'signature-verified' entails operationally (e.g., rejection of unverified events). The description fails to provide enough operational detail for an agent to correctly invoke the tool with proper parameter values and expectations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 13% (only relay_urls has a description). The description lists filter categories (author, time, text-search, event-reference, pubkey-mention) that map to several parameters, giving high-level meaning. However, it doesn't explain parameter formats (e.g., pubkey hex, UNIX timestamps) or constraints like limit defaults. It partially compensates for low schema coverage but leaves gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it queries 'signature-verified kind 1 notes' with specific filter types, which is a precise verb+resource combination. It distinguishes from siblings like nostr_get_event (single event) and nostr_resolve_identity (identity resolution) by focusing on filtered queries over kind 1 notes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for querying/filtering notes, and the filter list makes it clear this is the go-to tool for searching notes. However, it doesn't explicitly name alternatives or state when not to use it, though the sibling tools naturally cover other cases (single event, profiles, relays).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

nostr_resolve_identityResolve Nostr identityA
Read-onlyIdempotent

Decode a hex, npub, nprofile, note, nevent, or naddr identifier. nsec and encrypted private-key identifiers are rejected.

ParametersJSON Schema
NameRequiredDescriptionDefault
expectedNoauto
identifierYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint=false, establishing the safety profile. The description adds valuable behavioral context beyond these annotations by explicitly rejecting nsec and encrypted private-key identifiers, which is not inferable from the annotations or schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the verb and subject, and contains no redundant information. Every clause adds value: accepted formats and rejected formats.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and annotations are strong, but the description does not explain the 'expected' parameter or describe the output shape. Since there is no output schema, the agent is left without a clear picture of what the resolution returns (e.g., a pubkey, event id, or type indicator), making the description incomplete for smooth invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It partially covers 'identifier' by listing valid formats, but it completely ignores the 'expected' parameter and its enum values (auto, pubkey, event). The meaning of 'expected' and its effect on decoding is left unexplained, leaving the agent uncertain about a key input.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Decode' and enumerates exactly which identifier formats are accepted (hex, npub, nprofile, note, nevent, naddr), clearly distinguishing this from sibling tools that fetch profiles, events, or query notes. It also states what is rejected (nsec, encrypted keys), further sharpening the tool's purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context makes it clear this tool is for decoding identifiers before fetching related data, and the listed sibling tools (get_profile, get_event) imply an alternative workflow. However, there is no explicit 'when to use' or 'when not to use' comparison, only the implicit separation of concerns via the description and sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observednostr_get_event
    • First observednostr_get_profile
    • First observednostr_inspect_relay
    • First observednostr_query_notes
    • First observednostr_resolve_identity

TDQS

A4.3/5.0

Scored across 5 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers