Metadata-Version: 2.4
Name: ncbi-kg-mcp
Version: 1.0.1
Summary: MCP server for the NCBI Knowledge Graph - query 82K biomedical nodes via any LLM
Author: Monideep Chakraborti
License: MIT
Project-URL: Homepage, https://github.com/monideep2255/ncbi_ai_agents
Project-URL: Documentation, https://github.com/monideep2255/ncbi_ai_agents/blob/ncbi-kg/AGENTS_EXTERNAL.md
Project-URL: Bug Reports, https://github.com/monideep2255/ncbi_ai_agents/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp[cli]>=1.0.0
Requires-Dist: httpx<1.0.0,>=0.27.0
Dynamic: license-file

# ncbi-kg-mcp

MCP server for the [NCBI Knowledge Graph](https://github.com/monideep2255/ncbi_ai_agents) - a BioLink-compliant glucose metabolism graph with 82,517 nodes and 263,404 edges. Query genes, diseases, variants, proteins, pathways, and more from any LLM.

## Install

```bash
pip install ncbi-kg-mcp
```

## Configure

Add to your `.mcp.json` (Claude Code, Cursor, Cline, etc.):

```json
{
  "mcpServers": {
    "ncbi-kg": {
      "command": "ncbi-kg-mcp"
    }
  }
}
```

That's it. No API keys, no database credentials, no repo cloning needed.

## Tools (5)

| Tool | Input | Description |
|------|-------|-------------|
| `query` | `question: str` | Ask a natural language question - auto-translated to Cypher |
| `cypher` | `query_text: str` | Run a read-only Cypher query directly |
| `get_stats` | None | Get node and edge counts by type |
| `get_schema` | None | Get graph schema - node types, relationships, patterns |
| `get_neighbors` | `node_id: str` | Get 1-hop neighbors of a node (e.g., "NCBIGene:2645") |

## Example

Ask your LLM: *"What genes are associated with MODY?"*

The LLM calls the `query` tool, which translates to Cypher, executes against Neo4j, and returns a synthesized answer with raw data.

## Graph Data

- **8 node types**: Gene, Disease, SequenceVariant, BiologicalProcess, MolecularActivity, Protein, CellularComponent, Pathway
- **15 relationship types**: GENE_ASSOCIATED_WITH_CONDITION, IS_SEQUENCE_VARIANT_OF, CAUSES, INVOLVED_IN, ENABLES, and more
- **Sources**: NCBI Gene, ClinVar, MedGen, MONDO, GO, UniProt, Reactome

## Configuration

| Env Variable | Default | Description |
|-------------|---------|-------------|
| `NCBI_KG_API_URL` | `https://ncbi-kg-api-production.up.railway.app` | API base URL |

Override the API URL to point to a local backend:

```json
{
  "mcpServers": {
    "ncbi-kg": {
      "command": "ncbi-kg-mcp",
      "env": {"NCBI_KG_API_URL": "http://localhost:8001"}
    }
  }
}
```

## Links

- [Full documentation](https://github.com/monideep2255/ncbi_ai_agents/blob/ncbi-kg/AGENTS_EXTERNAL.md)
- [REST API reference](https://github.com/monideep2255/ncbi_ai_agents/blob/ncbi-kg/KG/PoC/documents/API_REFERENCE.md)
- [Live API docs](https://ncbi-kg-api-production.up.railway.app/docs)
