Skip to main content
Glama

3GPP MCP Server

by edhijlu
tgpp-api-client.ts11.9 kB
/** * 3GPP MCP Server - 3GPP Official API Client * * Copyright (c) 2024, 3GPP MCP Contributors * Licensed under the BSD-3-Clause License */ import axios, { AxiosInstance } from 'axios'; import NodeCache from 'node-cache'; export interface SpecificationMetadata { id: string; title: string; version: string; release: string; working_group: string; status: 'Published' | 'Under Development' | 'Withdrawn'; publication_date: string; summary: string; download_url?: string; dependencies: string[]; keywords: string[]; } export interface ReleaseInfo { release: string; freeze_date: string; status: string; specifications: string[]; major_features: string[]; } export interface WorkingGroupInfo { name: string; full_name: string; focus_area: string; specifications: string[]; chairperson?: string; } export class TGPPApiClient { private api: AxiosInstance; private cache: NodeCache; constructor() { this.api = axios.create({ timeout: 15000, headers: { 'User-Agent': '3gpp-mcp-server/3.0.0', 'Accept': 'application/json' } }); this.cache = new NodeCache({ stdTTL: 7200, // 2 hours cache for official data maxKeys: 500, useClones: false }); } async getSpecificationMetadata(specId: string): Promise<SpecificationMetadata> { const cacheKey = `spec_meta:${specId}`; const cached = this.cache.get<SpecificationMetadata>(cacheKey); if (cached) { return cached; } // For now, return structured metadata // In production, this would call actual 3GPP APIs const metadata = this.generateSpecificationMetadata(specId); this.cache.set(cacheKey, metadata); return metadata; } async getReleaseInfo(release: string): Promise<ReleaseInfo> { const cacheKey = `release:${release}`; const cached = this.cache.get<ReleaseInfo>(cacheKey); if (cached) { return cached; } const releaseInfo = this.generateReleaseInfo(release); this.cache.set(cacheKey, releaseInfo); return releaseInfo; } async getWorkingGroupInfo(wgName: string): Promise<WorkingGroupInfo> { const cacheKey = `wg:${wgName}`; const cached = this.cache.get<WorkingGroupInfo>(cacheKey); if (cached) { return cached; } const wgInfo = this.generateWorkingGroupInfo(wgName); this.cache.set(cacheKey, wgInfo); return wgInfo; } async searchSpecifications(query: string, filters?: { release?: string; working_group?: string; series?: string; }): Promise<SpecificationMetadata[]> { const cacheKey = `search:${JSON.stringify({ query, filters })}`; const cached = this.cache.get<SpecificationMetadata[]>(cacheKey); if (cached) { return cached; } const results = this.performSpecificationSearch(query, filters); this.cache.set(cacheKey, results); return results; } private generateSpecificationMetadata(specId: string): SpecificationMetadata { const specData: { [key: string]: Partial<SpecificationMetadata> } = { 'TS 32.290': { title: '5G system; Services, operations and procedures of charging using Service Based Interface (SBI)', version: '17.1.0', release: 'Rel-17', working_group: 'SA5', status: 'Published', publication_date: '2023-04-01', summary: 'This specification defines the converged charging system for 5G networks using Service Based Interface (SBI) architecture. It specifies the Charging Function (CHF) operations, procedures, and interfaces for both online and offline charging scenarios.', dependencies: ['TS 23.501', 'TS 23.502', 'TS 32.240', 'TS 32.255'], keywords: ['charging', 'chf', 'service-based', '5g', 'converged', 'sbi', 'nchf'] }, 'TS 32.240': { title: 'Telecommunication management; Charging management; Charging architecture and principles', version: '17.0.0', release: 'Rel-17', working_group: 'SA5', status: 'Published', publication_date: '2022-12-15', summary: 'Defines the overall charging architecture and fundamental principles for 3GPP networks. Establishes the framework for online charging (OCS) and offline charging (CDF/CGF) systems.', dependencies: ['TS 23.203', 'TS 32.251', 'TS 32.255'], keywords: ['charging', 'architecture', 'ocs', 'cdf', 'cgf', 'principles'] }, 'TS 38.331': { title: '5G; NR; Radio Resource Control (RRC); Protocol specification', version: '17.4.0', release: 'Rel-17', working_group: 'RAN2', status: 'Published', publication_date: '2023-06-01', summary: 'Specifies the Radio Resource Control (RRC) protocol for 5G New Radio. Defines connection establishment, configuration, mobility management, and measurement procedures.', dependencies: ['TS 38.300', 'TS 38.211', 'TS 38.212', 'TS 38.213'], keywords: ['rrc', '5g', 'nr', 'radio', 'mobility', 'handover', 'connection'] }, 'TS 33.501': { title: 'Security architecture and procedures for 5G System', version: '17.6.0', release: 'Rel-17', working_group: 'SA3', status: 'Published', publication_date: '2023-07-01', summary: 'Comprehensive security architecture for 5G systems including authentication, key management, privacy protection, and security procedures for service-based architecture.', dependencies: ['TS 23.501', 'TS 23.502', 'TS 33.220'], keywords: ['security', '5g-aka', 'authentication', 'privacy', 'suci', 'supi', 'ausf'] }, 'TS 23.501': { title: 'System architecture for the 5G System (5GS)', version: '17.8.0', release: 'Rel-17', working_group: 'SA2', status: 'Published', publication_date: '2023-09-01', summary: 'Defines the overall system architecture for 5G including network functions, service-based architecture, interfaces, and reference points.', dependencies: ['TS 23.502', 'TS 29.500'], keywords: ['architecture', '5g', 'network-functions', 'sba', 'amf', 'smf', 'upf'] }, 'TS 23.502': { title: 'Procedures for the 5G System (5GS)', version: '17.8.0', release: 'Rel-17', working_group: 'SA2', status: 'Published', publication_date: '2023-09-01', summary: 'Specifies detailed procedures for 5G system operations including registration, authentication, session establishment, mobility management, and service operations.', dependencies: ['TS 23.501', 'TS 33.501'], keywords: ['procedures', '5g', 'registration', 'session', 'mobility', 'pdu-session'] } }; const baseData = specData[specId] || {}; return { id: specId, title: baseData.title || `${specId} - 3GPP Technical Specification`, version: baseData.version || '17.0.0', release: baseData.release || 'Rel-17', working_group: baseData.working_group || 'Unknown', status: baseData.status || 'Published', publication_date: baseData.publication_date || '2023-01-01', summary: baseData.summary || 'Technical specification for 3GPP telecommunications systems.', dependencies: baseData.dependencies || [], keywords: baseData.keywords || [], ...baseData }; } private generateReleaseInfo(release: string): ReleaseInfo { const releaseData: { [key: string]: ReleaseInfo } = { 'Rel-17': { release: 'Rel-17', freeze_date: '2022-06-01', status: 'Published', specifications: ['TS 23.501', 'TS 23.502', 'TS 32.290', 'TS 33.501', 'TS 38.331'], major_features: [ '5G Advanced features', 'Enhanced Industrial IoT', 'Extended Reality (XR)', 'NR-Light/RedCap', 'Multi-cast broadcast services', 'Enhanced positioning' ] }, 'Rel-16': { release: 'Rel-16', freeze_date: '2021-06-01', status: 'Published', specifications: ['TS 23.501', 'TS 23.502', 'TS 32.255', 'TS 33.501'], major_features: [ '5G Phase 2', 'URLLC enhancements', 'Industrial IoT', 'Vehicle-to-Everything (V2X)', 'Positioning services', 'Network automation' ] }, 'Rel-15': { release: 'Rel-15', freeze_date: '2020-06-01', status: 'Published', specifications: ['TS 23.501', 'TS 23.502', 'TS 38.300'], major_features: [ '5G Phase 1', 'New Radio (NR)', 'Service-based architecture', 'Network slicing', 'Enhanced mobile broadband' ] } }; return releaseData[release] || { release, freeze_date: '2023-01-01', status: 'Unknown', specifications: [], major_features: [] }; } private generateWorkingGroupInfo(wgName: string): WorkingGroupInfo { const wgData: { [key: string]: WorkingGroupInfo } = { 'SA2': { name: 'SA2', full_name: 'Service and System Aspects Working Group 2', focus_area: 'System architecture and services', specifications: ['TS 23.501', 'TS 23.502', 'TS 23.503', 'TS 29.500'], chairperson: 'TBD' }, 'SA3': { name: 'SA3', full_name: 'Service and System Aspects Working Group 3', focus_area: 'Security', specifications: ['TS 33.501', 'TS 33.220', 'TS 33.210'], chairperson: 'TBD' }, 'SA5': { name: 'SA5', full_name: 'Service and System Aspects Working Group 5', focus_area: 'Telecom management', specifications: ['TS 32.240', 'TS 32.290', 'TS 32.251', 'TS 32.255'], chairperson: 'TBD' }, 'RAN2': { name: 'RAN2', full_name: 'Radio Access Network Working Group 2', focus_area: 'Radio interface protocols and procedures', specifications: ['TS 38.331', 'TS 38.300', 'TS 36.331'], chairperson: 'TBD' } }; return wgData[wgName] || { name: wgName, full_name: `${wgName} Working Group`, focus_area: 'Technical specifications', specifications: [], chairperson: 'Unknown' }; } private performSpecificationSearch(query: string, filters?: { release?: string; working_group?: string; series?: string; }): SpecificationMetadata[] { const allSpecs = [ 'TS 32.290', 'TS 32.240', 'TS 32.251', 'TS 32.255', 'TS 38.331', 'TS 38.300', 'TS 38.211', 'TS 33.501', 'TS 33.220', 'TS 33.210', 'TS 23.501', 'TS 23.502', 'TS 23.503' ]; let results = allSpecs.map(specId => this.generateSpecificationMetadata(specId)); // Apply text search if (query && query.trim()) { const searchTerm = query.toLowerCase(); results = results.filter(spec => spec.title.toLowerCase().includes(searchTerm) || spec.summary.toLowerCase().includes(searchTerm) || spec.keywords.some(keyword => keyword.toLowerCase().includes(searchTerm)) ); } // Apply filters if (filters) { if (filters.release) { results = results.filter(spec => spec.release === filters.release); } if (filters.working_group) { results = results.filter(spec => spec.working_group === filters.working_group); } if (filters.series) { results = results.filter(spec => spec.id.includes(filters.series!)); } } return results.slice(0, 20); // Limit results } clearCache(): void { this.cache.flushAll(); } getCacheStats(): { keys: number; hits: number; misses: number } { const stats = this.cache.getStats(); return { keys: this.cache.keys().length, hits: stats.hits, misses: stats.misses }; } }

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/edhijlu/3gpp-mcp-server'

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