Skip to main content
Glama

Weblate MCP Server

by mmntm
debug.tool.ts1.52 kB
import { Injectable } from '@nestjs/common'; import { WeblateApiService } from '../services/weblate-api.service'; import { ConfigService } from '@nestjs/config'; @Injectable() export class DebugTool { constructor( private weblateApiService: WeblateApiService, private configService: ConfigService, ) {} async debugConfiguration() { const apiUrl = this.configService.get<string>('WEBLATE_API_URL'); const apiToken = this.configService.get<string>('WEBLATE_API_TOKEN'); return { api_url: apiUrl, token_configured: !!apiToken, token_length: apiToken?.length || 0, token_prefix: apiToken?.substring(0, 10) + '...', debug_mode: this.configService.get<string>('DEBUG') === 'true', }; } async testApiConnection() { try { // Test by calling listProjects const projects = await this.weblateApiService.listProjects(); return { status: 'success', message: `API connection working - found ${projects.length} projects`, }; } catch (error) { return { status: 'error', message: error.message }; } } async debugListProjects() { try { const projects = await this.weblateApiService.listProjects(); return { success: true, project_count: projects.length, projects: projects.map((p) => ({ slug: p.slug, name: p.name })), }; } catch (error) { return { success: false, error: error.message, stack: error.stack, }; } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mmntm/weblate-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server