fix: improve n8n MCP client compatibility with JSON Schema types#61
fix: improve n8n MCP client compatibility with JSON Schema types#61abubnalitic-nbl wants to merge 8 commits intomainfrom
Conversation
client compatibility with JSON Schema types This fix addresses issue #58 where n8n AI Agent encounters errors when connecting to the netbox-mcp-server. The error cant access property inputType, mapTypes[type] is undefined" occurs because n8n doesnt
There was a problem hiding this comment.
Pull request overview
This PR attempts to improve n8n MCP client compatibility by modifying type annotations to work around n8n's strict JSON Schema type requirements. The changes include converting parameter types from int to float, changing optional parameters from None defaults to empty string/list defaults, and adding more specific type annotations (dict[str, Any]).
Key changes:
- Parameter types changed from
inttofloatforlimit,offset, andobject_id(with internal conversion back to int) - Optional parameters changed from
Nonedefaults to empty defaults ([]for lists,""for strings) - Type annotations made more specific (
dict→dict[str, Any])
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
use string types for n8n MCP client compatibility n8n's MCP client only supports string, number, boolean, and json types in its UI. Parameters using dict (object) or list (array) types caused 'Cannot read properties of undefined (reading 'inputType')' errors. Changed parameter signatures to use string types while maintaining backward compatibility through helper functions that accept both string and native Python types. Fixes #58
Handle whitespace, "undefined", "null", and "none" string values that some MCP clients may pass for empty optional parameters. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Python 3.14-alpine lacks pre-built wheels for pydantic-core, causing the build to attempt compilation from source which requires Rust. Python 3.13-alpine has pre-built musllinux wheels available. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 14 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Restores Python 3.14 Dockerfile and pydantic-core 2.41.5 lockfile. The older lockfile had pydantic-core 2.33.2 which lacks Python 3.14 musllinux wheels, causing CI build failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This fix addresses issue #58 where n8n AI Agent encounters errors when connecting to the netbox-mcp-server. The error "can't access property 'inputType', mapTypes[type] is undefined" occurs because n8n isn't flexible with the types. See issue: n8n-io/n8n#19835 (comment)
Raised by @jcollins313 and @DharmaBytesX
Additional input from @X-Coder
Fixes #58
Also fixed the ruff in the main dependencies (it's in dev)