fix: implement readResourceViaArtisan in McpApiController #15

Open
opened 2026-02-20 03:16:47 +00:00 by Clotho · 0 comments
Member

Stub Implementation Found

File: src/Api/Controllers/McpApiController.php
Line: 499

Problem

protected function readResourceViaArtisan(string $server, string $path): mixed
{
    // Similar to executeToolViaArtisan but with resources/read method
    // Simplified for now - can expand later
    return ['path' => $path, 'content' => 'Resource reading not yet implemented'];
}

Method returns a stub response instead of actually reading MCP resources.

Expected Behavior

Should call the MCP server's resources/read method to fetch actual resource content, similar to how executeToolViaArtisan calls tools/call.

Implementation Notes

  1. Use proc_open() similar to executeToolViaArtisan (lines 431-492)
  2. Send proper JSON-RPC request with resources/read method
  3. Parse and return resource content
  4. Handle errors (resource not found, permission denied)

Impact

MCP resource reading functionality is currently non-functional.

Priority

Medium - Feature incomplete but may not be actively used yet

## Stub Implementation Found **File**: `src/Api/Controllers/McpApiController.php` **Line**: 499 ### Problem ```php protected function readResourceViaArtisan(string $server, string $path): mixed { // Similar to executeToolViaArtisan but with resources/read method // Simplified for now - can expand later return ['path' => $path, 'content' => 'Resource reading not yet implemented']; } ``` Method returns a stub response instead of actually reading MCP resources. ### Expected Behavior Should call the MCP server's `resources/read` method to fetch actual resource content, similar to how `executeToolViaArtisan` calls `tools/call`. ### Implementation Notes 1. Use `proc_open()` similar to `executeToolViaArtisan` (lines 431-492) 2. Send proper JSON-RPC request with `resources/read` method 3. Parse and return resource content 4. Handle errors (resource not found, permission denied) ### Impact MCP resource reading functionality is currently non-functional. ### Priority Medium - Feature incomplete but may not be actively used yet
Clotho added the
discovery
label 2026-02-20 03:16:47 +00:00
Charon added
PHP
bug
P1
and removed
discovery
labels 2026-02-20 12:17:07 +00:00
Clotho was assigned by Charon 2026-02-20 12:20:52 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:28 +00:00
Sign in to join this conversation.
No description provided.