Developer guide
Aggre serves every dataset it aggregates — Taiwan/China legal research, SEC medical & biotech filings, openFDA drug data, and market/insider signals — over the Model Context Protocol, so an MCP-aware agent can browse, search, and export it directly. Everything below also works as plain REST if you'd rather not run an MCP client at all.
Every MCP tool call and every REST call authenticates with the same Aggre API key. A key created from the console already carries every scope MCP needs — McpRead, DatasetRead, SearchRead, and ExportWrite — so there's nothing extra to request.
aggre_sk_… and only ever displayed once.Two ways to reach the same eleven tools — pick whichever fits your client.
Build the stdio server from the Aggre-Infra repo, then point your client's MCP config at the binary:
cargo build --release -p aggre-mcp
{
"mcpServers": {
"aggre": {
"command": "/absolute/path/to/Aggre-Infra/target/release/aggre-mcp",
"env": {
"AGGRE_API_BASE": "https://aggre.orbbit.ai",
"AGGRE_API_KEY": "aggre_sk_..."
}
}
}
}Set AGGRE_API_BASE explicitly. It defaults to http://127.0.0.1:8080 when unset — leaving it out silently points the server at your own machine instead of https://aggre.orbbit.ai.
Claude Code users can install the packaged skill instead of hand-writing the config:
git clone https://github.com/OrbbitAI/Aggre-MCP-Skill.git .claude/skills/aggre-mcp
No build step, no MCP client — just two endpoints. Either x-aggre-api-key or Authorization: Bearer works as the auth header.
curl -H "Authorization: Bearer aggre_sk_..." \ https://aggre.orbbit.ai/v1/mcp/tools
curl -X POST https://aggre.orbbit.ai/v1/mcp/call \
-H "Authorization: Bearer aggre_sk_..." \
-H "content-type: application/json" \
-d '{
"name": "retrieve",
"arguments": { "query": "動產擔保交易", "corpus": "laws", "top_k": 5 }
}'Eleven tools, gated by the same scopes a default API key already has. Arguments are strict — an unknown argument name is a hard error, not a silent ignore.
list_datasetsDatasetReadBrowse the catalog — every dataset your key can read, optionally filtered.
category?, tags?, query?get_dataset_schemaDatasetReadInferred field schema for a dataset, with sensitive fields flagged.
dataset_id!, limit? (1–100)get_recordDatasetReadFetch one record by id.
id? | record_id?search_datasetSearchReadKeyword search scoped to a single dataset.
dataset_id!, query!, limit? (1–50)retrieveSearchReadTwo-stage semantic (RAG) search across a corpus — see below for detail.
query!, corpus?, jurisdiction?, dataset?, top_k?, depth?, candidates?, threshold?, rerank_chars?, stage1_timeout_secs?get_politician_tradesSearchReadUS Senate STOCK Act disclosures.
(no required arguments)get_investor_holdingsSearchRead13F holdings for a tracked fund/investor.
investor!get_insider_tradesSearchReadSEC insider transaction filings.
(no required arguments)who_tradedSearchReadEvery tracked trade (politician + insider) touching one ticker.
ticker!export_sampleExportWriteSmall sample export for eyeballing shape/quality before a real pull.
dataset_id!, limit? (1–100)export_datasetExportWriteBulk, paginated export.
dataset_id!, limit? (1–2000, default 500), offset?retrieve is the semantic (RAG) search tool — a two-stage pipeline (trigram recall, then a reranker) over whichever corpus you pick, rather than an exact-keyword match.
lawsjudgmentsbothmedicalmedical-lawsmedical-judgmentsdrug-labelsfda-safetysec-filings510kdevice-summariesdevice-classificationTW (default), CN, or US — narrows a corpus that spans more than one jurisdiction (US-only corpora ignore this).
Every response carries complete, timed_out, and recall_only. A large or common-term query can fall back to an unordered recall sample rather than a fully ranked one — check these three fields before treating results as exhaustive or perfectly ordered. Each hit carries rerank_score, lexical_score, a snippet, and full source citation fields (court, case_number, law_name, article_no, source_url, and more, depending on corpus).
Live record counts and search capability for every dataset, refreshed hourly from the same census the console itself uses — not a hand-maintained list that drifts out of date.
Sign in to see the exact datasets and live record counts your account can query — this list is scoped to your org's own datasets plus anything it's subscribed to.