Sagashi
Provides Reddit search through the official Reddit API, including query, time filter, and result limit parameters. Reddit URLs are handled via the official API, with reddit.com crawling blocked, and redd.it links routed through the API.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Sagashi π
Sagashi is a privacy-focused, self-hostable MCP (Model Context Protocol) server for web search, Reddit search, and page fetching. It gives MCP-compatible agents (llama.cpp, Claude, Cursor, and others) six tools: web search via the Uruky API, Reddit search via the official Reddit API, subreddit listing, thread batch fetching, clean Markdown page fetching via Crawl4AI, and YouTube transcript fetching via yt-dlp. Everything runs on your own host with your own API credentials; no queries or results are stored. The name comes from sagashi (ζγ, βsearchβ).
AI tools were used during development.
π§ How it works
flowchart LR
A[MCP client] -->|Streamable HTTP| B[Sagashi MCP server]
B -->|web_search| C[Uruky API]
B -->|search_reddit| D[Reddit official API]
B -->|list_subreddit_posts| D
B -->|fetch_reddit_threads| D
B -->|fetch_page| E[Crawl4AI / headless Chromium]
E -.->|"redd.it URLs"| DA single long-lived process serves six tools over Streamable HTTP. Search results are reranked before they reach the agent: when RERANKER_URL is set, a llama-server /v1/rerank cross-encoder scores each result's title and body against the query; otherwise a built-in lexical term-overlap scorer is used as fallback. Reddit URLs are routed deterministically: reddit.com and redd.it links are both served through the official API (thread title, selftext, and top comments) β the crawler never touches Reddit (ToS compliance).
Reddit Tools
Sagashi provides comprehensive Reddit integration via the official API:
search_reddit: Search across Reddit (default: r/all) or a specific subreddit with query-based searchlist_subreddit_posts: Browse posts from a subreddit with sorting and time filtering (supports Matomeru-style rolling 24-hour queries via explicit UTC time windows)fetch_reddit_threads: Efficiently fetch multiple threads in one call with structured data and per-item error handling
All Reddit operations use the official API only β no crawling, ensuring ToS compliance and fresh content.
YouTube Tool
fetch_youtube_transcript fetches a YouTube video's title and full transcript by pulling captions through yt-dlp. It prefers manual English captions and falls back to auto-generated English; the transcript is plain text with timing/formatting stripped. YouTube bot-checks the server's IP, so a cookies.txt file (Netscape format) is required β export it once with a browser extension (e.g. "Get cookies.txt LOCALLY") while signed in to YouTube and mount it into the container at YOUTUBE_COOKIES_FILE (see the example compose file).
Related MCP server: Findle
π οΈ Tools
Tool | Use for | Parameters |
| General web search queries |
|
| Reddit-specific questions or explicit Reddit requests |
|
| Browse posts from a specific subreddit |
|
| Fetch multiple Reddit threads efficiently |
|
| Fetching a specific URL |
|
| Fetching a YouTube video's title and transcript |
|
All tools return compact Markdown sized for agent context windows; large pages are truncated with a visible marker at the configured limit. Parameters are clamped server-side, so agents can freely adjust them.
π Quick start
Create a Reddit app at reddit.com/prefs/apps (script type) to get
REDDIT_CLIENT_IDandREDDIT_CLIENT_SECRET. Copyexample.envto.envand fill in the Uruky and Reddit credentials.Start the server:
uv sync --locked uv run sagashiPoint your MCP client at
http://localhost:8000/mcp. Verify everything works end-to-end with:just smoke # exercises every tool against the running server
Docker
Copy example.env to .env and fill in the required credentials, then start Sagashi with Compose:
docker compose up -dThe example docker-compose.yaml uses the published image from ghcr.io/divin/sagashi, publishes port 9092 (override with SAGASHI_PORT), and checks GET /healthz for container health. View logs with docker compose logs -f sagashi.
The container runs as a non-root user and includes headless Chromium for page fetching. GET /healthz is an unauthenticated health endpoint for container monitoring. The compose file also attaches the container to a shared external agents network for multi-service setups; remove the networks: blocks for a standalone deployment.
π Connecting an MCP client
The server speaks Streamable HTTP and is served under /mcp, so the URL to register in any MCP client is:
http://<host>:<port>/mcpDefaults are 127.0.0.1:8000 locally and 0.0.0.0:3000 in Docker (set via HOST and PORT). Binding details:
The container maps
PORT=3000internally; use-p <host-port>:3000to expose it, e.g.docker run -p 9092:3000 ...serveshttp://<host>:9092/mcp.Browser-based MCP clients connect cross-origin, so the server sends CORS headers. Restrict which origins may call it with
CORS_ORIGINS(comma-separated, default: allow all β fine for LAN use).
Most clients accept a URL directly, e.g. an mcpServers entry:
{
"mcpServers": {
"sagashi": {
"url": "http://192.168.1.10:9092/mcp"
}
}
}For clients that can run shell commands but lack native MCP support, the fastmcp CLI bridges the gap: fastmcp list http://<host>:9092/mcp to inspect tools, fastmcp call <url> web_search query=test to invoke them.
βοΈ Configuration
Variable | Required | Description |
| Yes | Uruky API token for web search |
| Yes | Reddit app client ID |
| Yes | Reddit app client secret |
| Yes | Reddit app user agent string |
| No | Bearer token for MCP access. When set, every request must carry |
| No | Truncation ceiling for page content (default: 40000) |
| No | Bind address (default |
| No | Comma-separated browser origins allowed to call the server (default: all) |
Missing required variables abort startup with a clear error; .env files are loaded automatically.
π Privacy
Reddit content only from the official API: crawling
reddit.comis hard-blocked to comply with Reddit's Terms of Service and to avoid IP flagging; even if an agent insists, the server refuses. See ADR 0001.Stateless: Sagashi is a search proxy. Queries, results, and fetched pages are not stored.
Your credentials, your host: outbound traffic goes only to Uruky, Reddit's API, and the pages you fetch.
Optional bearer auth: set
MCP_SEARCH_AUTH_TOKENand the server requiresAuthorization: Bearer <token>on every request; leave it unset for an open server, which is acceptable on a trusted local network. MCP clients pass the header directly (e.g. pi:pi mcp add search-tools --url http://host:8000/mcp --bearer-token-env-var MCP_SEARCH_AUTH_TOKEN).
π§ͺ Development
Use Python 3.12, uv, and just:
uv sync --dev
just # Format, lint, and sort imports
just check # Type, format, and lint checks
just test # Test suite
just smoke # Live smoke test against a running serverUnit tests mock all network access; the smoke test exercises real endpoints.
π¦ Releases
Tags trigger the CI pipeline: the test job runs checks and tests on every push and pull request, and version tags additionally publish a Docker image to GHCR and create a GitHub Release with generated notes. Check out Koebako and Koemichi for companion self-hosted projects.
π Credits
FastMCP for the MCP server framework
Crawl4AI for web crawling
asyncpraw for Reddit API access
Uruky for web search
π License
Apache License 2.0 β see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Free web search for AI agents. No API key required. Hosted MCP in active development.
Web search API and MCP server for developers building AI agents.
Docs: https://docs.keenable.ai/mcp-server Keenable is a free, remote MCP server that gives agents access to the web index. Search the web with ranked results and date/site filters, then fetch any indexed page as clean markdown. Works out of the box with no account or API key.
Web search and any page as LLM-ready Markdown for AI agents. Free keyless tier, no signup.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to perform multi-engine web search, fetch web pages, and extract clean Markdown content via MCP, with no API keys required.377 PyPI11MIT
- AlicenseNot gradedqualityDmaintenanceA fully local MCP server that provides web search via self-hosted SearXNG and page-to-markdown conversion (static and JS-rendered), all aggregated behind a single endpoint for use with AI assistants.MIT
- AlicenseAqualityCmaintenanceLocal MCP server for web search and page extraction, providing clean markdown from URLs, search results, site mapping, and research endpoints without API keys or accounts.5Apache 2.0
- AlicenseAqualityBmaintenanceA local-first MCP server that lets AI agents read any webpage as clean Markdown, crawl whole sites within configured limits, search without API keys, and solve supported captchas locally β all without cloud services or third-party keys.1221AGPL 3.0