Skip to content

Conversation

@mimomenome
Copy link

Introduces a --sample CLI argument and NEO4J_SAMPLE environment variable to control the sample size used in APOC schema inspection queries. This allows limiting the number of nodes scanned for schema operations, improving performance on large graphs. Includes updates to config processing, server logic, and unit tests for sample precedence and validation.

Description

Type of Change

  • [x ] New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

  • [ x] LOW
  • MEDIUM
  • HIGH

Complexity:

How Has This Been Tested?

  • [ x] Unit tests
  • Integration tests
  • [x ] Manual tests

NOTE
Manual tests consist of using the build python module in another project to confirm MCP server still functions, schema is loaded when sample setting is None, and when setting is set to a value. Schema appears to be reduced in size when set to a low value (eg 1), but this has not been validated against an actual large graph to determine effect of reducing the sample size.

An additional improvement would be to add full logging of resulting schema node/property counts, and possibly expose an MCP tool that helps the user test which sample size produces optimal schema with enough context to inform cypher generation without requiring long load time.

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • [ x] Documentation has been updated
  • [ x] Unit tests have been updated
  • Integration tests have been updated
  • [ x] Server has been tested in an MCP application
  • CHANGELOG.md updated if appropriate

Introduces a --sample CLI argument and NEO4J_SAMPLE environment variable to control the sample size used in APOC schema inspection queries. This allows limiting the number of nodes scanned for schema operations, improving performance on large graphs. Includes updates to config processing, server logic, and unit tests for sample precedence and validation.
Updating readme docs for sampling parameter
@a-s-g93 a-s-g93 self-assigned this Oct 30, 2025
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.

2 participants