Metadata-Version: 2.4
Name: ncbi-mcp
Version: 0.1.1
Summary: NCBI E-utilities MCP server for accessing NCBI databases
Home-page: https://github.com/goki/ncbi-mcp
Author: goki
Author-email: 654051206@qq.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Requires-Dist: python-dotenv>=0.19.0
Requires-Dist: mcp>=1.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# NCBI E-utilities MCP Server

A Machine Capability Protocol (MCP) server for accessing NCBI E-utilities API. This package provides programmatic access to NCBI databases including PubMed, Protein, Nucleotide, and more.

## Features

- **EInfo**: Get list of Entrez databases or statistics for a specific database
- **ESearch**: Text-based search to retrieve UID lists from NCBI databases
- **ESummary**: Retrieve document summaries (DocSum) for UIDs
- **EFetch**: Fetch full formatted records for UIDs (core functionality)

## Connect to Your MCP Client

You can use the npx command to connect to your NCBI MCP server from local MCP clients.

To connect to your MCP server from Claude Desktop or other MCP-compatible clients, follow the MCP client setup guide and update the client configuration.

Update your MCP client configuration with this configuration:

```json
{
  "mcpServers": {
    "ncbi-mcp": {
      "command": "uvx",
      "args": [
        "run",
        "ncbi-mcp"
      ],
      "env": {
        "API_KEY": "YOUR_NCBI_API_KEY"
      },
    }
  }
}
```

**Note**: Without an API key, your requests are limited to 3 requests per second. With an API key, you can make up to 10 requests per second.

### Getting an NCBI API Key

To get an NCBI API key, you need to:

1. Register for an NCBI account at [https://www.ncbi.nlm.nih.gov/account/](https://www.ncbi.nlm.nih.gov/account/)
2. Go to your account "Settings" page
3. Find the "API Key Management" area and click "Create an API Key"
4. Copy the generated key and use it in your `.env` file

For more information about NCBI API keys, visit: [https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/)

## Tools Available

### EInfo
- Description: Query NCBI databases, get database statistics
- Parameters: db_name (optional), retmode (default: xml)

### ESearch
- Description: Search for content by term in specified database
- Parameters: db_name (default: pubmed), term (search query)

### ESummary
- Description: Get summary information for specified IDs
- Parameters: db_name (default: pubmed), ids (list of IDs)

### EFetch
- Description: Get complete records for specified IDs
- Parameters: db_name (default: pubmed), ids (list of IDs), retmode (default: xml), rettype (default: abstract)

## Environment Variables

The server automatically retrieves the following configurations from environment variables:

- `API_KEY`: NCBI API key (recommended for higher rate limits)

## Requirements

- Python >= 3.12
- NCBI API key (recommended for higher rate limits)

## License

MIT
