# mcp_nostr

MCP server for the Nostr protocol. Connects directly to relays over WebSocket to
read and publish events, and manages the user's Nostr identities.

For querying already-ingested Nostr data, use `mcp_nostr_db` instead — this server
is for live relay interaction.

## Run

```bash
./run.sh
```

`run.sh` creates a local `.venv`, installs `requirements.txt`, and starts
`mcp_nostr.py`. It listens on the host/port from `config.json` (default
`127.0.0.1:8010`).

## Tools

- `connect_relay(url)` / `disconnect_relay(url)`
- `get_events(filter, url?)` — query relays with a Nostr filter
- `publish_event(event, url?)` — sign (as the active user) and publish
- `check_relays(urls, filter?)` — probe relay availability
- `add_user(name)` / `switch_user(name)` / `list_users()` — manage identities
- `set_alias(name, hash)` / `list_aliases()` — human-readable pubkey aliases

## Configuration

- `config.json` — `host`, `port`, and the default `relays` list.
- `users.json` — identities and their keys. **Contains private keys; keep it secret.**
- `aliases.json` — pubkey aliases.
