feat: MCP profile tools; ProfileUpdater/ProfilePresenter shared with /me; docs and Caddy snippet for /mcp

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
nikita.hohlov
2026-09-05 06:14:31 -03:00
parent ed45a1d516
commit 8ee8a30fb5
12 changed files with 220 additions and 50 deletions

View File

@@ -36,4 +36,18 @@ class McpAuthTest extends TestCase
->assertOk()
->assertJsonPath('result.serverInfo.name', 'Hado');
}
public function test_lists_all_tools_over_http(): void
{
$user = User::create(['login' => 'nikita', 'tz' => 'UTC']);
AgentToken::create(['user_id' => $user->id, 'token_hash' => hash('sha256', 'secret')]);
$names = collect($this->postJson('/mcp', ['jsonrpc' => '2.0', 'id' => 2, 'method' => 'tools/list'], ['Authorization' => 'Bearer secret'])
->assertOk()->json('result.tools'))->pluck('name')->all();
$this->assertSame([
'list_events', 'get_event', 'create_event', 'update_event', 'delete_event',
'mark_done', 'mark_ack', 'get_profile', 'update_profile',
], $names);
}
}