Skip to content

Commit 2db0c39

Browse files
committed
use env vars instead of arguments
1 parent bd615a6 commit 2db0c39

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

mcp-registry/servers/figma.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
"custom": {
1818
"type": "custom",
1919
"command": "melio-mcp-install.sh",
20-
"args": [
21-
"https://github.com/melio/Figma-Context-MCP.git",
22-
"npm install && npm run build",
23-
"node dist/cli.js --stdio"
24-
],
20+
"args": [],
2521
"env": {
26-
"FIGMA_API_KEY": "${FIGMA_API_KEY}"
22+
"FIGMA_API_KEY": "${FIGMA_API_KEY}",
23+
"MCP_REPO_URL": "https://github.com/melio/Figma-Context-MCP.git",
24+
"MCP_SETUP_COMMAND": "npm install && npm run build",
25+
"MCP_RUN_COMMAND": "node dist/cli.js --stdio"
2726
},
2827
"description": "Clone, build, and run the Figma MCP server using melio-mcp-install.sh",
2928
"recommended": true
@@ -45,7 +44,7 @@
4544
"properties": {
4645
"fileKey": {
4746
"type": "string",
48-
"description": "The key of the Figma file to fetch, often found in a provided URL like figma.com/(file|design)/<fileKey>/..."
47+
"description": "//The key of the Figma file to fetch, often found in a provided URL like figma.com/(file|design)/<fileKey>/..."
4948
},
5049
"nodeId": {
5150
"type": "string",

melio-mcp-install.sh

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
#!/bin/bash
22

33
# melio-mcp-install.sh - Universal MCP server installer and runner
4-
# Usage: melio-mcp-install.sh <repo_url> <setup_command> <run_command>
5-
# Example: melio-mcp-install.sh "https://github.com/melio/Figma-Context-MCP.git" "npm install && npm run build" "node dist/cli.js"
4+
# Usage: Set environment variables and run the script:
5+
# export MCP_REPO_URL="https://github.com/user/repo.git"
6+
# export MCP_SETUP_COMMAND="npm install && npm run build"
7+
# export MCP_RUN_COMMAND="node dist/cli.js --stdio"
8+
# ./melio-mcp-install.sh
69

710
set -e # Exit on any error
811

9-
REPO_URL="$1"
10-
SETUP_COMMAND="$2"
11-
RUN_COMMAND="$3"
12+
# Check for required environment variables
13+
if [ -z "$MCP_REPO_URL" ] || [ -z "$MCP_SETUP_COMMAND" ] || [ -z "$MCP_RUN_COMMAND" ]; then
14+
echo "Error: Missing required environment variables:" >&2
15+
echo " MCP_REPO_URL: $MCP_REPO_URL" >&2
16+
echo " MCP_SETUP_COMMAND: $MCP_SETUP_COMMAND" >&2
17+
echo " MCP_RUN_COMMAND: $MCP_RUN_COMMAND" >&2
18+
echo "" >&2
19+
echo "Usage:" >&2
20+
echo " export MCP_REPO_URL=\"https://github.com/user/repo.git\"" >&2
21+
echo " export MCP_SETUP_COMMAND=\"npm install && npm run build\"" >&2
22+
echo " export MCP_RUN_COMMAND=\"node dist/cli.js --stdio\"" >&2
23+
echo " $0" >&2
24+
exit 1
25+
fi
26+
27+
REPO_URL="$MCP_REPO_URL"
28+
SETUP_COMMAND="$MCP_SETUP_COMMAND"
29+
RUN_COMMAND="$MCP_RUN_COMMAND"
1230

1331
#echo "\n🔧 Setting up MCP server from repository: $REPO_URL\n"
1432
#echo "📦 Setup command: $SETUP_COMMAND"
1533
#echo "🚀 Run command: $RUN_COMMAND\n"
1634

17-
if [ $# -ne 3 ]; then
18-
# Redirect error to stderr, not stdout (to avoid breaking MCP JSON protocol)
19-
echo "Error: Invalid arguments. Usage: $0 <repo_url> <setup_command> <run_command>" >&2
20-
exit 1
21-
fi
22-
2335
# Extract repo name from URL (last part without .git)
2436
REPO_NAME=$(basename "$REPO_URL" .git)
2537
TARGET_DIR="$HOME/.meliomcp/$REPO_NAME"

0 commit comments

Comments
 (0)