A Model Context Protocol (MCP) server that provides Nostr capabilities to AI agents
Configuration
View docs{
"mcpServers": {
"austinkelsay-nostr-mcp-server": {
"command": "npx",
"args": [
"nostr-mcp-server"
]
}
}
}You can run a dedicated MCP server that exposes Nostr capabilities to language models and other clients, enabling powerful querying, note management, social actions, messaging, and anonymous operations within a single, pluggable service.
You interact with the Nostr MCP server by running it locally or remotely and connecting your MCP client to it. The server exposes a comprehensive set of tools for reading data from Nostr, managing profiles and keys, creating and publishing notes, handling generic events, social actions like following and reacting, direct messaging, anonymous operations, and NIP-19 entity handling. You can call these tools through your MCP client to perform tasks such as fetching profiles, posting notes, encrypting messages, or converting NIP-19 entities.
Prerequisites: you need a supported Node.js environment and a package manager to install and run the MCP server.
Option 1: Install from npm (recommended)
npm install -g nostr-mcp-serverOption 2: Install from source using Bun (recommended for development)
# Clone the repository
git clone https://github.com/austinkelsay/nostr-mcp-server.git
cd nostr-mcp-server
# Install dependencies
bun install
# Build the project
bun run buildOption 3: Install from source using npm
# Clone the repository
git clone https://github.com/austinkelsay/nostr-mcp-server.git
cd nostr-mcp-server
# Install dependencies
npm install
# Build the project
npm run buildTo enable Claude for Desktop to use the MCP server, place the MCP configuration inside Claude’s settings. If you installed via npm, use npx to run the server in your client configuration. If you built from source, reference the absolute path to the built index.js in your client configuration. The configuration anchors the MCP server under the nostr key with the appropriate command and arguments.
Example configurations shown in code blocks below illustrate how to wire the MCP server for both installation methods.
For npm installations, the configuration snippet is:
{
"mcpServers": {
"nostr": {
"command": "npx",
"args": [
"nostr-mcp-server"
]
}
}
}For source installations, the configuration should point to the built index.js file, using the absolute path to the built artifact:
{
"mcpServers": {
"nostr": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/nostr-mcp-server/build/index.js"
]
}
}
}If you also use Cursor or Goose as your MCP clients, add the same nostr server configuration to their MCP settings. The same npm-based or source-based wiring applies; you simply place the corresponding command and arguments in each client’s configuration and restart the client.
Fetches a user profile by public key.
Retrieves text notes authored by a user (kind 1).
Retrieves long-form content authored by a user (kind 30023).
Fetches zaps received by a user including detailed payment information.
Fetches zaps sent by a user including detailed payment information.
Fetches both sent and received zaps for a user with direction and totals.
Generic event query tool supporting kinds, authors, ids, tags, and timestamps.
Fetches a user's contact list and followed pubkeys.
Alias of getContactList.
Fetches a user's relay list metadata (NIP-65 kind 10002).
Generate new Nostr keypairs in hex and/or npub/nsec format.
Create a new Nostr profile (kind 0) with metadata.
Update an existing Nostr profile with new metadata.
Create unsigned kind 1 note events with content and tags.
Sign note events with a private key to generate valid signatures.
Publish signed notes to specified Nostr relays.
Authenticated note posting using an existing private key.
Create unsigned Nostr events of any kind for low-level building blocks.
Sign any unsigned Nostr event with a private key.
Publish any signed Nostr event to relays.
Publish relay list metadata (NIP-65).
Follow a pubkey by updating your contact list.
Unfollow a pubkey by updating your contact list.
React to an event (NIP-7).
Repost an event (NIP-6).
Delete events via a deletion request (NIP-5).
Reply to an event with proper NIP-10 threading.
Encrypt plaintext using NIP-04 for direct messages.
Decrypt NIP-04 ciphertext for direct messages.
Send a NIP-04 encrypted direct message (kind 4).
Fetch and optionally decrypt a NIP-04 DM conversation.
Encrypt plaintext using NIP-44 (ChaCha20 + HMAC).
Decrypt ciphertext using NIP-44 (ChaCha20 + HMAC).
Send a NIP-44 encrypted DM using NIP-17 gift wrap (kind 1059).
Decrypt a NIP-17 gift wrapped DM (kind 1059).
Fetch and decrypt your NIP-44 DM inbox (NIP-17).
Prepare an anonymous zap and generate a lightning invoice.
Post an anonymous note using a randomly generated one-time keypair.
Convert between NIP-19 entitites (hex, npub, nsec, note, nprofile, nevent, naddr).
Analyze and decode any NIP-19 entity to understand its type and contents.
Create unsigned kind 1 note events with content and tags.
Sign note events with a private key to generate valid signatures.