Skip to content

Commit 698e191

Browse files
committed
Address copilot suggestions
Signed-off-by: Dan Barr <[email protected]>
1 parent a40f131 commit 698e191

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/mcp-metadata-plugin/src/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export async function scanForMCPComponents(
3333
});
3434

3535
// Regex to match <MCPMetadata name="serverName" /> components
36-
const mcpComponentRegex = /<MCPMetadata\s+name=["']([^"']+)["'][^>]*\/?>/g;
36+
const mcpComponentRegex =
37+
/<MCPMetadata\s+name=["']([a-zA-Z0-9_-]+)["'][^>]*\/?>/g;
3738

3839
for (const file of mdxFiles) {
3940
try {
@@ -80,6 +81,6 @@ export async function fetchServerData(
8081
`Failed to fetch data for MCP server "${serverName}":`,
8182
error
8283
);
83-
throw new Error(`Failed to fetch MCP server data: ${error.message}`);
84+
throw new Error('Failed to fetch MCP server data. See logs for details.');
8485
}
8586
}

0 commit comments

Comments
 (0)