From 709eae12e71c980e870f291891aac27584f1a24a Mon Sep 17 00:00:00 2001 From: GabrielDrapor Date: Thu, 21 Aug 2025 11:07:02 +0800 Subject: [PATCH] [generate_manifest] deprecate the former workflow & improve the script --- .github/workflows/mcp-server-info-bot.yml | 2 +- scripts/get_manifest.py | 105 ++++++++++++++-------- 2 files changed, 68 insertions(+), 39 deletions(-) diff --git a/.github/workflows/mcp-server-info-bot.yml b/.github/workflows/mcp-server-info-bot.yml index 3698784a..f520e184 100644 --- a/.github/workflows/mcp-server-info-bot.yml +++ b/.github/workflows/mcp-server-info-bot.yml @@ -1,4 +1,4 @@ -name: MCP Server Info Bot +name: [DEPRECATED] MCP Server Info Bot permissions: contents: write diff --git a/scripts/get_manifest.py b/scripts/get_manifest.py index 321d495f..abb7091d 100644 --- a/scripts/get_manifest.py +++ b/scripts/get_manifest.py @@ -154,45 +154,72 @@ def validate_installations(manifest: dict, repo_url: str) -> Optional[dict]: TASK: Find installation instructions in the README and convert them to the exact schema format used in the MCP registry. INSTALLATION SCHEMA EXAMPLES: - -1. NPX INSTALLATIONS (most common): -```json -"npm": {{ - "type": "npm", - "command": "npx", - "args": ["-y", "@package/name"], - "description": "Install with npx" -}} -``` - -2. UVX INSTALLATIONS: -```json -"uvx": {{ - "type": "uvx", - "command": "uvx", - "args": ["package-name"], - "description": "Run with Claude Desktop" + Docker +{{ + "mcpServers": {{ + "brave-search": {{ + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "-e", + "BRAVE_API_KEY", + "mcp/brave-search" + ], + "env": {{ + "BRAVE_API_KEY": "YOUR_API_KEY_HERE" + }} + }} + }} }} -``` -OR with git URL: -```json -"uvx": {{ - "type": "uvx", - "command": "uvx", - "args": ["--from", "git+https://github.com/user/repo", "command-name"], - "description": "Install from git" +NPX +{{ + "mcpServers": {{ + "brave-search": {{ + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-brave-search" + ], + "env": {{ + "BRAVE_API_KEY": "YOUR_API_KEY_HERE" + }} + }} + }} }} -``` - -3. DOCKER INSTALLATIONS: -```json -"docker": {{ - "type": "docker", - "command": "docker", - "args": ["run", "-i", "--rm", "image-name"], - "description": "Run using Docker" + +From the example README, you should get: +{{ + "installations": [ + {{ + "type": "docker", + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "-e", + "BRAVE_API_KEY", + "mcp/brave-search" + ], + "env": {{ + "BRAVE_API_KEY": "${{YOUR_API_KEY_HERE}}" + }} + }}, + {{ + "type": "npm", + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-brave-search" + ], + "env": {{ + "BRAVE_API_KEY": "${{YOUR_API_KEY_HERE}}" + }} + }} + ] }} -``` PROCESS: 1. Read the README.md from {repo_url} @@ -204,8 +231,8 @@ def validate_installations(manifest: dict, repo_url: str) -> Optional[dict]: - Copy the EXACT package names and arguments from README CRITICAL RULES: -- Use exact package names from README (don't guess or modify) -- Match the schema format exactly as shown in examples +- Use exact argument from README (don't guess or modify) +- Match the schema format as shown in examples - Include ALL installation methods mentioned in README - Remove installation methods NOT mentioned in README - For npx: always use type "npm" with command "npx" and args ["-y", "package-name"] @@ -288,7 +315,9 @@ def main(): # Step 2: Validate and correct installations print("Step 2: Validating installations against README...") + print(f"Before: {json.dumps(manifest, indent=2)}") manifest = validate_installations(manifest, args.repo_url) + print(f"After: {json.dumps(manifest, indent=2)}") # Step 3: Save manifest print("Step 3: Saving manifest...")