Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php-mcp/server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0
Choose a base ref
...
head repository: php-mcp/server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.1.0
Choose a head ref
  • 7 commits
  • 49 files changed
  • 3 contributors

Commits on May 1, 2025

  1. Update README.md

    MCP Laravel link was incorrect
    JacquesvanWyk authored May 1, 2025
    Configuration menu
    Copy the full SHA
    c99dcd1 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from JacquesvanWyk/patch-1

    Update README.md
    CodeWithKyrian authored May 1, 2025
    Configuration menu
    Copy the full SHA
    1fa0246 View commit details
    Browse the repository at this point in the history
  3. feat(core): Add manual registration and invokable class discovery

    Implements several enhancements to the MCP server:
    
    - Adds manual registration methods to the `Server` class (`withTool`, `withResource`, `withPrompt`, `withResourceTemplate`), allowing programmatic definition of MCP elements alongside attribute discovery. Supports array `[Class::class, 'method']` and invokable class string handlers.
    
    - Enables the `Discoverer` to find `#[Mcp*]` attributes placed directly on invokable classes (classes with a public `__invoke` method). Attributes (`McpTool`, `McpResource`, etc.) updated accordingly.
    
    - Refactors dependency injection within the `Server`. Core components like `Processor`, `Discoverer`, `Registry`, and `TransportState` now resolve dependencies (Logger, Cache, Config) Just-In-Time from the PSR-11 container.
      - Clarifies behavior: `withLogger/Cache/Config` methods primarily affect the default `BasicContainer`. When a custom container is used via `withContainer`, these services MUST be registered directly in the custom container.
    
    - Adds configuration options to control discovery paths (`withBasePath`, `withScanDirectories`, `withExcludeDirectories`).
    
    - Updates `README.md` extensively to document these new features and the updated DI behavior.
    
    - Adds comprehensive tests for manual registration and invokable class discovery, and updates existing tests to reflect the DI refactoring.
    
    BREAKING CHANGE: The dependency injection mechanism within the `Server` has been refactored. Components now resolve PSR-3/11/16 dependencies JIT from the container. Users providing a custom container via `withContainer()` MUST ensure `LoggerInterface`, `CacheInterface`, and `ConfigurationRepositoryInterface` are registered. The behavior of `withLogger()`, `withCache()`, and `withConfig()` is altered when a custom container is present; configuration should happen directly within the custom container itself. TransportHandler constructors now primarily accept the `Server` instance.
    CodeWithKyrian committed May 1, 2025
    Configuration menu
    Copy the full SHA
    ac4940f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    23a038e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    42b93e7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    05b9258 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #2 from php-mcp/feature/enhanced-element-registration

    feat: Add Manual Registration, Invokable Discovery, and Refactor DI
    CodeWithKyrian authored May 1, 2025
    Configuration menu
    Copy the full SHA
    2ff0f7d View commit details
    Browse the repository at this point in the history
Loading