MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / readMcpbIgnorePatterns

Function readMcpbIgnorePatterns

src/node/files.ts:45–63  ·  view source on GitHub ↗
(baseDir: string)

Source from the content-addressed store, hash-verified

43 * Read and parse .mcpbignore file patterns
44 */
45export function readMcpbIgnorePatterns(baseDir: string): string[] {
46 const mcpbIgnorePath = join(baseDir, ".mcpbignore");
47 if (!existsSync(mcpbIgnorePath)) {
48 return [];
49 }
50
51 try {
52 const content = readFileSync(mcpbIgnorePath, "utf-8");
53 return content
54 .split(/\r?\n/)
55 .map((line) => line.trim())
56 .filter((line) => line.length > 0 && !line.startsWith("#"));
57 } catch (error) {
58 console.warn(
59 `Warning: Could not read .mcpbignore file: ${error instanceof Error ? error.message : "Unknown error"}`,
60 );
61 return [];
62 }
63}
64
65function buildIgnoreChecker(additionalPatterns: string[]) {
66 return ignore().add(EXCLUDE_PATTERNS).add(additionalPatterns);

Callers 2

mcpbignore.test.tsFile · 0.85
packExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…