Compare commits

...

3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
c76c7c9be7 Fix tool and prompt description update not calling API
The issue was that toolService.ts and promptService.ts were setting
Authorization: Bearer header manually, but the backend expects the
x-auth-token header. The auth interceptor already handles adding
x-auth-token automatically, so the fix is to remove the manual header
and let the interceptor do its job.

Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
2025-12-01 04:28:48 +00:00
copilot-swe-agent[bot]
2378d849b8 Initial analysis: Found root cause of tool description update issue
Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
2025-12-01 04:24:02 +00:00
copilot-swe-agent[bot]
98960c5d0f Initial plan 2025-12-01 04:16:49 +00:00
3 changed files with 11 additions and 20 deletions

View File

@@ -126,14 +126,10 @@ export const updatePromptDescription = async (
): Promise<{ success: boolean; error?: string }> => {
try {
// URL-encode server and prompt names to handle slashes (e.g., "com.atlassian/atlassian-mcp-server")
// Auth header is automatically added by the interceptor
const response = await apiPut<any>(
`/servers/${encodeURIComponent(serverName)}/prompts/${encodeURIComponent(promptName)}/description`,
{ description },
{
headers: {
Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`,
},
},
);
return {

View File

@@ -30,11 +30,8 @@ export const callTool = async (
? `/tools/${encodeURIComponent(server)}/${encodeURIComponent(request.toolName)}`
: '/tools/call';
const response = await apiPost<any>(url, request.arguments, {
headers: {
Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`, // Add bearer auth for MCP routing
},
});
// Auth header is automatically added by the interceptor
const response = await apiPost<any>(url, request.arguments);
if (response.success === false) {
return {
@@ -66,14 +63,10 @@ export const toggleTool = async (
): Promise<{ success: boolean; error?: string }> => {
try {
// URL-encode server and tool names to handle slashes (e.g., "com.atlassian/atlassian-mcp-server")
// Auth header is automatically added by the interceptor
const response = await apiPost<any>(
`/servers/${encodeURIComponent(serverName)}/tools/${encodeURIComponent(toolName)}/toggle`,
{ enabled },
{
headers: {
Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`,
},
},
);
return {
@@ -99,14 +92,10 @@ export const updateToolDescription = async (
): Promise<{ success: boolean; error?: string }> => {
try {
// URL-encode server and tool names to handle slashes (e.g., "com.atlassian/atlassian-mcp-server")
// Auth header is automatically added by the interceptor
const response = await apiPut<any>(
`/servers/${encodeURIComponent(serverName)}/tools/${encodeURIComponent(toolName)}/description`,
{ description },
{
headers: {
Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`,
},
},
);
return {

View File

@@ -8,6 +8,12 @@
],
"env": {
"AMAP_MAPS_API_KEY": "your-api-key"
},
"tools": {
"amap-maps_regeocode": {
"enabled": true,
"description": "Updated via UI test"
}
}
},
"playwright": {