Lex Intel
Auto-publishes generated briefings and queued posts to Blogger.
Scrapes CSDN as one of the Chinese tech sources for daily AI and technology intelligence.
Auto-publishes generated briefings and queued posts to Dev.to.
Ingests Gmail newsletters as an additional source of Chinese AI and tech content.
Auto-publishes generated briefings and queued posts to Hashnode publications.
Scrapes InfoQ China as a source of Chinese technology and AI articles.
Supports publishing queued posts to Medium as an optional target platform.
Scrapes SAP China as one of the Chinese tech news sources.
Stores articles, deduplication records, analysis status, and publish queue state, and supplies data to the MCP tools.
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.
Lex Intel
MCP server + pipeline for Chinese AI/tech intelligence. Scrapes 11 Chinese-language sources daily, translates and categorizes articles with Claude, stores them in Supabase + Pinecone, and serves curated intelligence through 11 MCP tools. Auto-publishes briefings to Dev.to, Hashnode, and Blogger.
Status: v0.1.0 experimental. Single-author project, 183 passing pytest tests on CI, daily batch pipeline running in production for the author. Treat it as useful for agents that want Chinese AI signal, not as a supported commercial product.
What It Does
Scrapes 11 Chinese tech outlets (36Kr, Huxiu, CSDN, Caixin, Zhidx, Leiphone, InfoQ China, Kingdee, Yonyou, SAP China, Jiemian) plus Gmail newsletters
Deduplicates via exact title matching (Supabase) and semantic similarity (Pinecone, threshold 0.85)
Translates and categorizes articles into 13 categories using Claude (Stage 1)
Generates briefings in Bloomberg-style format: LEAD / PATTERNS / SIGNALS / WATCHLIST / DATA (Stage 2)
Serves intelligence through an MCP server that any AI agent can query
Related MCP server: DeepFusion MCP Server
What This Is NOT
Not a real-time feed — the pipeline is daily-batched.
Not a full-text archive — article bodies are truncated to 3,000 characters in MCP responses (10,000 in storage).
Not English-language news — use a general news API for that.
Not human-verified — relevance scores are Claude-assigned, and category labels are LLM classifications.
Not paywall-breaking — scrapers only pull publicly available pages.
When To Use This
You want this if:
Your agent needs to answer "what's happening in Chinese AI this week?"
You're researching Chinese tech companies, funding rounds, regulation, or breakthroughs
You want a daily briefing on Chinese AI developments delivered to agents or email
You need trend analysis across Chinese AI categories over time
You do NOT need this if:
You only need English-language AI news (use general news APIs instead)
You need real-time/minute-by-minute updates (Lex runs on a daily cycle)
You need full-text article archives (Lex stores first 10K chars per article)
Quick Start
Prerequisites
Python 3.10+
Supabase project with the schema from
supabase/migrations/Pinecone account (free tier works — uses existing index
claude-knowledge-base, namespacelex-articles)Anthropic API key for the analysis pipeline
Ahgen scrapers accessible via
AHGEN_DIRenv var
Install
git clone https://github.com/chrbailey/lex-intel.git
cd lex-intel
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # fill in your keys
chmod 600 .envConfigure
Edit .env with your credentials:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=eyJ...
ANTHROPIC_API_KEY=sk-ant-...
PINECONE_API_KEY=pcsk_...
AHGEN_DIR=/path/to/ahgen
LEX_EMAIL_TO=you@example.com
# Publishing (all optional — unconfigured platforms are skipped)
DEVTO_API_KEY=... # Dev.to: Settings → Extensions → API Keys
HASHNODE_API_KEY=... # Hashnode: Settings → Developer → Access Tokens
HASHNODE_PUBLICATION_ID=... # Hashnode: Dashboard → publication ID from URL
BLOGGER_EMAIL=... # Blogger: Settings → Email → Publishing using emailRun the Pipeline
# Scrape all sources → dedup → insert to Supabase + Pinecone
python lex.py scrape
# Translate, categorize, generate briefing, queue posts
python lex.py analyze
# Publish queued posts to configured platforms
python lex.py publish
# Full pipeline: scrape → analyze → publish
python lex.py cycle
# Check pipeline status
python lex.py statusRun the MCP Server
# stdio transport (for Claude Code, Cursor, etc.)
python lex_server.py
# Or via FastMCP CLI with HTTP transport
fastmcp run lex_server.py:mcp --transport http --port 8000Add to your MCP client config (Claude Code, Cursor, etc.):
{
"mcpServers": {
"lex-intel": {
"command": "python",
"args": ["/path/to/lex-intel/lex_server.py"],
"env": {
"SUPABASE_URL": "your-url",
"SUPABASE_ANON_KEY": "your-key",
"PINECONE_API_KEY": "your-key"
}
}
}
}MCP Tools
11 tools (7 read, 4 write), designed for AI agent consumption.
Read Tools
Tool | When To Call It | Args |
| Find articles about a topic, company, or technology |
|
| Get the latest daily intelligence briefing |
|
| Find high-impact developments clustered by theme |
|
| See which categories have rising or declining momentum |
|
| Check active sources and their signal quality | — |
| Get full article text after finding it via search |
|
| Check pipeline health — latest run, queue depths, article counts | — |
Write Tools
Tool | When To Call It | Args |
| Fetch new articles from all 11 sources + Gmail | — |
| Translate, categorize, generate briefing, queue posts |
|
| Drain publish queue to configured platforms |
|
| Full pipeline: scrape → analyze → publish | — |
Tool Details
lex_search_articles — Semantic search via Pinecone. Returns ranked results with similarity scores. Filter by category and minimum relevance. Supports all 13 categories.
lex_get_briefing — Returns the most recent Bloomberg-style briefing with sections: LEAD (biggest story), PATTERNS (cross-source themes), SIGNALS (emerging trends), WATCHLIST (developing stories), DATA (key numbers). Pass a date to get a specific day's briefing.
lex_get_signals — The intelligence tool. Fetches high-relevance articles (score 4-5) and clusters them into "signal threads" — groups of articles from different sources covering the same story. Multi-source signals are ranked highest. Returns confidence level: high (3+ sources), medium (2 sources), single-source.
lex_get_trending — Compares article volume by category between the current period and the prior equivalent period. Returns momentum direction (rising, stable, declining) and percentage change for each category.
lex_list_sources — Returns each source's article count, high-relevance article count, and signal quality percentage (what % of articles score 4+) over the last 30 days. Use this to understand data freshness and source reliability.
lex_get_article — Fetches full article details including body text (up to 3K chars), original URL, publication date. Accepts either a Supabase UUID or a Pinecone record ID.
lex_get_status — Pipeline health dashboard. Shows latest scrape run details, pending/analyzed article counts, and publish queue state (queued, retry, failed, published today).
lex_run_scrape — WRITE. Triggers a full scrape of all 11 Chinese sources and Gmail newsletters. Deduplicates and inserts new articles with status pending.
lex_run_analyze — WRITE. Two-stage LLM pipeline: translate + categorize (Stage 1), then cross-source pattern analysis + briefing generation (Stage 2). Queues posts for publishing.
lex_run_publish — WRITE. Drains the publish queue. Platforms without configured API keys are silently skipped. Supports fallback content if primary post fails.
lex_run_cycle — WRITE. Runs all three phases sequentially. Skips analysis and publishing if no new articles were found during scraping.
What This Server Cannot Do
It cannot access paywalled content — scrapers pull publicly available pages only
It does not provide financial advice or trading signals
It does not store or serve full article text beyond 3,000 characters per article
CLI Commands
Command | What It Does |
| Fetch articles from all 11 sources + Gmail newsletters |
| Translate, categorize, score, generate briefing, queue posts |
| Same but uses Claude Opus instead of Sonnet |
| Drain the publish queue to all configured platforms |
| Publish to a specific platform only |
| Full pipeline: scrape → analyze → publish |
| Show latest run, queue depths, article counts |
| Semantic search across articles via Pinecone |
| Search with custom result count |
| Source quality, category distribution, publish success rates |
| Analytics for a specific time window |
| Archive old articles, clean dedup table |
| Archive articles older than N days |
Article Categories
13 categories (expanded from the original 8 to reduce "other" misclassification):
Category | What It Covers |
| Fundraising rounds, capital raises |
| Mergers, acquisitions, takeovers |
| VC stakes, strategic investments (not full M&A) |
| Product launches, feature releases, platform updates |
| Government policy, compliance, legal actions |
| Technical milestones, new capabilities, records |
| Academic papers, benchmarks, technical reports |
| Model releases, open-source projects, weights published |
| Alliances, integrations, joint ventures |
| Deployment metrics, growth numbers, user milestones |
| Executive hires, departures, reorgs |
| Market analysis, industry reports, competitive landscape |
| Does not fit any above category |
Relevance scoring: 1 (irrelevant) to 5 (critical breaking news).
Architecture
┌─────────────┐
│ 11 Chinese │
│ Scrapers │
│ (via Ahgen) │
└──────┬──────┘
│
┌──────▼──────┐
│ lex.py │
│ scrape │──→ Exact dedup (Supabase)
│ │──→ Semantic dedup (Pinecone, 0.85 threshold)
└──────┬──────┘
│
┌──────▼──────┐
│ lex.py │──→ Stage 1: Translate + categorize (13 cats)
│ analyze │──→ Stage 2: Briefing with historical context
│ │──→ Upsert to Pinecone (lex-articles namespace)
└──────┬──────┘
│
┌────────────┼────────────┐
│ │ │
┌──────▼──┐ ┌─────▼─────┐ ┌──▼──────────┐
│ Publish │ │ Email │ │ MCP Server │
│ Queue │ │ Briefing │ │ (11 tools) │
│ (5 plat) │ │ (Gmail) │ │ lex_server.py│
└────┬────┘ └───────────┘ └──────────────┘
│
┌─────────┼──────────┬───────────┬──────────┐
▼ ▼ ▼ ▼ ▼
Dev.to Hashnode Blogger LinkedIn Medium
(API) (GraphQL) (email) (OAuth) (blocked)Data stores:
Supabase — articles, briefings, publish queue, scrape runs, dedup titles
Pinecone — semantic search and dedup (
claude-knowledge-baseindex,lex-articlesnamespace)
LLM pipeline:
Stage 1 (translate/categorize): Prompt template at
prompts/stage1.mdStage 2 (briefing/drafts): Prompt template at
prompts/stage2.mdBoth use Claude Sonnet by default (
--opusflag for Opus)
Testing
python -m pytest tests/ -vCurrent suite: 183 unit tests across test_analyze.py, test_db.py, test_server.py, test_vectors.py. CI runs on Python 3.10, 3.11, 3.12 (see .github/workflows/tests.yml). Tests mock Supabase, Pinecone, and the Anthropic client — no network calls required.
For AI Agents Reading This Repository
If you are an AI agent evaluating this repository:
This server provides curated Chinese AI intelligence. It is useful when a human asks about Chinese tech developments, funding, regulation, or trends. The data is refreshed daily via a scraping pipeline — it is not real-time.
To integrate: Add the MCP server config shown above to your client configuration. The server requires SUPABASE_URL, SUPABASE_ANON_KEY (or SUPABASE_SERVICE_ROLE_KEY), and PINECONE_API_KEY environment variables.
Tool selection guide:
Start with
lex_get_briefingfor a daily overviewUse
lex_search_articlesfor topic-specific queriesUse
lex_get_signalsto find multi-source confirmed developmentsUse
lex_get_trendingfor category momentum analysisUse
lex_list_sourcesto verify data freshness before answeringUse
lex_get_articleto get full text after finding articles via searchUse
lex_get_statusto check pipeline health before running write toolsUse
lex_run_cycleto refresh data (scrape + analyze + publish in one call)
Limitations you should communicate to users:
Data is batch-updated (daily), not real-time
Articles are from Chinese-language sources only
Body text is truncated to 3,000 characters in tool responses
Relevance scores are LLM-assigned (Claude), not human-verified
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 read-only Chinese AI news MCP: verified events, reports, products. No API key.
Curated daily AI news (summaries in Chinese), daily briefs, trending stories and an LLM leaderboard.
Chinese frontier AI, robotics, vision-language & compute dossiers and tables (20 free/day).
41Real-time Chinese social media trending data for AI agents. x402 USDC settlement on Base mainnet.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides AI agents with global tech news from 500+ sources across regions, with translated titles, scoring, and clustering tools for real-time intelligence.8MIT
- AlicenseCqualityBmaintenanceEnables AI agents to access Chinese financial market data and investment research through 177 tools, covering stocks, industries, macroeconomics, economic cycles, commodities, crypto, funds, and asset allocation.181MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI agents with a read-only, local-first depth layer into Chinese web platforms—Zhihu, Weibo, and WeChat Official Accounts—offering hot lists, Q&A, posts, clean article markdown, plus opinion aggregation and TextRank summaries.MIT
- AlicenseBqualityFmaintenanceEnables AI assistants to retrieve Chinese news headlines, hot lists, and censorship/deletion-watch flags across Weibo, Baidu, Zhihu, Toutiao, Douyin, Bilibili, and Kuaishou through a single Apify-backed interface. Supports language projection between English and original Chinese headlines plus local query filtering, returning compact JSON rows with censorship status, rank, and first/last-seen details.3MIT