Skip to content

Conversation

@MacondoExpress
Copy link
Contributor

This update introduces a comprehensive pre-flight checks during the startup sequence.
We've implemented a new verifyRequirements function to ensure that the server's environment meets all necessary prerequisites before it begins its main operations.

The verification process now confirms the following:

  • Valid connection to the configured Neo4j instance.
  • Ability to perform a query against the configured instance.
  • Verifies correctness of the APOC installation.
  • In case of a missing GDS requirement, the server will start without the GDS specific tools.

To perform these, this PR includes also other improvements such as the ability to filter registered tools by their specific categories, for instance: "read-only", "cypher", "gds".

The registerTools method is no longer exposed but instead is been moved to be part of the .Start method and implicitly invoked.

Integration test helpers are slightly changed to accomodates testing initial part of the Server initialisation.

@MacondoExpress MacondoExpress requested review from keremgocen and mjfwebb and removed request for mjfwebb November 17, 2025 14:59
analytics "github.com/neo4j/mcp/internal/analytics/mocks"
"github.com/neo4j/mcp/internal/config"
db_mock "github.com/neo4j/mcp/internal/database/mocks"
db "github.com/neo4j/mcp/internal/database/mocks"
Copy link
Contributor

Choose a reason for hiding this comment

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

🫶


"github.com/neo4j/mcp/internal/analytics"
analytics_mock "github.com/neo4j/mcp/internal/analytics/mocks"
amock "github.com/neo4j/mcp/internal/analytics/mocks"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are not using the real analytics here, so there should not be a conflict if we used analytics instead of amock to be a bit more specific.

Service database.Service
Deps *tools.ToolDependencies
createdLabels map[string]bool
AnalyticsService *analytics_mocks.MockService
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, I guess it was done in an earlier PR, but I think we should use analytics here as well. At least name it something other than snake case, please:)

}

// VerifyConnectivity checks the driver can establish a valid connection with a Neo4j instance;
func (s *Neo4jService) VerifyConnectivity(ctx context.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks neat as part of the service now

dbService: dbService,
version: version,
anService: anService,
gdsInstalled: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no need to provide it, as it defaults to false
Counterargument: it's more visible to be explicit

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.

3 participants