Three ways to access knowledgelib.io programmatically: MCP server, REST API, or direct file access.
The fastest path for Claude, Cursor, and any MCP-compatible client.
{
"mcpServers": {
"knowledgelib": {
"command": "npx",
"args": ["knowledgelib-mcp"],
"env": {
"KNOWLEDGELIB_API_KEY": "your-api-key"
}
}
}
}
| Tool | Description | Parameters |
|---|---|---|
query_knowledge |
Semantic search across all knowledge units | query (string), domain (optional), limit (default: 3) |
get_unit |
Retrieve a specific knowledge unit by ID | unit_id (string) |
list_domains |
List all available domains and unit counts | None |
Base URL: https://knowledgelib.io/api/v1
# Free tier: 1,000 queries/month, no key required for public endpoints # Paid tier: API key in header curl -H "Authorization: Bearer YOUR_API_KEY" \ https://knowledgelib.io/api/v1/query?q=best+earbuds+2026
Semantic search across all knowledge units. Returns top matching units ranked by relevance.
# Request
GET /api/v1/query?q=best+wireless+earbuds+under+150&limit=3&domain=consumer_electronics
# Response
{
"query": "best wireless earbuds under 150",
"results": [
{
"id": "consumer-electronics/audio/wireless-earbuds-under-150/2026",
"canonical_question": "What are the best wireless earbuds under $150 in 2026?",
"confidence": 0.88,
"last_verified": "2026-02-07",
"relevance_score": 0.97,
"url": "https://knowledgelib.io/consumer-electronics/audio/wireless-earbuds-under-150/2026",
"raw_md": "https://knowledgelib.io/api/v1/units/consumer-electronics/audio/wireless-earbuds-under-150/2026.md",
"token_estimate": 1800
}
],
"total_results": 1,
"query_cost_tokens": 42
}
Retrieve the raw markdown of a specific knowledge unit. This is the most token-efficient way to consume a unit.
# Request GET /api/v1/units/consumer-electronics/audio/wireless-earbuds-under-150/2026.md # Response: raw markdown with YAML frontmatter # Content-Type: text/markdown; charset=utf-8
Retrieve a knowledge unit as structured JSON (frontmatter parsed into fields, body as string).
# Response
{
"id": "consumer-electronics/audio/wireless-earbuds-under-150/2026",
"metadata": {
"canonical_question": "What are the best wireless earbuds under $150 in 2026?",
"confidence": 0.88,
"last_verified": "2026-02-07",
"sources": [...],
...
},
"body": "# Best Wireless Earbuds Under $150 (2026)\n\n## Summary\n..."
}
Full catalog of all available knowledge units with metadata. No authentication required.
Discovery manifest describing the service, endpoints, and capabilities. No authentication required.
Every knowledge unit has a public web page. AI agents using web search + web fetch can consume units directly:
<meta name="ai:raw"> to get the raw .md URLThis requires zero setup. Any AI agent with web search capability can use knowledgelib.io.
Simple per-request pricing: $0.10 per query. Still a win — agents typically burn $0.50-$5.00 in compute to get the same answer from raw web.
| What you pay | What it replaces | Your saving |
|---|---|---|
| $0.10 / query | $0.50 - $5.00 in agent compute (3-5 web searches + parsing + reasoning) | 5x - 50x cost reduction |
MCP server queries are billed the same way — every MCP tool call = one API request.
Full OpenAPI 3.0 spec available at: /api/v1/openapi.json
Compatible with LangChain, CrewAI, AutoGen, and any framework that supports OpenAPI tool definitions.