mirror of
https://github.com/samvallad33/vestige.git
synced 2026-04-25 00:36:22 +02:00
Merge pull request #20 from xsa-dev/fix/resource-uri-prefix
fix: strip provider prefix from MCP resource URIs
This commit is contained in:
commit
d921427106
1 changed files with 8 additions and 4 deletions
|
|
@ -811,10 +811,14 @@ impl McpServer {
|
|||
};
|
||||
|
||||
let uri = &request.uri;
|
||||
let content = if uri.starts_with("memory://") {
|
||||
resources::memory::read(&self.storage, uri).await
|
||||
} else if uri.starts_with("codebase://") {
|
||||
resources::codebase::read(&self.storage, uri).await
|
||||
// Normalize URI: strip provider prefix (e.g., "vestige/") for scheme matching
|
||||
// OpenCode and other MCP clients may send "vestige/memory://recent"
|
||||
// but we register resources as "memory://recent"
|
||||
let normalized_uri = uri.strip_prefix("vestige/").unwrap_or(uri);
|
||||
let content = if normalized_uri.starts_with("memory://") {
|
||||
resources::memory::read(&self.storage, normalized_uri).await
|
||||
} else if normalized_uri.starts_with("codebase://") {
|
||||
resources::codebase::read(&self.storage, normalized_uri).await
|
||||
} else {
|
||||
Err(format!("Unknown resource scheme: {}", uri))
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue