gfp-mcp 0.1.0__tar.gz → 0.2.1__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.
Files changed (26) hide show
  1. gfp_mcp-0.2.1/LICENSE +4 -0
  2. gfp_mcp-0.2.1/PKG-INFO +210 -0
  3. gfp_mcp-0.2.1/README.md +173 -0
  4. gfp_mcp-0.2.1/gfp_mcp.egg-info/PKG-INFO +210 -0
  5. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/gfp_mcp.egg-info/SOURCES.txt +2 -0
  6. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/__init__.py +4 -1
  7. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/client.py +4 -0
  8. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/config.py +2 -0
  9. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/mappings.py +100 -0
  10. gfp_mcp-0.2.1/mcp_standalone/resources.py +141 -0
  11. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/server.py +73 -7
  12. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/tools.py +165 -3
  13. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/pyproject.toml +1 -1
  14. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/tests/test_mcp_integration.py +98 -1
  15. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/tests/test_mcp_mappings.py +104 -0
  16. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/tests/test_mcp_tools.py +79 -1
  17. gfp_mcp-0.1.0/PKG-INFO +0 -360
  18. gfp_mcp-0.1.0/README.md +0 -325
  19. gfp_mcp-0.1.0/gfp_mcp.egg-info/PKG-INFO +0 -360
  20. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/gfp_mcp.egg-info/dependency_links.txt +0 -0
  21. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/gfp_mcp.egg-info/entry_points.txt +0 -0
  22. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/gfp_mcp.egg-info/requires.txt +0 -0
  23. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/gfp_mcp.egg-info/top_level.txt +0 -0
  24. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/mcp_standalone/registry.py +0 -0
  25. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/setup.cfg +0 -0
  26. {gfp_mcp-0.1.0 → gfp_mcp-0.2.1}/tests/test_registry.py +0 -0
gfp_mcp-0.2.1/LICENSE ADDED
@@ -0,0 +1,4 @@
1
+ PROPRIETARY AND CONFIDENTIAL
2
+ THIS SOFTWARE IS THE SOLE PROPERTY AND COPYRIGHT (c) 2025 OF DOPLAYDO INC.
3
+ USE OR REPRODUCTION IN PART OR AS A WHOLE WITHOUT THE WRITTEN AGREEMENT OF DOPLAYDO IS PROHIBITED.
4
+ NOTICE VERSION: 0.0.2
gfp_mcp-0.2.1/PKG-INFO ADDED
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: gfp-mcp
3
+ Version: 0.2.1
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
+ Dynamic: license-file
37
+
38
+ # GDSFactory+ MCP Server
39
+
40
+ [![PyPI version](https://img.shields.io/pypi/v/gfp-mcp.svg)](https://pypi.org/project/gfp-mcp/)
41
+ [![Python versions](https://img.shields.io/pypi/pyversions/gfp-mcp.svg)](https://pypi.org/project/gfp-mcp/)
42
+ [![Tests](https://github.com/doplaydo/gfp-mcp/workflows/Tests/badge.svg)](https://github.com/doplaydo/gfp-mcp/actions)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ Model Context Protocol (MCP) server for GDSFactory+ that enables AI assistants like Claude to design and build photonic integrated circuits.
46
+
47
+ ## What is this?
48
+
49
+ 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.
50
+
51
+ ## Quick Start
52
+
53
+ ### 1. Install Prerequisites
54
+
55
+ - Python 3.10 or higher
56
+ - VSCode with the [GDSFactory+ extension](https://marketplace.visualstudio.com/items?itemName=gdsfactory.gdsfactoryplus) installed
57
+
58
+ ### 2. Install the MCP Server
59
+
60
+ ```bash
61
+ pip install gfp-mcp
62
+ ```
63
+
64
+ Or with uv:
65
+
66
+ ```bash
67
+ uvx --from gfp-mcp gfp-mcp-serve
68
+ ```
69
+
70
+ ### 3. Connect to Your AI Assistant
71
+
72
+ <details>
73
+ <summary><strong>Claude Code</strong></summary>
74
+
75
+ Add to `.claude/settings.json`:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "gdsfactoryplus": {
81
+ "command": "gfp-mcp-serve",
82
+ "args": [],
83
+ "env": {
84
+ "GFP_API_URL": "http://localhost:8787"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ Or use the CLI:
92
+
93
+ ```bash
94
+ claude mcp add gdsfactoryplus -- gfp-mcp-serve
95
+ ```
96
+
97
+ </details>
98
+
99
+ <details>
100
+ <summary><strong>Claude Desktop</strong></summary>
101
+
102
+ Add to your config file:
103
+
104
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
105
+
106
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
107
+
108
+ **Linux**: `~/.config/Claude/claude_desktop_config.json`
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "gdsfactoryplus": {
114
+ "command": "gfp-mcp-serve",
115
+ "args": []
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ Restart Claude Desktop after adding the configuration.
122
+
123
+ </details>
124
+
125
+ <details>
126
+ <summary><strong>Cursor</strong></summary>
127
+
128
+ Coming soon. Follow the MCP integration instructions for Cursor when available.
129
+
130
+ </details>
131
+
132
+ ### 4. Start Designing
133
+
134
+ The MCP server automatically discovers running GDSFactory+ servers via the registry (`~/.gdsfactory/server-registry.json`). On startup, it will log all discovered projects.
135
+
136
+ Try these commands with your AI assistant:
137
+
138
+ - "List all available photonic components"
139
+ - "Build an MZI interferometer"
140
+ - "Show me details about the directional coupler"
141
+ - "Build multiple components: mzi, coupler, and bend_euler"
142
+ - "List all my GDSFactory+ projects"
143
+
144
+ ## Available Tools
145
+
146
+ - **build_cell** - Build a single GDS cell by name
147
+ - **build_cells** - Build multiple GDS cells in batch
148
+ - **list_cells** - List all available photonic components
149
+ - **get_cell_info** - Get detailed component metadata
150
+ - **download_gds** - Download built GDS files
151
+ - **list_projects** - List all running GDSFactory+ server instances
152
+ - **get_project_info** - Get detailed information about a specific project
153
+ - **check_drc** - Run Design Rule Check verification
154
+ - **check_connectivity** - Run connectivity verification
155
+ - **check_lvs** - Run Layout vs. Schematic verification
156
+
157
+ ## Multi-Project Support
158
+
159
+ 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:
160
+
161
+ ```
162
+ User: "List all my GDSFactory+ projects"
163
+ Claude: [Uses list_projects tool to show all running servers]
164
+
165
+ User: "Build the mzi component in my_photonics_project"
166
+ Claude: [Routes request to the correct project]
167
+ ```
168
+
169
+ ## Troubleshooting
170
+
171
+ <details>
172
+ <summary><strong>Server not appearing in Claude</strong></summary>
173
+
174
+ 1. Verify installation: `gfp-mcp-serve --help`
175
+ 2. Check Claude Code logs: `claude --debug`
176
+ 3. Restart Claude Desktop/Code
177
+ 4. Ensure the GDSFactory+ VSCode extension is active and a project is open
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary><strong>Connection refused errors</strong></summary>
183
+
184
+ The MCP server uses the registry (`~/.gdsfactory/server-registry.json`) to discover running servers.
185
+
186
+ 1. Use the `list_projects` tool in Claude to check available servers
187
+ 2. If no servers are found, ensure the GDSFactory+ VSCode extension is running with an active project:
188
+ - Open VSCode with the GDSFactory+ extension installed
189
+ - Open a GDSFactory+ project folder
190
+ - The extension automatically starts the server and registers it
191
+ 3. Check the MCP startup logs for discovered servers
192
+ 4. Verify the registry is accessible at `~/.gdsfactory/server-registry.json`
193
+ 5. For backward compatibility, you can set a specific server URL:
194
+
195
+ ```bash
196
+ export GFP_API_URL="http://localhost:YOUR_PORT"
197
+ ```
198
+
199
+ </details>
200
+
201
+ <details>
202
+ <summary><strong>Tool execution timeout</strong></summary>
203
+
204
+ Increase the timeout for long-running operations:
205
+
206
+ ```bash
207
+ export GFP_MCP_TIMEOUT=600 # 10 minutes
208
+ ```
209
+
210
+ </details>
@@ -0,0 +1,173 @@
1
+ # GDSFactory+ MCP Server
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/gfp-mcp.svg)](https://pypi.org/project/gfp-mcp/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/gfp-mcp.svg)](https://pypi.org/project/gfp-mcp/)
5
+ [![Tests](https://github.com/doplaydo/gfp-mcp/workflows/Tests/badge.svg)](https://github.com/doplaydo/gfp-mcp/actions)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
+ ```bash
24
+ pip install gfp-mcp
25
+ ```
26
+
27
+ Or with uv:
28
+
29
+ ```bash
30
+ uvx --from gfp-mcp gfp-mcp-serve
31
+ ```
32
+
33
+ ### 3. Connect to Your AI Assistant
34
+
35
+ <details>
36
+ <summary><strong>Claude Code</strong></summary>
37
+
38
+ Add to `.claude/settings.json`:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "gdsfactoryplus": {
44
+ "command": "gfp-mcp-serve",
45
+ "args": [],
46
+ "env": {
47
+ "GFP_API_URL": "http://localhost:8787"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ Or use the CLI:
55
+
56
+ ```bash
57
+ claude mcp add gdsfactoryplus -- gfp-mcp-serve
58
+ ```
59
+
60
+ </details>
61
+
62
+ <details>
63
+ <summary><strong>Claude Desktop</strong></summary>
64
+
65
+ Add to your config file:
66
+
67
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
68
+
69
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
70
+
71
+ **Linux**: `~/.config/Claude/claude_desktop_config.json`
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "gdsfactoryplus": {
77
+ "command": "gfp-mcp-serve",
78
+ "args": []
79
+ }
80
+ }
81
+ }
82
+ ```
83
+
84
+ Restart Claude Desktop after adding the configuration.
85
+
86
+ </details>
87
+
88
+ <details>
89
+ <summary><strong>Cursor</strong></summary>
90
+
91
+ Coming soon. Follow the MCP integration instructions for Cursor when available.
92
+
93
+ </details>
94
+
95
+ ### 4. Start Designing
96
+
97
+ The MCP server automatically discovers running GDSFactory+ servers via the registry (`~/.gdsfactory/server-registry.json`). On startup, it will log all discovered projects.
98
+
99
+ Try these commands with your AI assistant:
100
+
101
+ - "List all available photonic components"
102
+ - "Build an MZI interferometer"
103
+ - "Show me details about the directional coupler"
104
+ - "Build multiple components: mzi, coupler, and bend_euler"
105
+ - "List all my GDSFactory+ projects"
106
+
107
+ ## Available Tools
108
+
109
+ - **build_cell** - Build a single GDS cell by name
110
+ - **build_cells** - Build multiple GDS cells in batch
111
+ - **list_cells** - List all available photonic components
112
+ - **get_cell_info** - Get detailed component metadata
113
+ - **download_gds** - Download built GDS files
114
+ - **list_projects** - List all running GDSFactory+ server instances
115
+ - **get_project_info** - Get detailed information about a specific project
116
+ - **check_drc** - Run Design Rule Check verification
117
+ - **check_connectivity** - Run connectivity verification
118
+ - **check_lvs** - Run Layout vs. Schematic verification
119
+
120
+ ## Multi-Project Support
121
+
122
+ 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:
123
+
124
+ ```
125
+ User: "List all my GDSFactory+ projects"
126
+ Claude: [Uses list_projects tool to show all running servers]
127
+
128
+ User: "Build the mzi component in my_photonics_project"
129
+ Claude: [Routes request to the correct project]
130
+ ```
131
+
132
+ ## Troubleshooting
133
+
134
+ <details>
135
+ <summary><strong>Server not appearing in Claude</strong></summary>
136
+
137
+ 1. Verify installation: `gfp-mcp-serve --help`
138
+ 2. Check Claude Code logs: `claude --debug`
139
+ 3. Restart Claude Desktop/Code
140
+ 4. Ensure the GDSFactory+ VSCode extension is active and a project is open
141
+
142
+ </details>
143
+
144
+ <details>
145
+ <summary><strong>Connection refused errors</strong></summary>
146
+
147
+ The MCP server uses the registry (`~/.gdsfactory/server-registry.json`) to discover running servers.
148
+
149
+ 1. Use the `list_projects` tool in Claude to check available servers
150
+ 2. If no servers are found, ensure the GDSFactory+ VSCode extension is running with an active project:
151
+ - Open VSCode with the GDSFactory+ extension installed
152
+ - Open a GDSFactory+ project folder
153
+ - The extension automatically starts the server and registers it
154
+ 3. Check the MCP startup logs for discovered servers
155
+ 4. Verify the registry is accessible at `~/.gdsfactory/server-registry.json`
156
+ 5. For backward compatibility, you can set a specific server URL:
157
+
158
+ ```bash
159
+ export GFP_API_URL="http://localhost:YOUR_PORT"
160
+ ```
161
+
162
+ </details>
163
+
164
+ <details>
165
+ <summary><strong>Tool execution timeout</strong></summary>
166
+
167
+ Increase the timeout for long-running operations:
168
+
169
+ ```bash
170
+ export GFP_MCP_TIMEOUT=600 # 10 minutes
171
+ ```
172
+
173
+ </details>
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: gfp-mcp
3
+ Version: 0.2.1
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
+ Dynamic: license-file
37
+
38
+ # GDSFactory+ MCP Server
39
+
40
+ [![PyPI version](https://img.shields.io/pypi/v/gfp-mcp.svg)](https://pypi.org/project/gfp-mcp/)
41
+ [![Python versions](https://img.shields.io/pypi/pyversions/gfp-mcp.svg)](https://pypi.org/project/gfp-mcp/)
42
+ [![Tests](https://github.com/doplaydo/gfp-mcp/workflows/Tests/badge.svg)](https://github.com/doplaydo/gfp-mcp/actions)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ Model Context Protocol (MCP) server for GDSFactory+ that enables AI assistants like Claude to design and build photonic integrated circuits.
46
+
47
+ ## What is this?
48
+
49
+ 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.
50
+
51
+ ## Quick Start
52
+
53
+ ### 1. Install Prerequisites
54
+
55
+ - Python 3.10 or higher
56
+ - VSCode with the [GDSFactory+ extension](https://marketplace.visualstudio.com/items?itemName=gdsfactory.gdsfactoryplus) installed
57
+
58
+ ### 2. Install the MCP Server
59
+
60
+ ```bash
61
+ pip install gfp-mcp
62
+ ```
63
+
64
+ Or with uv:
65
+
66
+ ```bash
67
+ uvx --from gfp-mcp gfp-mcp-serve
68
+ ```
69
+
70
+ ### 3. Connect to Your AI Assistant
71
+
72
+ <details>
73
+ <summary><strong>Claude Code</strong></summary>
74
+
75
+ Add to `.claude/settings.json`:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "gdsfactoryplus": {
81
+ "command": "gfp-mcp-serve",
82
+ "args": [],
83
+ "env": {
84
+ "GFP_API_URL": "http://localhost:8787"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ Or use the CLI:
92
+
93
+ ```bash
94
+ claude mcp add gdsfactoryplus -- gfp-mcp-serve
95
+ ```
96
+
97
+ </details>
98
+
99
+ <details>
100
+ <summary><strong>Claude Desktop</strong></summary>
101
+
102
+ Add to your config file:
103
+
104
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
105
+
106
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
107
+
108
+ **Linux**: `~/.config/Claude/claude_desktop_config.json`
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "gdsfactoryplus": {
114
+ "command": "gfp-mcp-serve",
115
+ "args": []
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ Restart Claude Desktop after adding the configuration.
122
+
123
+ </details>
124
+
125
+ <details>
126
+ <summary><strong>Cursor</strong></summary>
127
+
128
+ Coming soon. Follow the MCP integration instructions for Cursor when available.
129
+
130
+ </details>
131
+
132
+ ### 4. Start Designing
133
+
134
+ The MCP server automatically discovers running GDSFactory+ servers via the registry (`~/.gdsfactory/server-registry.json`). On startup, it will log all discovered projects.
135
+
136
+ Try these commands with your AI assistant:
137
+
138
+ - "List all available photonic components"
139
+ - "Build an MZI interferometer"
140
+ - "Show me details about the directional coupler"
141
+ - "Build multiple components: mzi, coupler, and bend_euler"
142
+ - "List all my GDSFactory+ projects"
143
+
144
+ ## Available Tools
145
+
146
+ - **build_cell** - Build a single GDS cell by name
147
+ - **build_cells** - Build multiple GDS cells in batch
148
+ - **list_cells** - List all available photonic components
149
+ - **get_cell_info** - Get detailed component metadata
150
+ - **download_gds** - Download built GDS files
151
+ - **list_projects** - List all running GDSFactory+ server instances
152
+ - **get_project_info** - Get detailed information about a specific project
153
+ - **check_drc** - Run Design Rule Check verification
154
+ - **check_connectivity** - Run connectivity verification
155
+ - **check_lvs** - Run Layout vs. Schematic verification
156
+
157
+ ## Multi-Project Support
158
+
159
+ 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:
160
+
161
+ ```
162
+ User: "List all my GDSFactory+ projects"
163
+ Claude: [Uses list_projects tool to show all running servers]
164
+
165
+ User: "Build the mzi component in my_photonics_project"
166
+ Claude: [Routes request to the correct project]
167
+ ```
168
+
169
+ ## Troubleshooting
170
+
171
+ <details>
172
+ <summary><strong>Server not appearing in Claude</strong></summary>
173
+
174
+ 1. Verify installation: `gfp-mcp-serve --help`
175
+ 2. Check Claude Code logs: `claude --debug`
176
+ 3. Restart Claude Desktop/Code
177
+ 4. Ensure the GDSFactory+ VSCode extension is active and a project is open
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary><strong>Connection refused errors</strong></summary>
183
+
184
+ The MCP server uses the registry (`~/.gdsfactory/server-registry.json`) to discover running servers.
185
+
186
+ 1. Use the `list_projects` tool in Claude to check available servers
187
+ 2. If no servers are found, ensure the GDSFactory+ VSCode extension is running with an active project:
188
+ - Open VSCode with the GDSFactory+ extension installed
189
+ - Open a GDSFactory+ project folder
190
+ - The extension automatically starts the server and registers it
191
+ 3. Check the MCP startup logs for discovered servers
192
+ 4. Verify the registry is accessible at `~/.gdsfactory/server-registry.json`
193
+ 5. For backward compatibility, you can set a specific server URL:
194
+
195
+ ```bash
196
+ export GFP_API_URL="http://localhost:YOUR_PORT"
197
+ ```
198
+
199
+ </details>
200
+
201
+ <details>
202
+ <summary><strong>Tool execution timeout</strong></summary>
203
+
204
+ Increase the timeout for long-running operations:
205
+
206
+ ```bash
207
+ export GFP_MCP_TIMEOUT=600 # 10 minutes
208
+ ```
209
+
210
+ </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.1.0"
42
+ __version__ = "0.2.1"
@@ -218,6 +218,10 @@ class FastAPIClient:
218
218
  async def health_check(self, project: str | None = None) -> bool:
219
219
  """Check if the FastAPI server is reachable.
220
220
 
221
+ .. deprecated::
222
+ This method is deprecated and no longer called during MCP startup.
223
+ Use list_projects() for server discovery instead.
224
+
221
225
  Args:
222
226
  project: Optional project name to check specific server
223
227
 
@@ -16,6 +16,8 @@ class MCPConfig:
16
16
  """
17
17
 
18
18
  # FastAPI base URL (default: http://localhost:8787)
19
+ # This default is primarily for backward compatibility.
20
+ # The MCP server automatically discovers running servers via the registry.
19
21
  API_URL: Final[str] = os.getenv("GFP_API_URL", "http://localhost:8787")
20
22
 
21
23
  # Timeout for tool calls in seconds (default: 300 = 5 minutes)