MCP server (Claude Code / Codex tools)#
nicheverse ships an MCP server so agents
(Claude Code, Codex) can call the annotation and inference API as tools. The
server runs over stdio and lives in nicheverse.mcp_server.
Install#
pip install "nicheverse[mcp]" # adds the `mcp` runtime
# for the LLM annotation tool also install the LLM extra + set an API key
pip install "nicheverse[llm]"
export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY
Tools#
Tool |
What it does |
Returns |
|---|---|---|
|
Per-code markers / DEGs / distributions for a codebook column |
JSON summary (top 15 codes) |
|
LLM annotation of every code, optionally PubMed-grounded; writes a CSV |
Markdown label table |
|
Assign cell + neighborhood codebook indices from a checkpoint |
JSON code-usage summary |
|
PubMed literature search for a marker / cell-type call |
JSON hits |
Every tool takes an .h5ad path, loads it lazily, and returns a compact
summary (paths, counts, top rows), never raw matrices.
Register with Claude Code#
claude mcp add nicheverse -- \
/path/to/your/env/bin/python -m nicheverse.mcp_server
Use the interpreter that has nicheverse installed. After the --, everything
is the command Claude Code launches for the stdio server. Verify with
claude mcp list.
Register with Codex#
Add an entry under [mcp_servers] in ~/.codex/config.toml:
[mcp_servers.nicheverse]
command = "/path/to/your/env/bin/python"
args = ["-m", "nicheverse.mcp_server"]
(An installed console script nicheverse-mcp is also available; you can use it
as command = "nicheverse-mcp" with no args once the package is on PATH.)
Quick manual check#
/path/to/your/env/bin/python -m nicheverse.mcp_server
The process waits on stdio for a client; Ctrl-C to exit. For an import check:
python -c "from nicheverse.mcp_server import main; print('ok')"