Skip to content

Conversation

@vitaliiShveider
Copy link
Contributor

No description provided.

@vitaliiShveider vitaliiShveider self-assigned this Dec 23, 2025
Copy link

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 adds read-only database query execution capabilities to the AIDev SDK, allowing AI assistants to query the database through the Model Context Protocol (MCP). The implementation includes security measures to prevent write operations by validating that only SELECT, SHOW, DESCRIBE, and EXPLAIN statements are executed.

Key changes:

  • New DatabaseQueryReader class with read-only query validation and automatic row limit application
  • ExecuteDatabaseQueryAiDevMcpToolPlugin plugin to expose database query functionality to MCP
  • Updated interface documentation to clarify method naming conventions

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/SprykerSdk/Zed/AiDev/Dependency/AiDevMcpToolPluginInterface.php Updated documentation to clarify that the name represents both the callable method and MCP prompt name
src/SprykerSdk/Zed/AiDev/Communication/Plugins/AiDevMcpTools/ExecuteDatabaseQueryAiDevMcpToolPlugin.php New plugin that provides the database query execution interface for MCP tools
src/SprykerSdk/Zed/AiDev/Business/Database/Reader/DatabaseQueryReaderInterface.php Interface definition for database query execution functionality
src/SprykerSdk/Zed/AiDev/Business/Database/Reader/DatabaseQueryReader.php Core implementation with read-only validation, multiple statement prevention, and automatic limit application
src/SprykerSdk/Zed/AiDev/Business/AiDevBusinessFactory.php Factory method to create the DatabaseQueryReader instance
src/SprykerSdk/Zed/AiDev/AiDevDependencyProvider.php Registers the ExecuteDatabaseQueryAiDevMcpToolPlugin in the MCP tool plugins list
README.md Updated Claude Code command syntax with proper argument separator

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

…eature/ai-37-add-read-only-db-access-to-ai-dev-sdk

# Conflicts:
#	src/SprykerSdk/Zed/AiDev/Business/AiDevBusinessFactory.php
…eature/ai-37-add-read-only-db-access-to-ai-dev-sdk
@vitaliiivanovspryker vitaliiivanovspryker merged commit efadcb4 into master Jan 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants