Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class CountlyMCPServer {
if (authToken) {
this.setAuthHeader(authToken);
}
const getAuthParams = () => (authToken ? { auth_token: authToken } : {});
const getAuthParams = () => (authToken ? { api_key: authToken } : {});
const resources = await listResources(
this.httpClient,
this.appCache,
Expand Down Expand Up @@ -380,7 +380,7 @@ class CountlyMCPServer {
if (authToken) {
this.setAuthHeader(authToken);
}
const getAuthParams = () => (authToken ? { auth_token: authToken } : {});
const getAuthParams = () => (authToken ? { api_key: authToken } : {});
const { uri } = request.params;
const content = await readResource(
uri,
Expand Down Expand Up @@ -469,9 +469,9 @@ class CountlyMCPServer {

// Helper Methods
private getAuthParams(): {} {
// Return auth_token as query param for endpoints that require it (e.g., /o/apps/mine)
// Return api_key as query param for endpoints that require it (e.g., /o/apps/mine)
if (this.config.authToken) {
return { auth_token: this.config.authToken };
return { api_key: this.config.authToken };
}
return {};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async function getAppsForCache(
const params: any = {};
// If auth is in headers, also try sending as query param for compatibility
if (authHeader) {
params.auth_token = authHeader;
params.api_key = authHeader;
}
const response = await httpClient.get('/o/apps/mine', { params });

Expand Down