mushcode-mcp-server
Version:
A specialized Model Context Protocol server for MUSHCODE development assistance. Provides AI-powered code generation, validation, optimization, and examples for MUD development.
97 lines • 2.36 kB
TypeScript
/**
* GitHub repository scraper for MUSHCODE content
* Scrapes MUSHCODE files from GitHub repositories to enhance the knowledge base
*/
import { MushcodeKnowledgeBase } from './base.js';
export interface GitHubRepo {
owner: string;
name: string;
branch?: string;
description?: string;
}
export interface GitHubFile {
name: string;
path: string;
content: string;
size: number;
sha: string;
}
export declare class GitHubScraper {
private knowledgeBase;
private baseUrl;
private token;
constructor(knowledgeBase: MushcodeKnowledgeBase, token?: string);
/**
* Get headers for GitHub API requests
*/
private getHeaders;
/**
* Scrape MUSHCODE content from GitHub repositories
*/
scrapeRepositories(repos: GitHubRepo[]): Promise<void>;
/**
* Scrape a single GitHub repository
*/
private scrapeRepository;
/**
* Get all files from a GitHub repository
*/
private getRepositoryFiles;
/**
* Get content of a specific file from GitHub
*/
private getFileContent;
/**
* Check if a file is a MUSHCODE file
*/
private isMushcodeFile;
/**
* Process a MUSHCODE file and extract patterns/examples
*/
private processFile;
/**
* Extract MUSHCODE patterns from file content
*/
private extractPatterns;
/**
* Extract code examples from file content
*/
private extractExamples;
/**
* Create a pattern from a function definition
*/
private createPatternFromFunction;
/**
* Create a pattern from a command definition
*/
private createPatternFromCommand;
/**
* Infer the category of code based on content
*/
private inferCategory;
/**
* Infer difficulty based on code complexity
*/
private inferDifficulty;
/**
* Calculate code complexity score
*/
private calculateComplexity;
/**
* Infer security level based on code content
*/
private inferSecurityLevel;
/**
* Extract parameters from code
*/
private extractParameters;
/**
* Extract tags from content and file path
*/
private extractTags;
/**
* Extract related concepts from content
*/
private extractConcepts;
}
//# sourceMappingURL=github-scraper.d.ts.map