EcoOracle
EcoOracle is an MCP server that retrieves canonical usage recipes and API cards from a registry of R/Python packages, enabling users to build scripts using ecosystem packages.
README
EcoOracle
EcoOracle is an MCP server plus registry pipeline for answering ecosystem questions across many R/Python packages. Primary goal: let users build new scripts outside package repos by retrieving canonical usage recipes and API cards.
It is designed so package onboarding is deterministic:
- package repo opts in with
.ecosystem.yml - package CI publishes
atlas-pack.tgzat release tageco-atlas eco-registrydiscovery updatesregistry.jsonnightly- MCP server loads registry and serves
eco_howto,eco_symbol,eco_packages,eco_where_used
Canonical registry repository: https://github.com/bbuchsbaum/eco-registry.
What Lives Here
packages/eco-oracle-mcp: MCP servertools/eco_atlas_extract.R: extract symbols/snippets/edgestools/eco_atlas_distill.mjs: distill snippets into microcardstools/eco-atlas.yml: package-side workflow template that builds and publishesatlas-pack.tgzeco-registry: registry repo and nightly discovery workflowschemas: data contracts for cards, symbols, edges, manifest, registry
End-to-End Flow
- Package repo includes
.ecosystem.yml. - Package workflow builds atlas files and publishes
atlas-pack.tgzto release tageco-atlas. eco-registry/.github/workflows/discover-registry.ymlruns nightly at04:00 UTC(and on manual dispatch).- Discovery script scans owner repos, finds
.ecosystem.yml, resolves release assets, and writeseco-registry/registry.json. - MCP server refreshes from registry and caches atlas packs locally.
- Claude/Codex sessions call the MCP tools to generate external scripts.
Add A New Package (Turnkey)
Do this in the target package repository.
Fastest path with an agent:
- ask:
Add this package to the ecosystem - if
eco-joinskill is available, it scaffolds the required files/workflow.
Fastest path from R:
# install.packages("remotes")
remotes::install_github("bbuchsbaum/eco-oracle")
library(ecooracle)
# initial scaffold
ecooracle::use_ecooracle()
# refresh workflow/tool templates later without hand edits
ecooracle::use_ecooracle(overwrite = TRUE)
# or run commit/push/workflow/discovery without prompts
ecooracle::use_ecooracle(
commit = TRUE,
push = TRUE,
run_workflow = TRUE,
run_discovery = TRUE
)
# check local onboarding health
ecooracle::check_health()
- Add
.ecosystem.ymlat repo root:
ecosystem: true
package: mypkg
language: R
role: transform
tags: [domain-tag, canonicalization]
entrypoints:
- mypkg::main_fn
- mypkg::read_input
# optional overrides (defaults shown)
release_tag: eco-atlas
asset: atlas-pack.tgz
- Add atlas tooling to the package repo:
- copy
tools/eco_atlas_extract.R - copy
tools/eco_atlas_distill.mjs - copy
.github/workflows/eco-atlas.ymlfromtools/eco-atlas.yml
If you use ecooracle::use_ecooracle(), these files are scaffolded for you. Re-run it with overwrite = TRUE to refresh an existing package to the current template set. The helper also fills placeholder role/tags/entrypoints from DESCRIPTION and NAMESPACE, and in interactive sessions it can ask whether to commit, push, trigger eco-atlas.yml, and trigger registry discovery.
- Configure package secrets:
OPENAI_API_KEYfor distillation step
- Push to
main(or run workflow manually):
- verify release tag
eco-atlascontains assetatlas-pack.tgz
- Wait for registry discovery (nightly) or trigger
discover-registrymanually ineco-registry. Example manual trigger:
gh workflow run discover-registry.yml --repo bbuchsbaum/eco-registry
- Verify package is in registry:
cat eco-registry/registry.json
- Verify MCP can load it:
node packages/eco-oracle-mcp/dist/index.js
# then call eco_refresh and eco_packages from your MCP client
No manual registry edits should be required in normal operation.
Manual Hints: Exactly Where To Put Them
If you want package-specific guidance to improve retrieval quality, put it in the package repository, not in eco-registry/registry.json.
Hard rule:
- Do not manually edit
eco-registry/registry.jsonfor package hints. - Nightly discovery rewrites
registry.json. - Manual edits there are temporary and will be lost.
Put hints in durable source locations in the package repo:
.ecosystem.yml- set
role,tags,entrypoints
- set
R/*.R- add
# ECO:howto ...markers above canonical snippets
- add
README.Rmd/vignettes/*.Rmd- include canonical code fences for real workflows
manual_cards.jsonl(optional, deterministic overrides)- add hand-authored microcards that are merged into final
atlas/cards.jsonl - if
idcollides with generated card id, manual card wins
- add hand-authored microcards that are merged into final
Manual cards file contract:
- File path:
manual_cards.jsonlat package repo root (default; override withECO_ATLAS_MANUAL_CARDS_PATH) - One JSON object per line
- Required fields per record:
q,a,recipe,symbols
- Optional fields:
id,tags,package,language,sources
Example manual_cards.jsonl line:
{"id":"manual.bidser.load_project","q":"How do I load a BIDS project in R?","a":"Use bidser::bids_project() on the dataset root, then inspect scans with func_scans().","recipe":"library(bidser)\nproj <- bidser::bids_project('/path/to/bids')\nscans <- bidser::func_scans(proj)","symbols":["bidser::bids_project","bidser::func_scans"],"tags":["bids","ingest"]}
Example # ECO:howto snippet:
# ECO:howto How do I load a BIDS project?
library(bidser)
proj <- bidser::bids_project("/path/to/bids")
scans <- bidser::func_scans(proj)
What gets overwritten by automation:
eco-registry/registry.jsonis regenerated by discovery.atlas/cards.jsonland releaseatlas-pack.tgzare regenerated by package atlas workflow.
What does not get overwritten:
.ecosystem.ymlcommitted in the package repo.# ECO:howtomarkers and package docs committed in the package repo.
Operational flow for manual hints:
- Commit hint changes in the package repo.
- Run/push package
eco-atlasworkflow so a newatlas-pack.tgzis published. - Wait for nightly discovery (or trigger it manually).
- Run
eco_refreshin client and verify behavior witheco_howto/eco_symbol.
Registry Automation Setup (Do Once In eco-registry)
Set these in the eco-registry GitHub repo:
- Secret:
GH_ORG_PAT
- token must read target owner repositories and push to
eco-registry
- Variable:
ECO_OWNER
- owner to scan, org or user (for example
bbuchsbaum)
- Optional variable:
ECO_ORG
- backward-compatible fallback
Discovery supports both GitHub orgs and users.
Run The MCP Server Locally
From this repo:
npm install
npm run build --workspace=packages/eco-oracle-mcp
node packages/eco-oracle-mcp/dist/index.js
Environment:
ECO_REGISTRY_URLorECO_REGISTRY_PATH(set at least one)ECO_GITHUB_TOKEN(optional, needed for private release assets)ECO_CACHE_DIR(optional, default~/.cache/eco-oracle)ECO_REFRESH_SECS(optional, default600)
Use From Claude Code
User scope:
claude mcp add --transport stdio eco-oracle --scope user -- npx -y eco-oracle-mcp
Project scope (.mcp.json):
{
"mcpServers": {
"eco-oracle": {
"type": "stdio",
"command": "npx",
"args": ["-y", "eco-oracle-mcp"],
"env": {
"ECO_REGISTRY_URL": "https://raw.githubusercontent.com/bbuchsbaum/eco-registry/main/registry.json",
"ECO_GITHUB_TOKEN": "${ECO_GITHUB_TOKEN}"
}
}
}
}
Copy-Paste Directive: Ecosystem-First (Compatible with oh-my-claude)
Use this in CLAUDE.md, AGENTS.md, or as the first message in a fresh Claude/Codex session:
## Internal package policy (eco-oracle MCP only)
This policy refers only to the `eco-oracle` MCP server.
Do not activate or invoke any other skill/mode (including `oh-my-claudecode:ecomode`) unless the user explicitly asks.
For R code, prefer ecosystem packages discovered via eco-oracle MCP.
Workflow is mandatory:
1. Call `eco_howto` first for each "How do I...?" subtask.
2. Call `eco_symbol` for each function you plan to use.
3. Use ecosystem packages/functions in final code.
Do not introduce non-ecosystem packages (for example `RNifti`, `oro.nifti`, `ANTsR`) unless:
1. eco-oracle returns no viable result, and
2. you explicitly ask for user approval before using external packages.
When answering, include:
1. `Ecosystem packages used: ...`
2. `Functions used: ...`
3. `Fallback needed: yes/no`
Quick prompt to reinforce behavior in any new session:
Use eco-oracle MCP as source of truth. Do not enable oh-my-claude modes/skills unless I explicitly request them. Ecosystem-only solution unless no match exists; if no match, ask me before using external packages.
Shortcut session opener (equivalent):
Enter ecosystem mode.
Use From Codex
User scope:
codex mcp add eco-oracle -- npx -y eco-oracle-mcp
Or in ~/.codex/config.toml:
[[mcp_servers]]
name = "eco-oracle"
command = "npx"
args = ["-y", "eco-oracle-mcp"]
[mcp_servers.env]
ECO_REGISTRY_URL = "https://raw.githubusercontent.com/bbuchsbaum/eco-registry/main/registry.json"
ECO_GITHUB_TOKEN = "${ECO_GITHUB_TOKEN}"
MCP Tools
eco_howto(query, ...)eco_symbol(symbol, ...)eco_packages(...)eco_where_used(symbol, ...)eco_refresh()
Operational Checklist
For each package:
.ecosystem.ymlpresent and valid.eco-atlasworkflow runs onmain.- Release tag
eco-atlashasatlas-pack.tgz.
For registry:
- Nightly discovery workflow succeeds.
registry.jsonupdates automatically.- New packages appear without manual edits.
For clients:
- MCP config points at correct registry URL/path.
eco_refresh()returns expected package/card/symbol counts.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.