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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nmdc_mcp-0.6.0.tar.gz (93.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nmdc_mcp-0.6.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file nmdc_mcp-0.6.0.tar.gz.

File metadata

  • Download URL: nmdc_mcp-0.6.0.tar.gz
  • Upload date:
  • Size: 93.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nmdc_mcp-0.6.0.tar.gz
Algorithm Hash digest
SHA256 af2268e63f5ef07f83044f146fe8da37c4990a5c626458a5f21e2711a5c859c4
MD5 a31776d2bbdd81a8ed11a01188ca02bb
BLAKE2b-256 0e350fa1dc3bc045266c722be818f8ac406d252c9aca0e46bc284fa6c71e2011

See more details on using hashes here.

Provenance

The following attestation bundles were made for nmdc_mcp-0.6.0.tar.gz:

Publisher: pypi_publish.yaml on microbiomedata/nmdc-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nmdc_mcp-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: nmdc_mcp-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nmdc_mcp-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef97e5995f9d955348805103d8f59d28d62ff594092805f97fce5b3d11525483
MD5 b6b4f8e070f500dfdc7a65fc88c8808f
BLAKE2b-256 86128e0d6cd8bcaa8aa343cbae7ea2a524913bbd9387bf97821a89dec50f8269

See more details on using hashes here.

Provenance

The following attestation bundles were made for nmdc_mcp-0.6.0-py3-none-any.whl:

Publisher: pypi_publish.yaml on microbiomedata/nmdc-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page