content-core
Content Core
通过统一的异步 Python API、CLI 或 MCP 服务器,从 URL、文件和文本中提取、处理和总结内容。
支持的格式
分类 | 格式 |
Web | URL、HTML 页面、YouTube 视频、Reddit 帖子 |
文档 | PDF、DOCX、PPTX、XLSX、EPUB、Markdown、纯文本 |
媒体 | MP3、WAV、M4A、FLAC、OGG (音频);MP4、AVI、MOV、MKV (视频) |
Related MCP server: FreeCrawl MCP Server
快速入门
pip install content-coreimport content_core
result = await content_core.extract_content(url="https://example.com")
print(result.content)或者无需安装:
uvx content-core extract "https://example.com"CLI 使用
Content Core 提供了一个统一的 content-core 命令,包含用于提取、总结和 MCP 服务器的子命令。
提取
# From a URL
content-core extract "https://example.com"
# From a file
content-core extract document.pdf
# With JSON output
content-core extract document.pdf --format json
# With a specific engine
content-core extract "https://example.com" --engine firecrawl
# From stdin
echo "some text" | content-core extract总结
# Summarize text
content-core summarize "Long article text here..."
# With context
content-core summarize "Long text" --context "bullet points"
# From stdin
cat article.txt | content-core summarize --context "explain to a child"MCP 服务器
content-core mcp配置
# Set persistent config
content-core config set llm_provider anthropic
content-core config set llm_model claude-sonnet-4-20250514
# List current config
content-core config list
# Delete a config value
content-core config delete llm_provider配置存储在 ~/.content-core/config.toml 中。优先级:命令标志 > 环境变量 > 配置文件 > 默认值。
使用 uvx 免安装
所有命令都可以使用 uvx 在不安装的情况下运行:
uvx content-core extract "https://example.com"
uvx content-core summarize "text" --context "one sentence"
uvx content-core mcpPython API
提取
import content_core
# From a URL
result = await content_core.extract_content(url="https://example.com")
# From a file
result = await content_core.extract_content(file_path="document.pdf")
# From text
result = await content_core.extract_content(content="some text")
# With engine override
from content_core import ContentCoreConfig
config = ContentCoreConfig(url_engine="firecrawl")
result = await content_core.extract_content(url="https://example.com", config=config)总结
import content_core
summary = await content_core.summarize("long article text", context="bullet points")配置
from content_core import ContentCoreConfig
config = ContentCoreConfig(
url_engine="firecrawl",
document_engine="docling",
audio_concurrency=5,
)
result = await content_core.extract_content(url="https://example.com", config=config)MCP 集成
Content Core 包含一个模型上下文协议 (MCP) 服务器,可用于 Claude Desktop 和其他兼容 MCP 的应用程序。
添加到你的 claude_desktop_config.json 中:
{
"mcpServers": {
"content-core": {
"command": "uvx",
"args": ["content-core", "mcp"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}MCP 服务器公开了两个工具:extract_content 和 summarize_content。两者都返回纯文本。
有关详细设置,请参阅 MCP 文档。
Claude Code 技能
Content Core 包含一个 SKILL.md,用于教导 AI 代理如何使用它从外部源提取内容。要使其在你的 Claude Code 项目中可用,请将其复制到你的技能目录:
# Download the skill
curl -o .claude/skills/content-core/SKILL.md --create-dirs \
https://raw.githubusercontent.com/lfnovo/content-core/main/SKILL.md安装后,Claude Code 可以使用 content-core 从 URL、文档和媒体文件中提取内容——可以通过 CLI (uvx content-core) 或配置后的 MCP 使用。
AI 提供商
Content Core 使用 Esperanto 来支持多个 LLM 和 STT 提供商。通过更改配置来切换提供商——无需更改代码:
# Use Anthropic for summarization
content-core config set llm_provider anthropic
content-core config set llm_model claude-sonnet-4-20250514
# Use Groq for transcription
content-core config set stt_provider groq
content-core config set stt_model whisper-large-v3支持的提供商包括 OpenAI、Anthropic、Google、Groq、DeepSeek、Ollama 等。请参阅 Esperanto 文档 获取完整列表。
配置
Content Core 使用由 pydantic-settings 驱动的 ContentCoreConfig。设置按优先级解析:构造函数参数 > 环境变量 (CCORE_*) > 配置文件 (~/.content-core/config.toml) > 默认值。
环境变量
变量 | 描述 | 默认值 |
| URL 提取引擎 ( |
|
| 文档提取引擎 ( |
|
| 并发音频转录 (1-10) |
|
| Crawl4AI Docker API URL (本地浏览器模式请留空) | - |
| 自托管实例的自定义 Firecrawl API URL | - |
| Firecrawl 代理模式 ( |
|
| 提取前的等待时间 (毫秒) |
|
| 用于总结的 LLM 提供商 | - |
| 用于总结的 LLM 模型 | - |
| 语音转文本提供商 | - |
| 语音转文本模型 | - |
| 语音转文本超时时间 (秒) | - |
| 首选 YouTube 字幕语言 | - |
外部服务的 API 密钥通过其标准环境变量设置(例如 OPENAI_API_KEY、FIRECRAWL_API_KEY、JINA_API_KEY)。
代理配置
Content Core 会自动读取标准的 HTTP_PROXY / HTTPS_PROXY / NO_PROXY 环境变量。无需额外配置。
可选依赖
# Docling for advanced document parsing (PDF, DOCX, PPTX, XLSX)
pip install content-core[docling]
# Crawl4AI for local browser-based URL extraction
pip install content-core[crawl4ai]
python -m playwright install --with-deps
# LangChain tool wrappers
pip install content-core[langchain]
# All optional features
pip install content-core[docling,crawl4ai,langchain]与 LangChain 一起使用
当安装了 langchain 扩展时,Content Core 提供与 LangChain 兼容的工具包装器:
from content_core.tools import extract_content_tool, summarize_content_tool
tools = [extract_content_tool, summarize_content_tool]文档
开发
git clone https://github.com/lfnovo/content-core
cd content-core
uv sync --group dev
# Run tests
make test
# Lint
make ruff许可证
本项目采用 MIT 许可证 授权。
贡献
欢迎贡献!详情请参阅我们的 贡献指南。
Available Tools
2 toolsextract_contentExtract ContentA
Extract content from a URL or file. Does not require an API key for most sources (web pages, PDFs, documents, YouTube transcripts). API key is only needed for audio/video transcription.
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to extract content from (web page, YouTube video, PDF link, etc.) | |
| engine | No | Optional extraction engine override, routed by input type. With `url`: auto, simple, firecrawl, jina, crawl4ai. With `file_path`: auto, simple, docling — `docling` requires `pip install "content-core[docling]"` and fails with a configuration error when the extra is missing, in which case use `auto` or `simple`. Any other value is rejected with an error naming the accepted ones. | |
| no_ocr | No | Disable OCR in Docling (requires engine=docling) | |
| formulas | No | Enable formula extraction via Docling (requires engine=docling) | |
| pictures | No | Enable image description + chart data extraction via Docling (requires engine=docling) | |
| file_path | No | Local file path to extract content from |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden; it usefully discloses the auth profile (no key needed for most sources, key needed for audio/video). It is silent on other behaviors: what happens if neither url nor file_path is supplied (0 required params), and whether unsupported sources error or degrade.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences, front-loaded with the core action, and the auth caveat placed immediately after. No filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described, and the auth context is a genuine addition. Still missing is guidance on the unusual 0-required-parameter shape (must one of url/file_path be given?) and any routing versus the sibling tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents engine routing, docling requirements, and the flag semantics in detail. The description adds only a loose mapping of source types, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Extract') and resource ('content from a URL or file') plus the supported source types. It does not explicitly differentiate itself from the sibling summarize_content, so an agent must infer that this returns raw content rather than a summary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives conditional guidance about when an API key is required (audio/video transcription only), which is useful. However, it never says when to choose this over summarize_content, nor does it explain the url-vs-file_path choice, leaving usage largely implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
summarize_contentSummarize ContentB
Summarize content using LLM with optional context. Requires OPENAI_API_KEY (or another LLM provider key) to be configured.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The text content to summarize | |
| context | No | Optional context to guide summarization (e.g., "summarize as bullet points") |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It usefully discloses a real prerequisite — an LLM provider key such as OPENAI_API_KEY must be configured — which is not in the schema. However it says nothing about cost, latency, or truncation behavior on long input, leaving gaps for a tool that calls an external LLM.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences with no filler, and the core purpose is front-loaded ahead of the setup requirement. Slightly terse, but every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists so return values need no explanation, and both parameters are schema-documented, making the definition largely adequate for a simple tool. The gaps are the absence of any routing guidance versus extract_content and the lack of cost/latency context for an external LLM call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both parameters are already fully documented, and the description adds nothing beyond restating that context is optional. Baseline 3 applies when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('summarize content') plus the mechanism ('using LLM'), which distinguishes it from the sibling extract_content at a high level. It does not explicitly name or contrast with that sibling, so it falls short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to choose this tool over extract_content, nor any exclusions or preconditions for use beyond the API-key note. The reader must infer that summarizing is the use case from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v2.1.1- Changed
extract_content6 fields changed- added
Input schema / properties / engine / descriptionAdded value: +"Optional extraction engine override, routed by input type.\nWith `url`: auto, simple, firecrawl, jina, crawl4ai.\nWith `file_path`: auto, simple, docling — `docling` requires\n`pip install \"content-core[docling]\"` and fails with a\nconfiguration error when the extra is missing, in which case use\n`auto` or `simple`.\nAny other value is rejected with an error naming the accepted ones." - added
Input schema / properties / file_path / descriptionAdded value: +"Local file path to extract content from" - added
Input schema / properties / formulas / descriptionAdded value: +"Enable formula extraction via Docling (requires engine=docling)" - added
Input schema / properties / no_ocr / descriptionAdded value: +"Disable OCR in Docling (requires engine=docling)" - added
Input schema / properties / pictures / descriptionAdded value: +"Enable image description + chart data extraction via Docling (requires engine=docling)" - added
Input schema / properties / url / descriptionAdded value: +"URL to extract content from (web page, YouTube video, PDF link, etc.)"
- Changed
summarize_content2 fields changed- added
Input schema / properties / content / descriptionAdded value: +"The text content to summarize" - added
Input schema / properties / context / descriptionAdded value: +"Optional context to guide summarization (e.g., \"summarize as bullet points\")"
2 tool updates
v2.0.4- Changed
extract_content9 fields changed- added
Input schema / additionalPropertiesAdded value: +false - added
Input schema / properties / engineAdded value: +{ + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null +} - added
Input schema / properties / formulasAdded value: +{ + "default": false, + "type": "boolean" +} - added
Input schema / properties / no_ocrAdded value: +{ + "default": false, + "type": "boolean" +} - added
Input schema / properties / picturesAdded value: +{ + "default": false, + "type": "boolean" +} - removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / propertiesAdded value: +{ + "result": { + "type": "string" + } +} - added
Output schema / requiredAdded value: +[ + "result" +] - added
Output schema / x-fastmcp-wrap-resultAdded value: +true
- Added
summarize_content
1 tool update
v1.0.0- Changed
extract_content2 fields changed- removed
Input schema / properties / file_path / titleRemoved value: -"File Path" - removed
Input schema / properties / url / titleRemoved value: -"Url"
1 tool update
- First observed
extract_content
TDQS
Scored across 2 tools
The two tools target clearly distinct actions: extract_content pulls raw content from a source, while summarize_content condenses it via an LLM. An agent can easily tell which to call based on whether it needs raw text or a summary.
Both names follow the same verb_noun snake_case pattern (extract_content, summarize_content), with no deviations in convention or style.
Two tools is on the thin side for even a focused server, though each earns its place in a natural extract-then-summarize pipeline. A couple of supporting operations (e.g. format conversion or output saving) would round out the surface.
The extract and summarize pair covers the core content-processing lifecycle, including multiple input sources (URLs, PDFs, YouTube). Minor gaps exist around batch processing, output formatting, or chunking, but agents can work around these.
Maintenance
Related MCP Connectors
PDF, DOCX and image URLs to clean, LLM-ready Markdown or text, with OCR for scanned pages.
Any URL to clean markdown/JSON; PDF, XLSX, CSV, DOCX to text and tables. Free tier for agents.
Extract structured insights from videos, podcasts, articles, and PDFs with multi-model AI
Extract and parse web pages into clean HTML, links, or Markdown. Handle dynamic, complex, or block…
Related MCP Servers
- AlicenseCqualityBmaintenanceA powerful tool for fetching and extracting text content from web pages and APIs, supporting web scraping, REST API requests, and Google Custom Search integration.511MIT
- AlicenseNot gradedqualityDmaintenanceEnables web scraping and document processing with JavaScript execution, anti-detection measures, batch processing, and structured data extraction. Supports multiple formats including markdown, HTML, screenshots, and handles PDFs with OCR capabilities.4MIT
- AlicenseBqualityCmaintenanceParse any file or URL into structured text. Extract text from PDF, DOCX, YouTube, web pages, images, and 25+ formats via one API. Tools: parse_url, parse_file, get_youtube_transcript.37 npmMIT
- AlicenseNot gradedqualityDmaintenanceConverts any URL into clean, LLM-ready Markdown, text, or HTML with production-grade features like SSRF protection, rate limiting, retries, caching, and structured error handling.MIT