knowledge-forge-mcp
Enables AI coding tools to turn a list of links into a verified, browsable knowledge base with grounded summaries via MCP tools for update, validation, and enrichment.
README
knowledge-forge
Turn a plain list of links (videos, posts, repos, articles) into a verified, browsable knowledge base — and let your AI coding tool enrich it with grounded, hallucination-checked summaries.
It ships three ways to drive the same pipeline so it works with any AI tool:
- a CLI (
knowledge-forge ...) - an MCP server (
knowledge-forge-mcp) for Cursor, Claude Code, Claude Desktop, etc. - portable skills + editor hooks
What it does
links.txt ──▶ extract (yt-dlp / whisper / youtube-transcript)
──▶ classify into categories + pull verified learnings
──▶ videos.json ──▶ generate a category/detail canvas (.canvas.tsx)
──▶ [optional] rule-based enrichment + an agent queue
──▶ agent writes 300-1000 word grounded summaries
──▶ validate (anti-hallucination gate) ──▶ apply ──▶ refresh
Key idea: summaries are grounded. A validator enforces word count, per-paragraph token overlap with the source material, source-URL provenance, and a no-engagement-bait rule — so the agent can't invent facts, repos, or URLs.
Capture: send a link, get a knowledge entry
The hardest part of any knowledge base is capturing the link the instant you see
its value. knowledge-forge ingest <url> is the one-shot front door: it appends
the URL, scrapes + classifies it, and queues it for a grounded summary.
knowledge-forge ingest "https://www.youtube.com/watch?v=..." # one link, fully processed
Wire it to Telegram so you can capture from your phone while scrolling — share
a reel to your bot and it lands in the base automatically. Use the standalone bot
in integrations/telegram/, or, if you already run Hermes or any
Telegram-connected agent, just give that agent the knowledge-forge ingest <url>
tool and let it handle the chat. See integrations/telegram/README.md.
share a link to Telegram ──▶ bot / Hermes extracts the URL
──▶ knowledge-forge ingest <url>
──▶ scrape + classify + queue ──▶ searchable entry
Discover & install (not just enrich)
Once the base is built, search it for a use case and get the recommended best practice plus the tools/skills to install — all grounded in the source videos:
knowledge-forge search "cut Claude Code token cost" --limit 5
Each hit returns a grounded snippet, the source links, any installCommands
and recommendedTools extracted verbatim from that video (e.g. a pip install
line or a GitHub repo), and a needsScrape flag when the entry is too thin and the
source should be transcribed + enriched for a fuller answer. This turns the base
into a recommender: "how do I improve X?" → best practice + the exact skill/tool to
install, cited to the video. Commands are only ever surfaced when present in the
source — never fabricated.
Localhost web UI (browse + search)
pip install "knowledge-forge[all,web]"
knowledge-forge serve # http://localhost:8077
knowledge-forge serve --no-bridge # web only
Category catalogue, detail view, and Mode B search in the browser. Docker: docker compose up -d — see integrations/docker/README.md. Enable Docker Desktop start-on-login for auto-resume + Telegram backlog drain.
Enrich with a local model (no IDE/agent required)
The agent-written summary step doesn't have to run inside an AI IDE. Point it at a local model served by Ollama and a background worker drains the queue on its own — the same deterministic validator (word count, per-paragraph grounding, no bait, no invented URLs) gates every summary, so only grounded text is ever saved.
ollama pull gemma3:4b
knowledge-forge enrich-worker # loop: find queued entries → local model → validate → apply
knowledge-forge enrich-worker --once # single drain pass
Combine with the web UI + Telegram bridge (and Docker) for a fully local loop:
send a link → scrape/classify → local model writes a grounded summary → live in
the UI, with no cloud calls and nothing tied to a specific editor. Tune with
KB_ENRICH_MODEL, KB_ENRICH_INTERVAL, KB_ENRICH_BATCH, KB_ENRICH_ATTEMPTS,
and OLLAMA_HOST.
Install
pip install "knowledge-forge[all]" # CLI + MCP + extraction + transcription
# or pick extras: .[extract] .[transcribe] .[mcp]
Core has no third-party dependencies; the extras add yt-dlp,
youtube-transcript-api, faster-whisper, and mcp.
Quick start
knowledge-forge init # scaffold config + folders in the current dir
# ... add URLs to links.txt (see samples/links.sample.txt) ...
knowledge-forge update # extract + classify + build the canvas
knowledge-forge run # rule-based enrich + build the agent queue
knowledge-forge queue # see what needs an agent-written summary
# agent writes payload.json, then:
knowledge-forge validate --file payload.json
knowledge-forge apply --file payload.json
Generate a one-command launcher for your OS:
knowledge-forge bootstrap --write # writes kf.ps1+kf.bat (Windows) or kf.sh (macOS/Linux)
Configuration
Everything is path-driven via knowledge-forge.json (see config.example.json).
All relative paths resolve against the config file's directory — no machine- or
OS-specific paths are baked in. The config is auto-discovered by walking up from
the CWD, or set KNOWLEDGE_FORGE_PROJECT / KNOWLEDGE_FORGE_CONFIG.
| Key | Default | Meaning |
|---|---|---|
linksFile / linksDir |
links.txt / knowledge-base/links |
inputs |
dataFile |
knowledge-base/videos.json |
the knowledge store |
transcriptsDir |
knowledge-base/transcripts |
cached transcripts |
queueFile |
knowledge-base/.agent-enrich-queue.json |
agent work queue |
canvasOutput |
knowledge-base/canvas/knowledge-base.canvas.tsx |
generated UI |
enrichMinSummaryWords / MaxSummaryWords |
300 / 1000 |
summary gate |
agentEnrichBatchSize |
5 |
entries per agent batch |
Use it from your AI tool
| Tool | MCP | Hooks | Skills |
|---|---|---|---|
| Cursor | integrations/cursor/mcp.json |
integrations/cursor/hooks* |
skills/* → .cursor/skills/ |
| Claude Code | integrations/claude-code/.mcp.json |
— | skills/* → .claude/skills/ |
| Telegram / Hermes | kf_ingest tool |
integrations/telegram/bridge.py |
— |
| Docker (localhost UI) | — | docker compose up |
integrations/docker/README.md |
| any MCP client | run knowledge-forge-mcp |
— | — |
MCP tools: kf_ingest, kf_search, kf_update, kf_refresh, kf_run, kf_queue, kf_list, kf_validate, kf_apply.
CLI also ships knowledge-forge serve / knowledge-forge-serve for the web UI at localhost:8077, and knowledge-forge enrich-worker / knowledge-forge-enrich for local-model enrichment.
See integrations/<tool>/README.md for copy-paste setup.
Project layout
knowledge_forge/ core package (config, pipeline, classify, verify, enrich, canvas, cli)
mcp_server/ FastMCP stdio server
skills/ tool-agnostic SKILL.md files
integrations/ per-tool hooks + MCP config + setup docs
samples/ anonymized example links + data
config.example.json starter config
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。