Skip to content

Conversation

@Daytona39264
Copy link

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

  • Added MCP transport configuration to config/api.php, allowing definition of MCP servers and their connection settings.
  • Implemented a contract interface Transport in src/Contract/Mcp/Transport.php to standardize how MCP transports connect, send requests, and manage sessions.
  • Added a concrete HttpTransport class in src/Mcp/Transport/HttpTransport.php for communicating with MCP servers over HTTP, including connection management and JSON-RPC request handling.

Service Registration and Access

  • Created the Mcp manager class in src/Mcp/Mcp.php to manage available transports and provide access to them.
  • Registered the MCP service provider and facade, making MCP functionality available throughout the application (src/Provider/McpServiceProvider.php, src/Facade/MCP.php, and updates in src/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

  • Added MCP transport configuration to config/api.php, allowing definition of MCP servers and their connection settings, including a sample HTTP transport for klavis-strata.
  • Introduced the Transport interface in src/Contract/Mcp/Transport.php to standardize MCP transport operations (connect, send, disconnect, isConnected).
  • Implemented HttpTransport in src/Mcp/Transport/HttpTransport.php to handle HTTP-based MCP server communication, including connection management and JSON-RPC request handling.

MCP Service Registration and Access

  • Added the Mcp manager class in src/Mcp/Mcp.php to manage multiple MCP transports, including registration, retrieval, extension, and removal of transports.
  • Registered the MCP service and its alias in the container via McpServiceProvider (src/Provider/McpServiceProvider.php), and updated DingoServiceProvider to load the MCP provider and class alias. [1] [2] [3]
  • Added the MCP facade in src/Facade/MCP.php for convenient access to the MCP service throughout the application.

Copilot AI and others added 3 commits October 20, 2025 00:15
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>
@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 21:13
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 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.php with 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.

Daytona39264 and others added 2 commits October 23, 2025 11:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Author

@Daytona39264 Daytona39264 left a comment

Choose a reason for hiding this comment

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

Good

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