-
Notifications
You must be signed in to change notification settings - Fork 87
[generate_manifest] deprecate the former workflow & improve the script #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: MCP Server Info Bot | ||
| name: [DEPRECATED] MCP Server Info Bot | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
| <README> 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" | ||
| </README> | ||
| 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}}" | ||
| }} | ||
| }} | ||
| ] | ||
| }} | ||
| ``` | ||
|
|
||
|
Comment on lines
+157
to
223
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix f-string brace escaping; this block will not compile as written. The multi-line f-string contains many literal JSON braces that aren’t escaped. Python requires doubling braces inside f-strings, otherwise you get a SyntaxError at import time. Also, the example/return-shape messaging mixes array vs. map forms for "installations". Replace the large JSON example with a prebuilt string and inject it via a single Apply this focused diff to eliminate the brace-escape problem and keep the string readable: - INSTALLATION SCHEMA EXAMPLES:
-<README> 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"
- }}
- }}
- }}
-}
-NPX
-{
- "mcpServers": {{
- "brave-search": {{
- "command": "npx",
- "args": [
- "-y",
- "@modelcontextprotocol/server-brave-search"
- ],
- "env": {{
- "BRAVE_API_KEY": "YOUR_API_KEY_HERE"
- }}
- }}
- }}
-}
-</README>
-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}}"
- }}
- }}
- ]
-}
+ INSTALLATION SCHEMA EXAMPLES:
+{examples_block}Add this helper (outside the selected lines) before constructing from textwrap import dedent # at top-level imports
# inside validate_installations(), just before 'payload = {...}'
examples_block = dedent("""
<README> 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"
}
}
}
}
NPX
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-brave-search"
],
"env": {
"BRAVE_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
</README>
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}"
}
}
]
}
""")🤖 Prompt for AI Agents |
||
| 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...") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the workflow name to fix YAML syntax error.
Unquoted square brackets are parsed as a flow sequence in YAML. YAMLlint’s error aligns with this. Quote the name to keep it a plain string.
📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 1-1: syntax error: expected , but found ''
(syntax)
🤖 Prompt for AI Agents