|
| 1 | +#!/usr/bin/env python3 |
| 2 | +""" |
| 3 | +Generate a CSV file listing all MCP configuration paths by client and OS. |
| 4 | +""" |
| 5 | +import csv |
| 6 | +import sys |
| 7 | +from pathlib import Path |
| 8 | + |
| 9 | +# Add src to path to import agent_scan modules |
| 10 | +sys.path.insert(0, str(Path(__file__).parent.parent / "src")) |
| 11 | + |
| 12 | +from agent_scan.well_known_clients import ( |
| 13 | + MACOS_WELL_KNOWN_CLIENTS, |
| 14 | + LINUX_WELL_KNOWN_CLIENTS, |
| 15 | + WINDOWS_WELL_KNOWN_CLIENTS, |
| 16 | +) |
| 17 | + |
| 18 | + |
| 19 | +def generate_csv(output_path: str) -> None: |
| 20 | + """Generate CSV file with MCP config locations and skills directories by client and OS.""" |
| 21 | + rows = [] |
| 22 | + |
| 23 | + # Process macOS clients |
| 24 | + for client in MACOS_WELL_KNOWN_CLIENTS: |
| 25 | + for path in client.mcp_config_paths: |
| 26 | + rows.append({ |
| 27 | + "Client Name": client.name, |
| 28 | + "OS": "macOS", |
| 29 | + "Path Type": "MCP Config", |
| 30 | + "Path": path, |
| 31 | + }) |
| 32 | + for path in client.skills_dir_paths: |
| 33 | + rows.append({ |
| 34 | + "Client Name": client.name, |
| 35 | + "OS": "macOS", |
| 36 | + "Path Type": "Skills Directory", |
| 37 | + "Path": path, |
| 38 | + }) |
| 39 | + |
| 40 | + # Process Linux clients |
| 41 | + for client in LINUX_WELL_KNOWN_CLIENTS: |
| 42 | + for path in client.mcp_config_paths: |
| 43 | + rows.append({ |
| 44 | + "Client Name": client.name, |
| 45 | + "OS": "Linux", |
| 46 | + "Path Type": "MCP Config", |
| 47 | + "Path": path, |
| 48 | + }) |
| 49 | + for path in client.skills_dir_paths: |
| 50 | + rows.append({ |
| 51 | + "Client Name": client.name, |
| 52 | + "OS": "Linux", |
| 53 | + "Path Type": "Skills Directory", |
| 54 | + "Path": path, |
| 55 | + }) |
| 56 | + |
| 57 | + # Process Windows clients |
| 58 | + for client in WINDOWS_WELL_KNOWN_CLIENTS: |
| 59 | + for path in client.mcp_config_paths: |
| 60 | + rows.append({ |
| 61 | + "Client Name": client.name, |
| 62 | + "OS": "Windows", |
| 63 | + "Path Type": "MCP Config", |
| 64 | + "Path": path, |
| 65 | + }) |
| 66 | + for path in client.skills_dir_paths: |
| 67 | + rows.append({ |
| 68 | + "Client Name": client.name, |
| 69 | + "OS": "Windows", |
| 70 | + "Path Type": "Skills Directory", |
| 71 | + "Path": path, |
| 72 | + }) |
| 73 | + |
| 74 | + # Write CSV file |
| 75 | + with open(output_path, "w", newline="", encoding="utf-8") as f: |
| 76 | + writer = csv.DictWriter(f, fieldnames=["Client Name", "OS", "Path Type", "Path"]) |
| 77 | + writer.writeheader() |
| 78 | + writer.writerows(rows) |
| 79 | + |
| 80 | + print(f"Generated {output_path} with {len(rows)} entries") |
| 81 | + |
| 82 | + |
| 83 | +if __name__ == "__main__": |
| 84 | + # Generate CSV in the root of the repository |
| 85 | + repo_root = Path(__file__).parent.parent |
| 86 | + output_file = repo_root / "mcp-cfg-locations-by-client-and-os.csv" |
| 87 | + generate_csv(str(output_file)) |
0 commit comments