1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9: *
10: * For the full copyright and license information, please view
11: * the LICENSE file that was distributed with this source code.
12: */
13:
14: namespace Nexus\Mcp\Extension\Skills\Server\Store;
15:
16: use Nexus\Mcp\Core\Schema\Cursor;
17: use Nexus\Mcp\Core\Schema\Result\ListResourcesResult;
18: use Nexus\Mcp\Core\Schema\Result\ReadResourceResult;
19: use Nexus\Mcp\Extension\Skills\Schema\Result\GetSkillResult;
20: use Nexus\Mcp\Extension\Skills\Schema\Result\ListSkillsResult;
21: use Nexus\Mcp\Extension\Skills\Schema\Result\ReadResourceDirectoryResult;
22: use Nexus\Mcp\Server\Exception\InvalidCursorException;
23: use Nexus\Mcp\Server\Exception\ResourceNotFoundException;
24: use Nexus\Mcp\Server\ServerContext;
25:
26: /**
27: * The skills served by a server, with the files and directories that make them up.
28: */
29: interface SkillStoreInterface
30: {
31: /**
32: * @throws InvalidCursorException
33: */
34: public function list(?Cursor $cursor): ListSkillsResult;
35:
36: /**
37: * @param non-empty-string $uri URI of the skill's `SKILL.md`
38: *
39: * @throws ResourceNotFoundException
40: */
41: public function get(string $uri, ServerContext $context): GetSkillResult;
42:
43: /**
44: * The skill files enumerated by `resources/list`.
45: *
46: * @throws InvalidCursorException
47: */
48: public function listResources(?Cursor $cursor): ListResourcesResult;
49:
50: /**
51: * The file at the URI, or null when the store serves no skill file there.
52: *
53: * @param non-empty-string $uri
54: */
55: public function readFile(string $uri, ServerContext $context): ?ReadResourceResult;
56:
57: /**
58: * @param non-empty-string $uri URI of the directory, written without a trailing slash
59: *
60: * @throws InvalidCursorException
61: * @throws ResourceNotFoundException
62: */
63: public function readDirectory(string $uri, ?Cursor $cursor, ServerContext $context): ReadResourceDirectoryResult;
64: }
65: