Skip to content

Commit a69d3a6

Browse files
dcramerclaude
andauthored
fix: use full URL as resource URI instead of just host (#374)
The resource URI should be the complete URL to properly identify the resource, not just the host portion. This ensures resources are uniquely identifiable and follows proper URI semantics. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent eb136bc commit a69d3a6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/mcp-server/src/resources.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe("resources", () => {
170170

171171
expect(result.contents).toHaveLength(1);
172172
expect(result.contents[0]).toEqual({
173-
uri: "github.com",
173+
uri: "https://github.com/getsentry/sentry-ai-rules/blob/main/api/query-syntax.mdc",
174174
mimeType: "text/plain",
175175
text: mockContent,
176176
});

packages/mcp-server/src/resources.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,12 @@ async function defaultGitHubHandler(
8585
url: URL,
8686
_extra: RequestHandlerExtra<any, any>,
8787
): Promise<ReadResourceResult> {
88-
const uri = url.host;
8988
const rawPath = url.pathname;
9089
const content = await fetchRawGithubContent(rawPath);
9190
return {
9291
contents: [
9392
{
94-
uri: uri,
93+
uri: url.toString(),
9594
mimeType: "text/plain",
9695
text: content,
9796
},

0 commit comments

Comments
 (0)