Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
},
"autoload-dev": {
"psr-4": {
"Mcp\\Example\\StdioCalculatorExample\\": "examples/01-discovery-stdio-calculator/",
"Mcp\\Example\\HttpUserProfileExample\\": "examples/02-discovery-http-userprofile/",
"Mcp\\Example\\ManualStdioExample\\": "examples/03-manual-registration-stdio/",
"Mcp\\Example\\CombinedHttpExample\\": "examples/04-combined-registration-http/",
"Mcp\\Example\\StdioEnvVariables\\": "examples/05-stdio-env-variables/",
"Mcp\\Example\\DependenciesStdioExample\\": "examples/06-custom-dependencies-stdio/",
"Mcp\\Example\\ComplexSchemaHttpExample\\": "examples/07-complex-tool-schema-http/",
"Mcp\\Example\\SchemaShowcaseExample\\": "examples/08-schema-showcase-streamable/",
"Mcp\\Example\\CachedDiscoveryExample\\": "examples/09-cached-discovery-stdio/",
"Mcp\\Example\\HttpCombinedRegistration\\": "examples/http-combined-registration/",
"Mcp\\Example\\HttpComplexToolSchema\\": "examples/http-complex-tool-schema/",
"Mcp\\Example\\HttpDiscoveryUserProfile\\": "examples/http-discovery-userprofile/",
"Mcp\\Example\\HttpSchemaShowcase\\": "examples/http-schema-showcase/",
"Mcp\\Example\\StdioCachedDiscovery\\": "examples/stdio-cached-discovery/",
"Mcp\\Example\\StdioCustomDependencies\\": "examples/stdio-custom-dependencies/",
"Mcp\\Example\\StdioDiscoveryCalculator\\": "examples/stdio-discovery-calculator/",
"Mcp\\Example\\StdioEnvVariables\\": "examples/stdio-env-variables/",
"Mcp\\Example\\StdioExplicitRegistration\\": "examples/stdio-explicit-registration/",
"Mcp\\Tests\\": "tests/"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\CombinedHttpExample;
namespace Mcp\Example\HttpCombinedRegistration;

use Mcp\Capability\Attribute\McpResource;
use Mcp\Capability\Attribute\McpTool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\CombinedHttpExample;
namespace Mcp\Example\HttpCombinedRegistration;

use Psr\Log\LoggerInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
chdir(__DIR__);

use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use Mcp\Example\CombinedHttpExample\ManualHandlers;
use Mcp\Example\HttpCombinedRegistration\ManualHandlers;
use Mcp\Server;
use Mcp\Server\Session\FileSessionStore;
use Mcp\Server\Transport\StreamableHttpTransport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\ComplexSchemaHttpExample;
namespace Mcp\Example\HttpComplexToolSchema;

use Mcp\Capability\Attribute\McpTool;
use Mcp\Example\ComplexSchemaHttpExample\Model\EventPriority;
use Mcp\Example\ComplexSchemaHttpExample\Model\EventType;
use Mcp\Example\HttpComplexToolSchema\Model\EventPriority;
use Mcp\Example\HttpComplexToolSchema\Model\EventType;
use Psr\Log\LoggerInterface;

final class McpEventScheduler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\ComplexSchemaHttpExample\Model;
namespace Mcp\Example\HttpComplexToolSchema\Model;

enum EventPriority: int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\ComplexSchemaHttpExample\Model;
namespace Mcp\Example\HttpComplexToolSchema\Model;

enum EventType: string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\HttpUserProfileExample;
namespace Mcp\Example\HttpDiscoveryUserProfile;

use Mcp\Capability\Attribute\CompletionProvider;
use Mcp\Capability\Attribute\McpPrompt;
Expand Down Expand Up @@ -37,7 +37,7 @@ final class McpElements
public function __construct(
private readonly LoggerInterface $logger,
) {
$this->logger->debug('HttpUserProfileExample McpElements instantiated.');
$this->logger->debug('HttpDiscoveryUserProfile McpElements instantiated.');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\HttpUserProfileExample;
namespace Mcp\Example\HttpDiscoveryUserProfile;

use Mcp\Capability\Prompt\Completion\ProviderInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\SchemaShowcaseExample;
namespace Mcp\Example\HttpSchemaShowcase;

use Mcp\Capability\Attribute\McpTool;
use Mcp\Capability\Attribute\Schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\CachedDiscoveryExample;
namespace Mcp\Example\StdioCachedDiscovery;

use Mcp\Capability\Attribute\McpTool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\DependenciesStdioExample;
namespace Mcp\Example\StdioCustomDependencies;

use Mcp\Capability\Attribute\McpResource;
use Mcp\Capability\Attribute\McpTool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\StdioCalculatorExample;
namespace Mcp\Example\StdioDiscoveryCalculator;

use Mcp\Capability\Attribute\McpResource;
use Mcp\Capability\Attribute\McpTool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Mcp\Example\ManualStdioExample;
namespace Mcp\Example\StdioExplicitRegistration;

use Psr\Log\LoggerInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
require_once dirname(__DIR__).'/bootstrap.php';
chdir(__DIR__);

use Mcp\Example\ManualStdioExample\SimpleHandlers;
use Mcp\Example\StdioExplicitRegistration\SimpleHandlers;
use Mcp\Server;
use Mcp\Server\Transport\StdioTransport;

Expand Down
8 changes: 4 additions & 4 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
parameters:
ignoreErrors:
-
message: '#^Call to static method invalidParams\(\) on an unknown class Mcp\\Example\\HttpUserProfileExample\\McpServerException\.$#'
message: '#^Call to static method invalidParams\(\) on an unknown class Mcp\\Example\\HttpDiscoveryUserProfile\\McpServerException\.$#'
identifier: class.notFound
count: 2
path: examples/02-discovery-http-userprofile/McpElements.php
path: examples/http-discovery-userprofile/McpElements.php

-
message: '#^PHPDoc tag @throws with type Mcp\\Example\\HttpUserProfileExample\\McpServerException is not subtype of Throwable$#'
message: '#^PHPDoc tag @throws with type Mcp\\Example\\HttpDiscoveryUserProfile\\McpServerException is not subtype of Throwable$#'
identifier: throws.notThrowable
count: 2
path: examples/02-discovery-http-userprofile/McpElements.php
path: examples/http-discovery-userprofile/McpElements.php

-
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ResourceTemplateReference\:\:handle\(\)\.$#'
Expand Down
2 changes: 1 addition & 1 deletion tests/Inspector/ManualStdioExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public static function provideMethods(): array

protected function getServerScript(): string
{
return \dirname(__DIR__, 2).'/examples/03-manual-registration-stdio/server.php';
return \dirname(__DIR__, 2).'/examples/stdio-explicit-registration/server.php';
}
}
2 changes: 1 addition & 1 deletion tests/Inspector/StdioCalculatorExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public static function provideMethods(): array

protected function getServerScript(): string
{
return \dirname(__DIR__, 2).'/examples/01-discovery-stdio-calculator/server.php';
return \dirname(__DIR__, 2).'/examples/stdio-discovery-calculator/server.php';
}
}