-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupstream.php
More file actions
63 lines (55 loc) · 1.62 KB
/
upstream.php
File metadata and controls
63 lines (55 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
namespace Arcp\Samples\Mcp;
/**
* Upstream MCP server invocation.
*
* No first-class MCP PHP SDK exists yet; in production point this at a
* vendored MCP-over-stdio bridge (or a HTTP/SSE shim). Reference servers
* from the modelcontextprotocol org publish under `mcp-server-*`
* (filesystem, git, postgres, slack, ...).
*
* TODO: replace with vendored bridge once an MCP PHP SDK exists.
*/
final class StdioServerParameters
{
/** @param list<string> $args */
public function __construct(
public readonly string $command,
public readonly array $args = [],
) {
}
}
/**
* Stand-in for the MCP `ClientSession`. Mirrors the small surface the
* bridge actually touches: initialize / listTools / callTool.
*/
final class McpClientSession
{
public static function stdio(StdioServerParameters $params): self
{
throw new \RuntimeException('not implemented');
}
public function initialize(): void
{
throw new \RuntimeException('not implemented');
}
/** @return list<array{name: string, description?: string}> */
public function listTools(): array
{
throw new \RuntimeException('not implemented');
}
/**
* @param array<string, mixed> $arguments
*
* @return array{isError?: bool, content: list<array<string, mixed>>}
*/
public function callTool(string $tool, array $arguments): array
{
throw new \RuntimeException('not implemented');
}
}
function upstreamParams(): StdioServerParameters
{
return new StdioServerParameters('uvx', ['mcp-server-filesystem', '/srv/data']);
}