nostr-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nostr-mcpResolve this npub and fetch the profile."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
nostr-mcp
A read-only Model Context Protocol server for exploring Nostr safely. It gives agents semantic tools for resolving Nostr identifiers, reading profiles and events, querying notes, and inspecting relay metadata.
This first release deliberately does not accept private keys or publish events. Signing will be added through a remote signer such as NIP-46, with explicit user approval boundaries.
Tools
Tool | Purpose |
| Decode hex, |
| Fetch the newest valid kind |
| Fetch one event by hex ID, |
| Query verified kind |
| Fetch and normalize a relay's NIP-11 information document |
Every returned event includes the relays that supplied it. Invalid signatures are discarded, duplicate events are merged, and partial relay failures are reported rather than hidden.
Related MCP server: nostr-read-mcp
Requirements
Node.js 20.19 or newer
An MCP host that supports stdio servers
Install for Codex
Install and register the server with one command:
npx -y @diegoyegros/nostr-mcp installVerify the registration:
npx -y @diegoyegros/nostr-mcp doctor
codex mcp listThe installer stores this stdio command in Codex:
npx -y @diegoyegros/nostr-mcp@latestRemove the registration with:
npx -y @diegoyegros/nostr-mcp uninstallInstall as a Codex plugin
The repository is also a Codex plugin marketplace containing the MCP server and a bundled Nostr skill:
codex plugin marketplace add DiegoYegros/nostr-mcp --ref masterOpen Codex, run /plugins, select Nostr Plugins, and install Nostr MCP. The plugin is read-only and adds guidance for resolving identifiers, querying public notes, inspecting events, and reporting relay provenance.
The direct MCP installer and plugin installation are alternatives. Installing the plugin already provides its bundled MCP server.
Run with any MCP client
After the npm package is published, any stdio-compatible MCP host can launch it with:
npx -y @diegoyegros/nostr-mcp@latestExample MCP client configuration:
{
"mcpServers": {
"nostr": {
"command": "npx",
"args": ["-y", "@diegoyegros/nostr-mcp@latest"],
"env": {
"NOSTR_RELAYS": "wss://relay.damus.io,wss://nos.lol"
}
}
}
}Run from source
npm install
npm run build
node dist/index.jsRegister a source checkout with Codex:
codex mcp add nostr -- "$(command -v node)" "$PWD/dist/index.js"Configuration
Variable | Default | Meaning |
|
| Comma-separated default relay URLs |
|
| Per-query timeout, clamped to 500-30000 ms |
|
| Maximum relays per tool call, clamped to 1-20 |
Only public wss:// relay URLs are accepted by default. URLs containing credentials, fragments, loopback hosts, or private-network IP addresses are rejected.
When a tool call supplies relay_urls, only those relays are queried. Otherwise, safe relay hints from NIP-19 identifiers are tried before the configured defaults.
Development
npm run checkThe checks include type checking, 54 unit and integration tests, a modern MCP stdio negotiation smoke test, the installer CLI, plugin metadata consistency, and npm package contents. Relay tests use fake relays and signed fixtures, so they are deterministic and do not depend on public relay availability.
Preview the npm artifact without publishing it:
npm pack --dry-runPublishing
The npm name is @diegoyegros/nostr-mcp. A manual first release can be published with:
npm login
npm publish --access publicThe included prepublishOnly hook runs the full verification suite before publishing. Later releases can be automated by creating a GitHub release after configuring the repository's NPM_TOKEN secret. The release workflow publishes the package with npm provenance.
Security model
Read-only MCP tool annotations
No
nsecor raw private-key inputsSignature verification before events reach the agent
Strict relay URL validation to reduce SSRF risk
Bounded relay counts, result sizes, and timeouts
Relay provenance and per-relay errors in query results
See SECURITY.md for reporting and trust-boundary details.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceTrust-aware Nostr MCP server. 236 tools for identity, social, DMs, trust scoring, AI-to-AI dispatch, Lightning payments, privacy proofs, and encrypted vaults. NIP-46 bunker auth; keys never leave the signing device.701MIT
- AlicenseNot gradedqualityCmaintenanceA 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.13521MIT
- 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
Related MCP Connectors
Read-only Remote MCP for externally grounded AI agent trust receipts.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
MEOK ABCI Bridge MCP — read-only Tendermint / Cosmos blockchain query for agents. Built-in registry
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DiegoYegros/nostr-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server