Pixelworlds/inat-mcp-server
If you are the rightful owner of inat-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The iNaturalist MCP Server v0.2.0 provides structured access to the iNaturalist API, offering organized tools for various API categories, with automatic authentication and comprehensive documentation.
observations
Search, create, update, and manage observations.
taxa
Search and retrieve taxonomic information.
places
Geographic location data and place management.
projects
Project information and management.
identifications
Species identifications and suggestions.
users
User profiles and account information.
comments
Comments on observations and other content.
search
Universal search across all content types.
flags
Content flagging and moderation.
iNaturalist MCP Server v0.2.0
[!WARNING] > Development Status Notice
- The iNaturalist API calls are returning too much data currently causing most of the - requests to be rejected and causing the MCP server's clients to become unstable. - Not recommended for use yet.
A Model Context Protocol (MCP) server that provides access to the iNaturalist API through organized, category-based tools. Built for @richard-stovall/inat-typescript-client v0.2.0 with a completely rewritten architecture.
Features
- Automatic Authentication: Handles OAuth and API token flow automatically on startup
- Category-Based Tools: One tool per major API category for better organization
- Comprehensive Documentation: Rich prompts and resources explain all available endpoints
- Type-Safe: Full TypeScript implementation with proper error handling
- Token Management: Automatic token caching and refresh handling
Available Tools
The server provides 9 category-based tools, each containing multiple endpoints:
- observations - Search, create, update, and manage observations
- taxa - Search and retrieve taxonomic information
- places - Geographic location data and place management
- projects - Project information and management
- identifications - Species identifications and suggestions
- users - User profiles and account information
- comments - Comments on observations and other content
- search - Universal search across all content types
- flags - Content flagging and moderation
Each tool includes detailed documentation of its available methods, parameters, and usage examples.
Authentication
The server requires iNaturalist OAuth credentials and automatically handles the complete authentication flow:
- OAuth Token: Uses Resource Owner Password Credentials Flow to get access token from
https://www.inaturalist.org/oauth/token
- API Token: Uses access token to retrieve permanent API token from
https://www.inaturalist.org/users/api_token
- User Info: Preloads user information from
https://api.inaturalist.org/v1/users/me
for context
Required Credentials
client_id
: Your iNaturalist OAuth application client IDclient_secret
: Your iNaturalist OAuth application client secretusername
: Your iNaturalist usernamepassword
: Your iNaturalist password
Installation
# Install dependencies
yarn install
# Generate tools (analyzes v0.2.0 client structure)
yarn generate-tools
# Build the project
yarn build
Usage
Command Line
# Run with credentials
node dist/cli.js --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET --username YOUR_USERNAME --password YOUR_PASSWORD
# Environment variables
export INAT_CLIENT_ID="your_client_id"
export INAT_CLIENT_SECRET="your_client_secret"
export INAT_USERNAME="your_username"
export INAT_PASSWORD="your_password"
node dist/cli.js
Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"inaturalist": {
"command": "node",
"args": ["/path/to/inat-mcp-server/dist/cli.js"],
"env": {
"INAT_CLIENT_ID": "your_client_id",
"INAT_CLIENT_SECRET": "your_client_secret",
"INAT_USERNAME": "your_username",
"INAT_PASSWORD": "your_password"
}
}
}
}
Example Usage
Search for Observations
{
"name": "observations",
"arguments": {
"method": "observation_search",
"parameters": {
"q": "monarch butterfly",
"place_id": 97394,
"per_page": 10
}
}
}
Get Taxonomic Information
{
"name": "taxa",
"arguments": {
"method": "taxa_search",
"parameters": {
"q": "Danaus plexippus",
"rank": "species"
}
}
}
Search Places
{
"name": "places",
"arguments": {
"method": "places_search",
"parameters": {
"q": "Yellowstone National Park"
}
}
}
Documentation
The server provides rich documentation through:
- Prompts: Detailed guides for using each category of tools
- Resources: API reference documentation for all endpoints
- Examples: Practical usage examples for common tasks
Access documentation through the MCP protocol:
- List prompts:
prompts/list
- Get prompt:
prompts/get
with name like "observations-guide" - List resources:
resources/list
- Read resource:
resources/read
with URI like "docs://observations"
Development
Project Structure
src/
āāā generate-tools.ts # Tool generator for v0.2.0 client
āāā server.ts # Main MCP server implementation
āāā cli.ts # Command-line interface
āāā prebuild.ts # Build validation
dist/ # Compiled JavaScript output
Build Process
- Tool Generation: Analyzes the v0.2.0 client to extract all available methods
- TypeScript Compilation: Compiles to JavaScript with proper module resolution
- Validation: Ensures all required files and dependencies are present
Authentication Flow
The server implements a sophisticated three-step authentication process:
- OAuth Authentication: POST to
https://www.inaturalist.org/oauth/token
with username/password - API Token Retrieval: GET
https://www.inaturalist.org/users/api_token
with Bearer access token - User Information: GET
https://api.inaturalist.org/v1/users/me
with API token for context
All authentication happens automatically during server initialization. If authentication fails, the server gracefully falls back to read-only mode with access to all public data.
Error Handling
- Authentication Failures: Graceful fallback to read-only mode when credentials are invalid or authentication fails
- Network Issues: Robust error handling with detailed error messages for debugging
- API Errors: Structured error responses with HTTP status codes and helpful context
- Endpoint Resolution: Automatic detection of correct endpoints for OAuth vs API calls
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues related to:
- MCP Server: Open an issue in this repository
- iNaturalist API: Check the iNaturalist API documentation
- TypeScript Client: Check the @richard-stovall/inat-typescript-client package