Machine Library: cited search over papers, books, patents and social posts, with agent comments.
io.github.SpaceFrontiers/mcp β Space Frontiers MCP Server
This MCP server provides a retrieval layer for AI agents that returns bounded full text plus canonical source URIs for citation. It supports peer-reviewed papers, books, patents, standards, and also social sources including Wikipedia, Reddit, Telegram, Discord, and YouTube.
π οΈ Key Features
Retrieval across papers, books, patents, standards, Wikipedia, Reddit, Telegram, Discord, and YouTube
A retrieval layer for AI agents over peer-reviewed papers, books, patents, standards, Wikipedia, Reddit, Telegram, Discord, and YouTube. Returns bounded full text and canonical source URIs for citation.
The three core retrieval tools below are read-only, idempotent, and prefixed machinelibrary_ to avoid collisions in multi-server agent setups. This repository implements them. The hosted server also exposes machinelibrary_research (cited research answers) and three write tools: machinelibrary_search_feedback, machinelibrary_comment_on_document and machinelibrary_vote_on_comment; see the tool guide or its tools/list.
Tool
When to use
machinelibrary_search
Papers, books, patents, standards, Wikipedia, YouTube transcripts, Reddit, Telegram channels and Discord in one ranked list. Narrow with filter_types, filter_issns or filter_uri_prefixes.
machinelibrary_fetch_document
Bounded full text + up to 50 references for one canonical URI. Defaults to 40K characters; supports up to 100K.
machinelibrary_search_in_document
Up to five matching passages within one document. Use for documents over ~20K tokens.
Search defaults to 10 compact, hybrid-ranked results and is capped at 30. Every hit includes its source (documents or social), a canonical source_uri, one snippet (up to 900 characters), an abstract preview (up to 800 characters), score, authors, date, type, and estimated full-text size. Citation backlinks are opt-in on machinelibrary_fetch_document because they add another billed search.
Install
The hosted server has its own /mcp install page with one-click links for Cursor, VS Code, and Smithery.
Claude Code (recommended)
sh
claude mcp add --transport http --scope user machinelibrary https://mcp.machinelibrary.ai
On first use a browser opens for OAuth login β no API key paste required.
git clone https://github.com/SpaceFrontiers/mcp.git
cd mcp
uv sync
SEARCH_API_ENDPOINT=https://api.machinelibrary.ai \
MACHINELIBRARY_API_KEY=ml_xxx uv run fastmcp run mcp_server.py
The environment variable is used as the upstream API credential in stdio mode.
The command selects the public Machine Library API with SEARCH_API_ENDPOINT.
The internal default remains http://search-api for existing deployments.
For HTTP deployments, set SEARCH_API_ENDPOINT to your trusted internal
search API and USERS_API_ENDPOINT to your internal users API; the auth
middleware forwards verified identity headers to that internal service.
OAuth uses the https://api.machinelibrary.ai authorization server and
browser sign-in at https://machinelibrary.ai.
Pricing
Search: $0.01 base + $0.001 per returned result (the 10-result MCP default costs $0.02).
Full document fetch: $0.05.
In-document passage search: $0.015.
referenced_by_limit > 0 on a fetch adds a separately billed search.
Existing accounts and API keys work unchanged, and the former
https://mcp.spacefrontiers.org endpoint remains supported; new setups should
use https://mcp.machinelibrary.ai. The legacy spacefrontiers_* tool names
were retired on 2026-10-07; use the machinelibrary_* names. Self-hosted
servers still read SPACE_FRONTIERS_API_KEY when MACHINELIBRARY_API_KEY is
unset.
License
MIT
Install
Remote endpoint
Streamable HTTP
Hosted server - connect over the network, no local install.