search for standard sites pub-search.waow.tech
search zig blog atproto
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: fix READMEs with proper MCP setup commands

zzstoatzz 7fa1172b 78a4ddb3

+29 -45
+10
README.md
··· 12 12 2. **backend** indexes content into SQLite FTS5 via [Turso](https://turso.tech), serves search API 13 13 3. **site** static frontend on Cloudflare Pages 14 14 15 + ## MCP server 16 + 17 + search is also exposed as an MCP server for AI agents like Claude Code: 18 + 19 + ```bash 20 + claude mcp add-json leaflet '{"type": "http", "url": "https://leaflet-search-by-zzstoatzz.fastmcp.app/mcp"}' 21 + ``` 22 + 23 + see [mcp/README.md](mcp/README.md) for local setup and usage details. 24 + 15 25 ## api 16 26 17 27 ```
+19 -45
mcp/README.md
··· 2 2 3 3 MCP server for [Leaflet](https://leaflet.pub) - search decentralized publications on ATProto. 4 4 5 - ## installation 6 - 7 - ```bash 8 - uv add leaflet-mcp 9 - ``` 10 - 11 5 ## usage 12 6 13 - ### as a CLI 7 + ### hosted (recommended) 14 8 15 9 ```bash 16 - leaflet-mcp 10 + claude mcp add-json leaflet '{"type": "http", "url": "https://leaflet-search-by-zzstoatzz.fastmcp.app/mcp"}' 17 11 ``` 18 12 19 - ### with Claude Code 13 + ### local 20 14 21 - Add to your `.claude/settings.json`: 15 + run the MCP server locally with `uvx`: 22 16 23 - ```json 24 - { 25 - "mcpServers": { 26 - "leaflet": { 27 - "command": "uvx", 28 - "args": ["leaflet-mcp"] 29 - } 30 - } 31 - } 17 + ```bash 18 + uvx --from git+https://github.com/zzstoatzz/leaflet-search#subdirectory=mcp leaflet-mcp 32 19 ``` 33 20 34 - ## tools 35 - 36 - - `search(query, tag, limit)` - search documents and publications 37 - - `get_document(uri)` - get full document content by AT-URI 38 - - `find_similar(uri, limit)` - find semantically similar documents 39 - - `get_tags()` - list available tags with counts 40 - - `get_stats()` - get index statistics 41 - - `get_popular(limit)` - get popular search queries 21 + to add it to claude code as a local stdio server: 42 22 43 - ## example 23 + ```bash 24 + claude mcp add leaflet -- uvx --from 'git+https://github.com/zzstoatzz/leaflet-search#subdirectory=mcp' leaflet-mcp 25 + ``` 44 26 45 - ```python 46 - from fastmcp.client import Client 47 - from fastmcp.client.transports import SSETransport 27 + ## workflow 48 28 49 - async with Client(transport=SSETransport("http://localhost:8000/sse")) as client: 50 - # search for python articles 51 - results = await client.call_tool("search", {"query": "python"}) 29 + 1. **search** for documents by query or tag 30 + 2. **get_document** to retrieve full content by AT-URI 52 31 53 - # get full content of first result 54 - if results.data: 55 - doc = await client.call_tool("get_document", {"uri": results.data[0].uri}) 56 - print(doc.data.content) 32 + ``` 33 + search("space station") → [{uri: "at://...", title: "...", snippet: "..."}] 34 + get_document("at://...") → {title: "...", content: "full article text..."} 57 35 ``` 58 36 59 37 ## development 60 38 61 39 ```bash 62 - # install dev dependencies 63 - uv sync --group dev 64 - 65 - # run tests 40 + git clone https://github.com/zzstoatzz/leaflet-search 41 + cd leaflet-search/mcp 42 + uv sync 66 43 uv run pytest 67 - 68 - # format 69 - uv run ruff format 70 44 ```