Skip to main content

NMDC MCP

A fastmcp-based tool for writing prompts against data in the NMDC database.

Installation

You can install the package from source using uv:

uv sync

Usage

You can use the CLI:

nmdc-mcp

Or import in your Python code: # TODO incorrect instructions

from nmdc_mcp.main import create_mcp

mcp = create_mcp()
mcp.run()

Or utilize the nmdc_mcp.client. This client uses OpenAI API and assumes you have API_KEY set in a .env file in the root directory of this repo. The BASE_URL and MODEL are also customizable in .env. For PNNL staff that want to run via this client - the BASE_URL and MODEL are specific. Contact Olivia Hess if you need help setting these values up.

uv run 'path/to/nmdc_mcp/client.py' 'path/to/nmdc_mcp/main.py'

Or using python

python 'path/to/nmdc_mcp/client.py' 'path/to/nmdc_mcp/main.py'

Development

Local Setup

# Clone the repository
git clone https://github.com/microbiomedata/nmdc-mcp.git
cd nmdc-mcp

# Install development dependencies
make dev

Development Workflow

The project uses a comprehensive Makefile for development tasks:

# Run all development checks (tests, formatting, linting, type checking)
make all

# Individual commands
make dev           # Install development dependencies
make test-coverage # Run tests with coverage
make format        # Format code with black
make lint          # Lint with ruff
make mypy          # Type checking
make deptry        # Check for unused dependencies
make build         # Build package

Testing

# Run all tests with coverage
make test-coverage

# Run specific test types
make test-unit         # Unit tests only
make test-integration  # Integration tests
make test-real-api     # Tests against real NMDC API
make test-mcp          # Test MCP protocol

MCP Integration

Claude Desktop Setup

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "nmdc-mcp": {
      "command": "uvx",
      "args": ["nmdc-mcp"]
    }
  }
}

Claude Code MCP Setup

claude mcp add -s project nmdc-mcp uvx nmdc-mcp

Goose Setup

goose session --with-extension "uvx nmdc-mcp"

License

MIT

Metadata

Release files for nmdc-mcp 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nmdc-mcp 0.6.0
File Size Uploaded
nmdc_mcp-0.6.0.tar.gz 93.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nmdc-mcp 0.6.0
File Interpreter ABI Platform
nmdc_mcp-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 120.4 kB

Release files / nmdc_mcp-0.6.0.tar.gz

Download URL nmdc_mcp-0.6.0.tar.gz
Size 93.3 kB
Tags Source
SHA-256 checksum
How to use checksums
af2268e63f5ef07f83044f146fe8da37c4990a5c626458a5f21e2711a5c859c4
BLAKE2b-256 checksum
How to use checksums
0e350fa1dc3bc045266c722be818f8ac406d252c9aca0e46bc284fa6c71e2011
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.

Transparency log

Release files / nmdc_mcp-0.6.0-py3-none-any.whl

Download URL nmdc_mcp-0.6.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef97e5995f9d955348805103d8f59d28d62ff594092805f97fce5b3d11525483
BLAKE2b-256 checksum
How to use checksums
86128e0d6cd8bcaa8aa343cbae7ea2a524913bbd9387bf97821a89dec50f8269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page