MCPcopy Create free account
hub / github.com/chokcoco/iCSS / fetchDirectoryContents

Method fetchDirectoryContents

MCP/scripts/fetch-inspiration.js:122–144  ·  view source on GitHub ↗
(category)

Source from the content-addressed store, hash-verified

120 }
121
122 async fetchDirectoryContents(category) {
123 console.log(`📂 Fetching contents for category: ${category}`);
124
125 try {
126 const response = await axios.get(`${this.baseURL}/contents/${category}`, {
127 headers: {
128 'Accept': 'application/vnd.github.v3+json',
129 'User-Agent': 'iCSS-MCP-Server',
130 ...(this.githubToken && { 'Authorization': `token ${this.githubToken}` })
131 }
132 });
133
134 const files = response.data.filter(item =>
135 item.type === 'file' && item.name.endsWith('.md')
136 );
137
138 console.log(` 📝 Found ${files.length} markdown files in ${category}`);
139 return files;
140 } catch (error) {
141 console.error(`❌ Error fetching ${category} contents:`, error.message);
142 return [];
143 }
144 }
145
146 async fetchFileContent(filePath) {
147 try {

Callers 1

fetchAllInspirationsMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected