feat: add iNaturalist MCP connector for biodiversity research#159
Open
MarsZDF wants to merge 3 commits intoStackOneHQ:mainfrom
Open
feat: add iNaturalist MCP connector for biodiversity research#159MarsZDF wants to merge 3 commits intoStackOneHQ:mainfrom
MarsZDF wants to merge 3 commits intoStackOneHQ:mainfrom
Conversation
- Add comprehensive iNaturalist API client with 12 tools for citizen science data access - Support observations, taxa, projects, places, and user data retrieval - Include conservation-focused features (threatened species, endemic status tracking) - Enable biodiversity analysis with species counts and taxonomic filtering - Provide geographic and temporal filtering for research applications - Support both authenticated and anonymous access patterns - Add comprehensive test coverage following repo conventions - Designed specifically for scientists and conservationists 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/mcp-connectors/src/connectors/inaturalist.spec.ts">
<violation number="1" location="packages/mcp-connectors/src/connectors/inaturalist.spec.ts:4">
The tests for this connector do not follow the established repository pattern of using `msw` to test tool handlers. This is a major deviation from the project's testing architecture, leaving the connector's core logic completely untested.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| import { describe, expect, it } from 'vitest'; | ||
| import { iNaturalistConnectorConfig } from './inaturalist'; | ||
|
|
||
| describe('iNaturalistConnectorConfig', () => { |
Contributor
There was a problem hiding this comment.
The tests for this connector do not follow the established repository pattern of using msw to test tool handlers. This is a major deviation from the project's testing architecture, leaving the connector's core logic completely untested.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/inaturalist.spec.ts at line 4:
<comment>The tests for this connector do not follow the established repository pattern of using `msw` to test tool handlers. This is a major deviation from the project's testing architecture, leaving the connector's core logic completely untested.</comment>
<file context>
@@ -0,0 +1,70 @@
+import { describe, expect, it } from 'vitest';
+import { iNaturalistConnectorConfig } from './inaturalist';
+
+describe('iNaturalistConnectorConfig', () => {
+ it('should have the correct basic properties', () => {
+ expect(iNaturalistConnectorConfig.name).toBe('iNaturalist');
</file context>
✅ Addressed in 7253d97
- Replace Promise<any> return types with specific interface types - Add proper type assertions following GitHub connector pattern - Ensure compatibility with Biome linter rules - All lint, typecheck, and tests now pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace basic config tests with proper tool handler testing - Add MSW server setup with realistic API mocking - Test all 12 tools with success and error scenarios - Include authentication testing for token-required operations - Add comprehensive mock data for observations, taxa, projects, users, places - Follow repository testing patterns (same as Strava/Zapier connectors) - 22 tests total covering all functionality Addresses review feedback about testing architecture compliance. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
@claude resolve conflicts |
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an iNaturalist MCP connector for accessing citizen science biodiversity data, with features that support scientists and conservationists.
🌿 Key Features
12 Tools for iNaturalist Data Access:
GET_OBSERVATIONS- Search observations with 15+ scientific parametersGET_OBSERVATION- Get specific observation detailsGET_SPECIES_COUNTS- Biodiversity analysis for conservation researchSEARCH_TAXA- Find species with conservation status informationGET_TAXON- Detailed taxon information including IUCN statusGET_PROJECTS- Find citizen science and conservation projectsGET_PROJECT- Project details and participation dataSEARCH_PLACES- Geographic location search for study areasGET_PLACE- Place details and boundariesGET_USER- User profile and contribution statisticsGET_CURRENT_USER- Authenticated user detailsCREATE_OBSERVATION- Submit new observations to iNaturalist🔬 Research-Friendly Features
Conservation and Research Support:
Use Cases:
✅ Production Ready
🚀 API Specifications
https://api.inaturalist.org/v1/Test plan
bun run test -- inaturalist.spec.ts)bun run typecheck)bun run check)🤖 Generated with Claude Code
Summary by cubic
Added an iNaturalist MCP connector to query biodiversity data and create observations. Supports research-grade filters, conservation metadata, and both authenticated and anonymous access.