-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Claude/add mcp transport 011 cu nfd m4i6 wc lq z xh b1n ad #1827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Claude/add mcp transport 011 cu nfd m4i6 wc lq z xh b1n ad #1827
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.
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 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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
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.