Claude/add mcp transport 011 cu nfd m4i6 wc lq z xh b1n ad#1827
Open
Daytona39264 wants to merge 7 commits intodingo:masterfrom
Open
Claude/add mcp transport 011 cu nfd m4i6 wc lq z xh b1n ad#1827Daytona39264 wants to merge 7 commits intodingo:masterfrom
Daytona39264 wants to merge 7 commits intodingo:masterfrom
Conversation
This commit implements MCP (Model Context Protocol) transport functionality
for the Dingo API framework, following the existing architectural patterns
used for authentication providers.
Changes include:
- Created MCP Transport interface (Contract/Mcp/Transport.php)
- Implemented HTTP transport for MCP communication (Mcp/Transport/HttpTransport.php)
- Added MCP manager class for transport management (Mcp/Mcp.php)
- Created MCP Service Provider for Laravel integration (Provider/McpServiceProvider.php)
- Added MCP facade for convenient access (Facade/MCP.php)
- Updated configuration with klavis-strata MCP transport
- Registered MCP service provider in DingoServiceProvider
The implementation allows easy integration with MCP servers via HTTP/HTTPS,
with support for custom timeouts, headers, and SSL verification options.
Configuration example:
'mcp' => [
'transports' => [
'klavis-strata' => [
'type' => 'http',
'url' => 'https://strata.klavis.ai/mcp/?strata_id=...',
'options' => ['timeout' => 30, 'verify' => true],
],
],
],
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds Model Context Protocol (MCP) support to the Dingo API, enabling communication with external MCP servers through configurable HTTP transport. The implementation includes a service provider, manager class, facade, and transport interface with an HTTP implementation.
Key Changes:
- Added MCP configuration section in
config/api.phpwith sample HTTP transport settings - Implemented Transport contract interface and HttpTransport class for MCP server communication
- Created Mcp manager class to handle transport registration and retrieval
- Registered MCP service provider and facade for application-wide access
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| config/api.php | Added MCP configuration section with sample klavis-strata HTTP transport |
| src/Contract/Mcp/Transport.php | Defined Transport interface for standardizing MCP connection operations |
| src/Mcp/Transport/HttpTransport.php | Implemented HTTP-based MCP transport with JSON-RPC support |
| src/Mcp/Mcp.php | Created manager class for registering and accessing MCP transports |
| src/Provider/McpServiceProvider.php | Added service provider to register MCP service and configure transports |
| src/Provider/DingoServiceProvider.php | Registered MCP service provider and class alias |
| src/Facade/MCP.php | Created facade for convenient MCP service access |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Added Authorization header configuration for klavis-strata transport - Uses environment variable KLAVIS_STRATA_API_KEY for secure token storage - Created .env.example file with documentation for API key setup - Follows Laravel best practices for storing sensitive credentials 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
redpleasure860-sys
approved these changes
Oct 29, 2025
This commit adds extensive testing, documentation, and usage examples for the MCP (Model Context Protocol) transport functionality: Tests: - Added McpTest.php with comprehensive tests for the MCP manager - Added HttpTransportTest.php with full coverage of HTTP transport - Tests include connection handling, error scenarios, and edge cases - Uses mocking for isolated unit testing Documentation: - Created comprehensive MCP.md documentation - Covers installation, configuration, usage, and API reference - Includes multiple usage examples and troubleshooting guides - Documents security considerations and best practices Examples: - Added mcp-usage-example.php with 4 different usage patterns - Demonstrates facade usage, direct instantiation, and extension - Includes error handling examples Updates: - Updated main README.md to mention MCP support in features - Added link to MCP documentation from main README All code follows existing project conventions and PSR-2 standards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new MCP (Model Context Protocol) integration into the API, allowing the application to communicate with MCP servers using configurable transport mechanisms. The main changes add support for defining, registering, and using MCP transports, with an initial implementation for HTTP-based communication.
MCP Integration
config/api.php, allowing definition of MCP servers and their connection settings.Transportinsrc/Contract/Mcp/Transport.phpto standardize how MCP transports connect, send requests, and manage sessions.HttpTransportclass insrc/Mcp/Transport/HttpTransport.phpfor communicating with MCP servers over HTTP, including connection management and JSON-RPC request handling.Service Registration and Access
Mcpmanager class insrc/Mcp/Mcp.phpto manage available transports and provide access to them.src/Provider/McpServiceProvider.php,src/Facade/MCP.php, and updates insrc/Provider/DingoServiceProvider.php). [1] [2] [3] [4]This pull request introduces initial support for Model Context Protocol (MCP) transports in the API, enabling integration with external MCP servers using configurable transport layers. The main changes include configuration for MCP transports, new classes to manage and interact with MCP connections, and service provider registration for dependency injection and facade usage.
MCP Transport Infrastructure
config/api.php, allowing definition of MCP servers and their connection settings, including a sample HTTP transport forklavis-strata.Transportinterface insrc/Contract/Mcp/Transport.phpto standardize MCP transport operations (connect, send, disconnect, isConnected).HttpTransportinsrc/Mcp/Transport/HttpTransport.phpto handle HTTP-based MCP server communication, including connection management and JSON-RPC request handling.MCP Service Registration and Access
Mcpmanager class insrc/Mcp/Mcp.phpto manage multiple MCP transports, including registration, retrieval, extension, and removal of transports.McpServiceProvider(src/Provider/McpServiceProvider.php), and updatedDingoServiceProviderto load the MCP provider and class alias. [1] [2] [3]MCPfacade insrc/Facade/MCP.phpfor convenient access to the MCP service throughout the application.