gfp-mcp 0.1.0__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gfp_mcp-0.2.4/LICENSE +4 -0
- gfp_mcp-0.2.4/PKG-INFO +227 -0
- gfp_mcp-0.2.4/README.md +188 -0
- gfp_mcp-0.2.4/gfp_mcp.egg-info/PKG-INFO +227 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/gfp_mcp.egg-info/SOURCES.txt +2 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/gfp_mcp.egg-info/requires.txt +2 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/mcp_standalone/__init__.py +4 -1
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/mcp_standalone/client.py +61 -19
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/mcp_standalone/config.py +3 -7
- gfp_mcp-0.2.4/mcp_standalone/mappings.py +565 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/mcp_standalone/registry.py +0 -4
- gfp_mcp-0.2.4/mcp_standalone/resources.py +138 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/mcp_standalone/server.py +78 -24
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/mcp_standalone/tools.py +169 -71
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/pyproject.toml +3 -1
- gfp_mcp-0.2.4/tests/test_mcp_integration.py +311 -0
- gfp_mcp-0.2.4/tests/test_mcp_mappings.py +571 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/tests/test_mcp_tools.py +78 -31
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/tests/test_registry.py +0 -12
- gfp_mcp-0.1.0/PKG-INFO +0 -360
- gfp_mcp-0.1.0/README.md +0 -325
- gfp_mcp-0.1.0/gfp_mcp.egg-info/PKG-INFO +0 -360
- gfp_mcp-0.1.0/mcp_standalone/mappings.py +0 -286
- gfp_mcp-0.1.0/tests/test_mcp_integration.py +0 -170
- gfp_mcp-0.1.0/tests/test_mcp_mappings.py +0 -216
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/gfp_mcp.egg-info/dependency_links.txt +0 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/gfp_mcp.egg-info/entry_points.txt +0 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/gfp_mcp.egg-info/top_level.txt +0 -0
- {gfp_mcp-0.1.0 → gfp_mcp-0.2.4}/setup.cfg +0 -0
gfp_mcp-0.2.4/LICENSE
ADDED
gfp_mcp-0.2.4/PKG-INFO
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gfp-mcp
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Model Context Protocol (MCP) server for GDSFactory+ photonic IC design
|
|
5
|
+
Author: GDSFactory+ Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/doplaydo/gfp-mcp
|
|
8
|
+
Project-URL: Repository, https://github.com/doplaydo/gfp-mcp
|
|
9
|
+
Project-URL: Documentation, https://github.com/doplaydo/gfp-mcp#readme
|
|
10
|
+
Project-URL: Changelog, https://github.com/doplaydo/gfp-mcp/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Issue Tracker, https://github.com/doplaydo/gfp-mcp/issues
|
|
12
|
+
Keywords: mcp,gdsfactory,photonics,ic-design,eda,model-context-protocol,photonic-ic,gds
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: mcp>=1.7.1
|
|
28
|
+
Requires-Dist: httpx>=0.25.0
|
|
29
|
+
Requires-Dist: typing-extensions>=4.0.0; python_version < "3.11"
|
|
30
|
+
Requires-Dist: psutil>=5.9.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
36
|
+
Requires-Dist: bump-my-version>=0.26.0; extra == "dev"
|
|
37
|
+
Requires-Dist: build>=1.4.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# GDSFactory+ MCP Server
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/gfp-mcp/)
|
|
43
|
+
[](https://pypi.org/project/gfp-mcp/)
|
|
44
|
+
[](https://github.com/doplaydo/gfp-mcp/actions)
|
|
45
|
+
[](https://opensource.org/licenses/MIT)
|
|
46
|
+
|
|
47
|
+
Model Context Protocol (MCP) server for GDSFactory+ that enables AI assistants like Claude to design and build photonic integrated circuits.
|
|
48
|
+
|
|
49
|
+
## What is this?
|
|
50
|
+
|
|
51
|
+
This MCP server connects AI assistants to [GDSFactory+](https://gdsfactory.com), allowing you to design photonic ICs through natural language. Build components, run verification checks, and manage multiple projects directly from Claude Code or Claude Desktop.
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### 1. Install Prerequisites
|
|
56
|
+
|
|
57
|
+
- Python 3.10 or higher
|
|
58
|
+
- VSCode with the [GDSFactory+ extension](https://marketplace.visualstudio.com/items?itemName=gdsfactory.gdsfactoryplus) installed
|
|
59
|
+
|
|
60
|
+
### 2. Install the MCP Server
|
|
61
|
+
|
|
62
|
+
**With uv (recommended):**
|
|
63
|
+
|
|
64
|
+
If you don't have `uv` installed, see the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/).
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
uv tool install gfp-mcp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<details>
|
|
71
|
+
<summary>Ephemeral approach</summary>
|
|
72
|
+
|
|
73
|
+
Run without installing:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
uvx --from gfp-mcp gfp-mcp-serve
|
|
77
|
+
```
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
<details>
|
|
81
|
+
<summary><strong>Alternative: pip install</strong></summary>
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install gfp-mcp
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
### 3. Connect to Your AI Assistant
|
|
90
|
+
|
|
91
|
+
<details>
|
|
92
|
+
<summary><strong>Claude Code</strong></summary>
|
|
93
|
+
|
|
94
|
+
Add to `.claude/settings.json`:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"gdsfactoryplus": {
|
|
100
|
+
"command": "gfp-mcp-serve",
|
|
101
|
+
"args": [],
|
|
102
|
+
"env": {
|
|
103
|
+
"GFP_API_URL": "http://localhost:8787"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Or use the CLI:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
claude mcp add gdsfactoryplus -- gfp-mcp-serve
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
</details>
|
|
117
|
+
|
|
118
|
+
<details>
|
|
119
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
120
|
+
|
|
121
|
+
Add to your config file:
|
|
122
|
+
|
|
123
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
124
|
+
|
|
125
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
126
|
+
|
|
127
|
+
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"mcpServers": {
|
|
132
|
+
"gdsfactoryplus": {
|
|
133
|
+
"command": "gfp-mcp-serve",
|
|
134
|
+
"args": []
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Restart Claude Desktop after adding the configuration.
|
|
141
|
+
|
|
142
|
+
</details>
|
|
143
|
+
|
|
144
|
+
<details>
|
|
145
|
+
<summary><strong>Cursor</strong></summary>
|
|
146
|
+
|
|
147
|
+
Coming soon. Follow the MCP integration instructions for Cursor when available.
|
|
148
|
+
|
|
149
|
+
</details>
|
|
150
|
+
|
|
151
|
+
### 4. Start Designing
|
|
152
|
+
|
|
153
|
+
The MCP server automatically discovers running GDSFactory+ servers via the registry (`~/.gdsfactory/server-registry.json`). On startup, it will log all discovered projects.
|
|
154
|
+
|
|
155
|
+
Try these commands with your AI assistant:
|
|
156
|
+
|
|
157
|
+
- "List all available photonic components"
|
|
158
|
+
- "Build an MZI interferometer"
|
|
159
|
+
- "Show me details about the directional coupler"
|
|
160
|
+
- "Build multiple components: mzi, coupler, and bend_euler"
|
|
161
|
+
- "List all my GDSFactory+ projects"
|
|
162
|
+
|
|
163
|
+
## Available Tools
|
|
164
|
+
|
|
165
|
+
- **build_cells** - Build one or more GDS cells by name (pass a list, can be single-item)
|
|
166
|
+
- **list_cells** - List all available photonic components
|
|
167
|
+
- **get_cell_info** - Get detailed component metadata
|
|
168
|
+
- **list_projects** - List all running GDSFactory+ server instances
|
|
169
|
+
- **get_project_info** - Get detailed information about a specific project
|
|
170
|
+
- **check_drc** - Run Design Rule Check verification (returns structured format with all violations including simplified location data for LLM-friendly troubleshooting)
|
|
171
|
+
- **check_connectivity** - Run connectivity verification
|
|
172
|
+
- **check_lvs** - Run Layout vs. Schematic verification
|
|
173
|
+
|
|
174
|
+
## Multi-Project Support
|
|
175
|
+
|
|
176
|
+
The MCP server automatically discovers all running GDSFactory+ projects via the server registry (`~/.gdsfactory/server-registry.json`). The registry is the source of truth for available servers. Use the `list_projects` tool to see all running projects, then specify the project name when building components:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
User: "List all my GDSFactory+ projects"
|
|
180
|
+
Claude: [Uses list_projects tool to show all running servers]
|
|
181
|
+
|
|
182
|
+
User: "Build the mzi component in my_photonics_project"
|
|
183
|
+
Claude: [Routes request to the correct project]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Troubleshooting
|
|
187
|
+
|
|
188
|
+
<details>
|
|
189
|
+
<summary><strong>Server not appearing in Claude</strong></summary>
|
|
190
|
+
|
|
191
|
+
1. Verify installation: `gfp-mcp-serve --help`
|
|
192
|
+
2. Check Claude Code logs: `claude --debug`
|
|
193
|
+
3. Restart Claude Desktop/Code
|
|
194
|
+
4. Ensure the GDSFactory+ VSCode extension is active and a project is open
|
|
195
|
+
|
|
196
|
+
</details>
|
|
197
|
+
|
|
198
|
+
<details>
|
|
199
|
+
<summary><strong>Connection refused errors</strong></summary>
|
|
200
|
+
|
|
201
|
+
The MCP server uses the registry (`~/.gdsfactory/server-registry.json`) to discover running servers.
|
|
202
|
+
|
|
203
|
+
1. Use the `list_projects` tool in Claude to check available servers
|
|
204
|
+
2. If no servers are found, ensure the GDSFactory+ VSCode extension is running with an active project:
|
|
205
|
+
- Open VSCode with the GDSFactory+ extension installed
|
|
206
|
+
- Open a GDSFactory+ project folder
|
|
207
|
+
- The extension automatically starts the server and registers it
|
|
208
|
+
3. Check the MCP startup logs for discovered servers
|
|
209
|
+
4. Verify the registry is accessible at `~/.gdsfactory/server-registry.json`
|
|
210
|
+
5. For backward compatibility, you can set a specific server URL:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
export GFP_API_URL="http://localhost:YOUR_PORT"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
</details>
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary><strong>Tool execution timeout</strong></summary>
|
|
220
|
+
|
|
221
|
+
Increase the timeout for long-running operations:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
export GFP_MCP_TIMEOUT=600 # 10 minutes
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
</details>
|
gfp_mcp-0.2.4/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# GDSFactory+ MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/gfp-mcp/)
|
|
4
|
+
[](https://pypi.org/project/gfp-mcp/)
|
|
5
|
+
[](https://github.com/doplaydo/gfp-mcp/actions)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Model Context Protocol (MCP) server for GDSFactory+ that enables AI assistants like Claude to design and build photonic integrated circuits.
|
|
9
|
+
|
|
10
|
+
## What is this?
|
|
11
|
+
|
|
12
|
+
This MCP server connects AI assistants to [GDSFactory+](https://gdsfactory.com), allowing you to design photonic ICs through natural language. Build components, run verification checks, and manage multiple projects directly from Claude Code or Claude Desktop.
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### 1. Install Prerequisites
|
|
17
|
+
|
|
18
|
+
- Python 3.10 or higher
|
|
19
|
+
- VSCode with the [GDSFactory+ extension](https://marketplace.visualstudio.com/items?itemName=gdsfactory.gdsfactoryplus) installed
|
|
20
|
+
|
|
21
|
+
### 2. Install the MCP Server
|
|
22
|
+
|
|
23
|
+
**With uv (recommended):**
|
|
24
|
+
|
|
25
|
+
If you don't have `uv` installed, see the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/).
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
uv tool install gfp-mcp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<details>
|
|
32
|
+
<summary>Ephemeral approach</summary>
|
|
33
|
+
|
|
34
|
+
Run without installing:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uvx --from gfp-mcp gfp-mcp-serve
|
|
38
|
+
```
|
|
39
|
+
</details>
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary><strong>Alternative: pip install</strong></summary>
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install gfp-mcp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
### 3. Connect to Your AI Assistant
|
|
51
|
+
|
|
52
|
+
<details>
|
|
53
|
+
<summary><strong>Claude Code</strong></summary>
|
|
54
|
+
|
|
55
|
+
Add to `.claude/settings.json`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"gdsfactoryplus": {
|
|
61
|
+
"command": "gfp-mcp-serve",
|
|
62
|
+
"args": [],
|
|
63
|
+
"env": {
|
|
64
|
+
"GFP_API_URL": "http://localhost:8787"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Or use the CLI:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
claude mcp add gdsfactoryplus -- gfp-mcp-serve
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
</details>
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
81
|
+
|
|
82
|
+
Add to your config file:
|
|
83
|
+
|
|
84
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
85
|
+
|
|
86
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
87
|
+
|
|
88
|
+
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"gdsfactoryplus": {
|
|
94
|
+
"command": "gfp-mcp-serve",
|
|
95
|
+
"args": []
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Restart Claude Desktop after adding the configuration.
|
|
102
|
+
|
|
103
|
+
</details>
|
|
104
|
+
|
|
105
|
+
<details>
|
|
106
|
+
<summary><strong>Cursor</strong></summary>
|
|
107
|
+
|
|
108
|
+
Coming soon. Follow the MCP integration instructions for Cursor when available.
|
|
109
|
+
|
|
110
|
+
</details>
|
|
111
|
+
|
|
112
|
+
### 4. Start Designing
|
|
113
|
+
|
|
114
|
+
The MCP server automatically discovers running GDSFactory+ servers via the registry (`~/.gdsfactory/server-registry.json`). On startup, it will log all discovered projects.
|
|
115
|
+
|
|
116
|
+
Try these commands with your AI assistant:
|
|
117
|
+
|
|
118
|
+
- "List all available photonic components"
|
|
119
|
+
- "Build an MZI interferometer"
|
|
120
|
+
- "Show me details about the directional coupler"
|
|
121
|
+
- "Build multiple components: mzi, coupler, and bend_euler"
|
|
122
|
+
- "List all my GDSFactory+ projects"
|
|
123
|
+
|
|
124
|
+
## Available Tools
|
|
125
|
+
|
|
126
|
+
- **build_cells** - Build one or more GDS cells by name (pass a list, can be single-item)
|
|
127
|
+
- **list_cells** - List all available photonic components
|
|
128
|
+
- **get_cell_info** - Get detailed component metadata
|
|
129
|
+
- **list_projects** - List all running GDSFactory+ server instances
|
|
130
|
+
- **get_project_info** - Get detailed information about a specific project
|
|
131
|
+
- **check_drc** - Run Design Rule Check verification (returns structured format with all violations including simplified location data for LLM-friendly troubleshooting)
|
|
132
|
+
- **check_connectivity** - Run connectivity verification
|
|
133
|
+
- **check_lvs** - Run Layout vs. Schematic verification
|
|
134
|
+
|
|
135
|
+
## Multi-Project Support
|
|
136
|
+
|
|
137
|
+
The MCP server automatically discovers all running GDSFactory+ projects via the server registry (`~/.gdsfactory/server-registry.json`). The registry is the source of truth for available servers. Use the `list_projects` tool to see all running projects, then specify the project name when building components:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
User: "List all my GDSFactory+ projects"
|
|
141
|
+
Claude: [Uses list_projects tool to show all running servers]
|
|
142
|
+
|
|
143
|
+
User: "Build the mzi component in my_photonics_project"
|
|
144
|
+
Claude: [Routes request to the correct project]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Troubleshooting
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary><strong>Server not appearing in Claude</strong></summary>
|
|
151
|
+
|
|
152
|
+
1. Verify installation: `gfp-mcp-serve --help`
|
|
153
|
+
2. Check Claude Code logs: `claude --debug`
|
|
154
|
+
3. Restart Claude Desktop/Code
|
|
155
|
+
4. Ensure the GDSFactory+ VSCode extension is active and a project is open
|
|
156
|
+
|
|
157
|
+
</details>
|
|
158
|
+
|
|
159
|
+
<details>
|
|
160
|
+
<summary><strong>Connection refused errors</strong></summary>
|
|
161
|
+
|
|
162
|
+
The MCP server uses the registry (`~/.gdsfactory/server-registry.json`) to discover running servers.
|
|
163
|
+
|
|
164
|
+
1. Use the `list_projects` tool in Claude to check available servers
|
|
165
|
+
2. If no servers are found, ensure the GDSFactory+ VSCode extension is running with an active project:
|
|
166
|
+
- Open VSCode with the GDSFactory+ extension installed
|
|
167
|
+
- Open a GDSFactory+ project folder
|
|
168
|
+
- The extension automatically starts the server and registers it
|
|
169
|
+
3. Check the MCP startup logs for discovered servers
|
|
170
|
+
4. Verify the registry is accessible at `~/.gdsfactory/server-registry.json`
|
|
171
|
+
5. For backward compatibility, you can set a specific server URL:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
export GFP_API_URL="http://localhost:YOUR_PORT"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
</details>
|
|
178
|
+
|
|
179
|
+
<details>
|
|
180
|
+
<summary><strong>Tool execution timeout</strong></summary>
|
|
181
|
+
|
|
182
|
+
Increase the timeout for long-running operations:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
export GFP_MCP_TIMEOUT=600 # 10 minutes
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</details>
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gfp-mcp
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Model Context Protocol (MCP) server for GDSFactory+ photonic IC design
|
|
5
|
+
Author: GDSFactory+ Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/doplaydo/gfp-mcp
|
|
8
|
+
Project-URL: Repository, https://github.com/doplaydo/gfp-mcp
|
|
9
|
+
Project-URL: Documentation, https://github.com/doplaydo/gfp-mcp#readme
|
|
10
|
+
Project-URL: Changelog, https://github.com/doplaydo/gfp-mcp/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Issue Tracker, https://github.com/doplaydo/gfp-mcp/issues
|
|
12
|
+
Keywords: mcp,gdsfactory,photonics,ic-design,eda,model-context-protocol,photonic-ic,gds
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: mcp>=1.7.1
|
|
28
|
+
Requires-Dist: httpx>=0.25.0
|
|
29
|
+
Requires-Dist: typing-extensions>=4.0.0; python_version < "3.11"
|
|
30
|
+
Requires-Dist: psutil>=5.9.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
36
|
+
Requires-Dist: bump-my-version>=0.26.0; extra == "dev"
|
|
37
|
+
Requires-Dist: build>=1.4.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# GDSFactory+ MCP Server
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/gfp-mcp/)
|
|
43
|
+
[](https://pypi.org/project/gfp-mcp/)
|
|
44
|
+
[](https://github.com/doplaydo/gfp-mcp/actions)
|
|
45
|
+
[](https://opensource.org/licenses/MIT)
|
|
46
|
+
|
|
47
|
+
Model Context Protocol (MCP) server for GDSFactory+ that enables AI assistants like Claude to design and build photonic integrated circuits.
|
|
48
|
+
|
|
49
|
+
## What is this?
|
|
50
|
+
|
|
51
|
+
This MCP server connects AI assistants to [GDSFactory+](https://gdsfactory.com), allowing you to design photonic ICs through natural language. Build components, run verification checks, and manage multiple projects directly from Claude Code or Claude Desktop.
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### 1. Install Prerequisites
|
|
56
|
+
|
|
57
|
+
- Python 3.10 or higher
|
|
58
|
+
- VSCode with the [GDSFactory+ extension](https://marketplace.visualstudio.com/items?itemName=gdsfactory.gdsfactoryplus) installed
|
|
59
|
+
|
|
60
|
+
### 2. Install the MCP Server
|
|
61
|
+
|
|
62
|
+
**With uv (recommended):**
|
|
63
|
+
|
|
64
|
+
If you don't have `uv` installed, see the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/).
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
uv tool install gfp-mcp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<details>
|
|
71
|
+
<summary>Ephemeral approach</summary>
|
|
72
|
+
|
|
73
|
+
Run without installing:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
uvx --from gfp-mcp gfp-mcp-serve
|
|
77
|
+
```
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
<details>
|
|
81
|
+
<summary><strong>Alternative: pip install</strong></summary>
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install gfp-mcp
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
### 3. Connect to Your AI Assistant
|
|
90
|
+
|
|
91
|
+
<details>
|
|
92
|
+
<summary><strong>Claude Code</strong></summary>
|
|
93
|
+
|
|
94
|
+
Add to `.claude/settings.json`:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"gdsfactoryplus": {
|
|
100
|
+
"command": "gfp-mcp-serve",
|
|
101
|
+
"args": [],
|
|
102
|
+
"env": {
|
|
103
|
+
"GFP_API_URL": "http://localhost:8787"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Or use the CLI:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
claude mcp add gdsfactoryplus -- gfp-mcp-serve
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
</details>
|
|
117
|
+
|
|
118
|
+
<details>
|
|
119
|
+
<summary><strong>Claude Desktop</strong></summary>
|
|
120
|
+
|
|
121
|
+
Add to your config file:
|
|
122
|
+
|
|
123
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
124
|
+
|
|
125
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
126
|
+
|
|
127
|
+
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"mcpServers": {
|
|
132
|
+
"gdsfactoryplus": {
|
|
133
|
+
"command": "gfp-mcp-serve",
|
|
134
|
+
"args": []
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Restart Claude Desktop after adding the configuration.
|
|
141
|
+
|
|
142
|
+
</details>
|
|
143
|
+
|
|
144
|
+
<details>
|
|
145
|
+
<summary><strong>Cursor</strong></summary>
|
|
146
|
+
|
|
147
|
+
Coming soon. Follow the MCP integration instructions for Cursor when available.
|
|
148
|
+
|
|
149
|
+
</details>
|
|
150
|
+
|
|
151
|
+
### 4. Start Designing
|
|
152
|
+
|
|
153
|
+
The MCP server automatically discovers running GDSFactory+ servers via the registry (`~/.gdsfactory/server-registry.json`). On startup, it will log all discovered projects.
|
|
154
|
+
|
|
155
|
+
Try these commands with your AI assistant:
|
|
156
|
+
|
|
157
|
+
- "List all available photonic components"
|
|
158
|
+
- "Build an MZI interferometer"
|
|
159
|
+
- "Show me details about the directional coupler"
|
|
160
|
+
- "Build multiple components: mzi, coupler, and bend_euler"
|
|
161
|
+
- "List all my GDSFactory+ projects"
|
|
162
|
+
|
|
163
|
+
## Available Tools
|
|
164
|
+
|
|
165
|
+
- **build_cells** - Build one or more GDS cells by name (pass a list, can be single-item)
|
|
166
|
+
- **list_cells** - List all available photonic components
|
|
167
|
+
- **get_cell_info** - Get detailed component metadata
|
|
168
|
+
- **list_projects** - List all running GDSFactory+ server instances
|
|
169
|
+
- **get_project_info** - Get detailed information about a specific project
|
|
170
|
+
- **check_drc** - Run Design Rule Check verification (returns structured format with all violations including simplified location data for LLM-friendly troubleshooting)
|
|
171
|
+
- **check_connectivity** - Run connectivity verification
|
|
172
|
+
- **check_lvs** - Run Layout vs. Schematic verification
|
|
173
|
+
|
|
174
|
+
## Multi-Project Support
|
|
175
|
+
|
|
176
|
+
The MCP server automatically discovers all running GDSFactory+ projects via the server registry (`~/.gdsfactory/server-registry.json`). The registry is the source of truth for available servers. Use the `list_projects` tool to see all running projects, then specify the project name when building components:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
User: "List all my GDSFactory+ projects"
|
|
180
|
+
Claude: [Uses list_projects tool to show all running servers]
|
|
181
|
+
|
|
182
|
+
User: "Build the mzi component in my_photonics_project"
|
|
183
|
+
Claude: [Routes request to the correct project]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Troubleshooting
|
|
187
|
+
|
|
188
|
+
<details>
|
|
189
|
+
<summary><strong>Server not appearing in Claude</strong></summary>
|
|
190
|
+
|
|
191
|
+
1. Verify installation: `gfp-mcp-serve --help`
|
|
192
|
+
2. Check Claude Code logs: `claude --debug`
|
|
193
|
+
3. Restart Claude Desktop/Code
|
|
194
|
+
4. Ensure the GDSFactory+ VSCode extension is active and a project is open
|
|
195
|
+
|
|
196
|
+
</details>
|
|
197
|
+
|
|
198
|
+
<details>
|
|
199
|
+
<summary><strong>Connection refused errors</strong></summary>
|
|
200
|
+
|
|
201
|
+
The MCP server uses the registry (`~/.gdsfactory/server-registry.json`) to discover running servers.
|
|
202
|
+
|
|
203
|
+
1. Use the `list_projects` tool in Claude to check available servers
|
|
204
|
+
2. If no servers are found, ensure the GDSFactory+ VSCode extension is running with an active project:
|
|
205
|
+
- Open VSCode with the GDSFactory+ extension installed
|
|
206
|
+
- Open a GDSFactory+ project folder
|
|
207
|
+
- The extension automatically starts the server and registers it
|
|
208
|
+
3. Check the MCP startup logs for discovered servers
|
|
209
|
+
4. Verify the registry is accessible at `~/.gdsfactory/server-registry.json`
|
|
210
|
+
5. For backward compatibility, you can set a specific server URL:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
export GFP_API_URL="http://localhost:YOUR_PORT"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
</details>
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary><strong>Tool execution timeout</strong></summary>
|
|
220
|
+
|
|
221
|
+
Increase the timeout for long-running operations:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
export GFP_MCP_TIMEOUT=600 # 10 minutes
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
</details>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
LICENSE
|
|
1
2
|
README.md
|
|
2
3
|
pyproject.toml
|
|
3
4
|
gfp_mcp.egg-info/PKG-INFO
|
|
@@ -11,6 +12,7 @@ mcp_standalone/client.py
|
|
|
11
12
|
mcp_standalone/config.py
|
|
12
13
|
mcp_standalone/mappings.py
|
|
13
14
|
mcp_standalone/registry.py
|
|
15
|
+
mcp_standalone/resources.py
|
|
14
16
|
mcp_standalone/server.py
|
|
15
17
|
mcp_standalone/tools.py
|
|
16
18
|
tests/test_mcp_integration.py
|
|
@@ -23,6 +23,7 @@ from __future__ import annotations
|
|
|
23
23
|
|
|
24
24
|
from .client import FastAPIClient
|
|
25
25
|
from .config import MCPConfig
|
|
26
|
+
from .resources import get_all_resources, get_resource_content
|
|
26
27
|
from .server import create_server, main, run_server
|
|
27
28
|
from .tools import get_all_tools, get_tool_by_name
|
|
28
29
|
|
|
@@ -34,6 +35,8 @@ __all__ = [
|
|
|
34
35
|
"run_server",
|
|
35
36
|
"get_all_tools",
|
|
36
37
|
"get_tool_by_name",
|
|
38
|
+
"get_all_resources",
|
|
39
|
+
"get_resource_content",
|
|
37
40
|
]
|
|
38
41
|
|
|
39
|
-
__version__ = "0.
|
|
42
|
+
__version__ = "0.2.4"
|