Skip to content

fix: improve n8n MCP client compatibility with JSON Schema types#61

Open
abubnalitic-nbl wants to merge 8 commits intomainfrom
fix/n8n-type-compatibility
Open

fix: improve n8n MCP client compatibility with JSON Schema types#61
abubnalitic-nbl wants to merge 8 commits intomainfrom
fix/n8n-type-compatibility

Conversation

@abubnalitic-nbl
Copy link
Contributor

@abubnalitic-nbl abubnalitic-nbl commented Jan 8, 2026

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)

   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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 int to float for limit, offset, and object_id (with internal conversion back to int)
  • Optional parameters changed from None defaults to empty defaults ([] for lists, "" for strings)
  • Type annotations made more specific (dictdict[str, Any])

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

abubnalitic-nbl and others added 3 commits January 28, 2026 12:23
   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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

abubnalitic-nbl and others added 2 commits January 28, 2026 14:14
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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when connecting to containerized netbox-mcp-server

2 participants