Skip to content

Commit bd615a6

Browse files
committed
feat: Update Figma MCP server installation commands and improve configuration
1 parent 58f744c commit bd615a6

File tree

3 files changed

+169
-25
lines changed

3 files changed

+169
-25
lines changed

CLAUDE.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Essential Development Commands
6+
7+
### Testing and Linting
8+
```bash
9+
pytest tests/ # Run all tests
10+
pytest tests/test_specific.py # Run specific test file
11+
ruff check # Run linting
12+
ruff check --fix # Auto-fix linting issues
13+
```
14+
15+
### Development CLI Testing
16+
```bash
17+
./test_cli.py --help # Test CLI without installation
18+
./test_cli.py <command> # Run any CLI command in development
19+
```
20+
21+
### Environment Setup
22+
```bash
23+
uv venv --seed # Create virtual environment
24+
source .venv/bin/activate # Activate environment (Unix/Mac)
25+
uv pip install -e . # Install in development mode
26+
```
27+
28+
### Version Management
29+
```bash
30+
./bump_version.sh 1.2.3 # Bump version to 1.2.3
31+
git push && git push --tags # Push version changes
32+
```
33+
34+
### Website Development
35+
```bash
36+
./dev.sh # Start Jekyll development server with file watching
37+
```
38+
39+
## Architecture Overview
40+
41+
MCPM is a Python CLI tool for managing Model Context Protocol (MCP) servers across different AI clients. The architecture consists of several key components:
42+
43+
### Core Architecture
44+
45+
**Client Management System**: The `src/mcpm/clients/` directory contains the abstraction layer for different MCP clients (Claude Desktop, Cursor, Windsurf, etc.). Each client has its own manager that handles configuration file formats and locations.
46+
47+
**Profile System**: MCPM supports grouping server configurations into named profiles (`src/mcpm/profile/`). This allows users to switch between different sets of MCP servers easily.
48+
49+
**Router Component**: The `src/mcpm/router/` module implements a sophisticated HTTP router that aggregates multiple MCP servers behind a single endpoint. Key features:
50+
- Maintains persistent connections to MCP servers
51+
- Enables session sharing between multiple clients
52+
- Provides namespacing to prevent conflicts
53+
- Supports real-time configuration changes
54+
55+
**Registry Integration**: MCPM includes an internal registry (`mcp-registry/`) with curated MCP servers. The registry data is processed by Python scripts in `scripts/` to generate API endpoints.
56+
57+
**Monitor System**: The `src/mcpm/monitor/` directory contains access monitoring capabilities using DuckDB for local analytics.
58+
59+
### Key Design Patterns
60+
61+
**Target System**: MCPM uses a "target" concept where commands operate on either a specific client (`@client_name`) or profile (`%profile_name`). The active target is managed by `ClientConfigManager`.
62+
63+
**Scope Modifiers**: Commands support scope syntax like `@CLIENT_NAME/SERVER_NAME` or `%PROFILE_NAME/SERVER_NAME` for precise targeting across the system.
64+
65+
**Configuration Management**: All client configurations are abstracted through the `clients/base.py` interface, allowing uniform operations across different client types.
66+
67+
## Project Structure Highlights
68+
69+
- `src/mcpm/cli.py`: Main CLI entry point with Click framework
70+
- `src/mcpm/commands/`: Individual CLI command implementations
71+
- `src/mcpm/clients/managers/`: Client-specific configuration handlers
72+
- `src/mcpm/router/`: HTTP router for MCP server aggregation
73+
- `src/mcpm/schemas/`: Pydantic models for configuration validation
74+
- `mcp-registry/`: Internal registry of curated MCP servers
75+
- `scripts/`: Registry processing and website generation tools
76+
77+
## Development Guidelines
78+
79+
### Commit Messages
80+
Follow conventional commit format:
81+
- `feat: add new feature`
82+
- `fix: resolve bug issue`
83+
- `docs: update documentation`
84+
- `chore: maintenance tasks`
85+
86+
### Code Quality
87+
- Always run `ruff check --fix` after code changes
88+
- Always run `pytest` after major changes
89+
- Use the development CLI script `./test_cli.py` for testing commands
90+
91+
### Version Management
92+
- Version is managed in `src/mcpm/version.py` as single source of truth
93+
- Use `./bump_version.sh` script for version updates
94+
- `pyproject.toml` uses dynamic versioning to read from version.py
95+
96+
## Testing Strategy
97+
98+
The test suite covers:
99+
- CLI command functionality (`tests/test_cli.py`)
100+
- Client manager operations (`tests/test_client.py`)
101+
- Router functionality (`tests/test_router.py`)
102+
- Profile management (`tests/test_profile.py`)
103+
- Server operations (add/remove/stash/pop)
104+
105+
Tests use pytest with configuration in `pyproject.toml`. Individual test files can be run independently for targeted testing.

mcp-registry/servers/figma.json

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@
1111
"name": "Melio"
1212
},
1313
"license": "MIT",
14-
"categories": [
15-
"Professional Apps"
16-
],
17-
"tags": [
18-
"Figma",
19-
"AI"
20-
],
14+
"categories": ["Professional Apps"],
15+
"tags": ["Figma", "AI"],
2116
"installations": {
2217
"custom": {
2318
"type": "custom",
24-
"commands": [
25-
"git clone https://github.com/melio/Figma-Context-MCP.git figma-context-mcp",
26-
"cd figma-context-mcp && npm install",
27-
"cd figma-context-mcp && node index.js --figma-api-key=${FIGMA_API_KEY}"
28-
]
19+
"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+
],
25+
"env": {
26+
"FIGMA_API_KEY": "${FIGMA_API_KEY}"
27+
},
28+
"description": "Clone, build, and run the Figma MCP server using melio-mcp-install.sh",
29+
"recommended": true
2930
}
3031
},
3132
"arguments": {
@@ -55,9 +56,7 @@
5556
"description": "How many levels deep to traverse the node tree, only use if explicitly requested by the user"
5657
}
5758
},
58-
"required": [
59-
"fileKey"
60-
]
59+
"required": ["fileKey"]
6160
}
6261
},
6362
{
@@ -88,10 +87,7 @@
8887
"description": "The local name for saving the fetched file"
8988
}
9089
},
91-
"required": [
92-
"nodeId",
93-
"fileName"
94-
],
90+
"required": ["nodeId", "fileName"],
9591
"additionalProperties": false
9692
},
9793
"description": "The nodes to fetch as images"
@@ -101,12 +97,8 @@
10197
"description": "The absolute path to the directory where images are stored in the project. Automatically creates directories if needed."
10298
}
10399
},
104-
"required": [
105-
"fileKey",
106-
"nodes",
107-
"localPath"
108-
]
100+
"required": ["fileKey", "nodes", "localPath"]
109101
}
110102
}
111103
]
112-
}
104+
}

melio-mcp-install.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# 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"
6+
7+
set -e # Exit on any error
8+
9+
REPO_URL="$1"
10+
SETUP_COMMAND="$2"
11+
RUN_COMMAND="$3"
12+
13+
#echo "\n🔧 Setting up MCP server from repository: $REPO_URL\n"
14+
#echo "📦 Setup command: $SETUP_COMMAND"
15+
#echo "🚀 Run command: $RUN_COMMAND\n"
16+
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+
23+
# Extract repo name from URL (last part without .git)
24+
REPO_NAME=$(basename "$REPO_URL" .git)
25+
TARGET_DIR="$HOME/.meliomcp/$REPO_NAME"
26+
27+
# Create base directory
28+
mkdir -p "$HOME/.meliomcp"
29+
30+
# Clone repository if it doesn't exist (redirect output to stderr)
31+
if [ ! -d "$TARGET_DIR/.git" ]; then
32+
git clone "$REPO_URL" "$TARGET_DIR" >&2
33+
fi
34+
35+
# Change to target directory
36+
cd "$TARGET_DIR"
37+
38+
# Run setup command if dependencies aren't installed (redirect output to stderr)
39+
if [ ! -d "node_modules" ] && [ ! -d ".venv" ] && [ ! -f ".setup_complete" ]; then
40+
eval "$SETUP_COMMAND" >&2
41+
# Create marker file to indicate setup is complete
42+
touch ".setup_complete"
43+
fi
44+
45+
# Run the server
46+
#echo "🚀 Starting server: $RUN_COMMAND"
47+
eval "$RUN_COMMAND"

0 commit comments

Comments
 (0)