gfp-mcp 0.1.0__py3-none-any.whl → 0.2.4__py3-none-any.whl
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.dist-info/METADATA +227 -0
- gfp_mcp-0.2.4.dist-info/RECORD +14 -0
- {gfp_mcp-0.1.0.dist-info → gfp_mcp-0.2.4.dist-info}/WHEEL +1 -1
- gfp_mcp-0.2.4.dist-info/licenses/LICENSE +4 -0
- mcp_standalone/__init__.py +4 -1
- mcp_standalone/client.py +61 -19
- mcp_standalone/config.py +3 -7
- mcp_standalone/mappings.py +341 -62
- mcp_standalone/registry.py +0 -4
- mcp_standalone/resources.py +138 -0
- mcp_standalone/server.py +78 -24
- mcp_standalone/tools.py +169 -71
- gfp_mcp-0.1.0.dist-info/METADATA +0 -360
- gfp_mcp-0.1.0.dist-info/RECORD +0 -12
- {gfp_mcp-0.1.0.dist-info → gfp_mcp-0.2.4.dist-info}/entry_points.txt +0 -0
- {gfp_mcp-0.1.0.dist-info → gfp_mcp-0.2.4.dist-info}/top_level.txt +0 -0
gfp_mcp-0.1.0.dist-info/METADATA
DELETED
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: gfp-mcp
|
|
3
|
-
Version: 0.1.0
|
|
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
|
-
Requires-Dist: mcp>=1.7.1
|
|
27
|
-
Requires-Dist: httpx>=0.25.0
|
|
28
|
-
Requires-Dist: typing-extensions>=4.0.0; python_version < "3.11"
|
|
29
|
-
Requires-Dist: psutil>=5.9.0
|
|
30
|
-
Provides-Extra: dev
|
|
31
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
32
|
-
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
33
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
34
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
35
|
-
|
|
36
|
-
# GDSFactory+ MCP Server
|
|
37
|
-
|
|
38
|
-
[](https://pypi.org/project/gfp-mcp/)
|
|
39
|
-
[](https://pypi.org/project/gfp-mcp/)
|
|
40
|
-
[](https://github.com/doplaydo/gfp-mcp/actions)
|
|
41
|
-
[](https://opensource.org/licenses/MIT)
|
|
42
|
-
|
|
43
|
-
Model Context Protocol (MCP) server for GDSFactory+ that exposes photonic IC design operations as tools for AI assistants like Claude Code and Claude Desktop.
|
|
44
|
-
|
|
45
|
-
## Overview
|
|
46
|
-
|
|
47
|
-
This project implements a standalone MCP server that bridges AI assistants with GDSFactory+ photonic IC design capabilities. The server acts as a lightweight proxy that exposes GDSFactory+ operations through standardized MCP tools while maintaining zero modifications to the existing FastAPI backend.
|
|
48
|
-
|
|
49
|
-
## Features
|
|
50
|
-
|
|
51
|
-
### Phase 1: Core Building Tools (Complete)
|
|
52
|
-
|
|
53
|
-
- **build_cell** - Build a single GDS cell by name
|
|
54
|
-
- **build_cells** - Build multiple GDS cells in batch
|
|
55
|
-
- **list_cells** - List all available photonic components
|
|
56
|
-
- **get_cell_info** - Get detailed component metadata
|
|
57
|
-
- **download_gds** - Download built GDS files
|
|
58
|
-
- **list_projects** - List all running GDSFactory+ server instances
|
|
59
|
-
- **get_project_info** - Get detailed information about a specific project
|
|
60
|
-
|
|
61
|
-
### Multi-Project Support
|
|
62
|
-
|
|
63
|
-
The MCP server integrates with the GDSFactory+ server registry to support working with multiple projects simultaneously. The registry is stored at `~/.gdsfactory/server-registry.json` and is automatically managed by GDSFactory+ servers.
|
|
64
|
-
|
|
65
|
-
#### How It Works
|
|
66
|
-
|
|
67
|
-
1. When you start a GDSFactory+ server with `gfp serve`, it registers itself in the shared registry
|
|
68
|
-
2. The MCP server reads from this registry to discover available projects
|
|
69
|
-
3. Tools accept an optional `project` parameter to route requests to specific servers
|
|
70
|
-
4. The MCP server automatically resolves project names to the correct port
|
|
71
|
-
|
|
72
|
-
#### Example Usage
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
User: "List all running GDSFactory+ projects"
|
|
76
|
-
Claude: [Uses list_projects tool to show all registered servers]
|
|
77
|
-
|
|
78
|
-
User: "Build the mzi component in the my_photonics_project"
|
|
79
|
-
Claude: [Uses build_cell tool with project="my_photonics_project"]
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Note**: The MCP has read-only access to the registry. Only GDSFactory+ servers can register/unregister themselves.
|
|
83
|
-
|
|
84
|
-
### Architecture
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
AI Assistant (Claude) <-> MCP Server (STDIO) <-> HTTP Client <-> FastAPI Server
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Key Benefits:**
|
|
91
|
-
- Universal MCP client compatibility via STDIO transport
|
|
92
|
-
- Zero modifications to existing FastAPI server
|
|
93
|
-
- Clean separation of concerns
|
|
94
|
-
- No database conflicts (only FastAPI touches SQLite)
|
|
95
|
-
- Scalable architecture ready for 20+ tools
|
|
96
|
-
|
|
97
|
-
## Installation
|
|
98
|
-
|
|
99
|
-
### From PyPI (Recommended)
|
|
100
|
-
|
|
101
|
-
Install the package from PyPI:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
pip install gfp-mcp
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Or with uv:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
uv pip install gfp-mcp
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### From Source (Development)
|
|
114
|
-
|
|
115
|
-
For development or if you want the latest unreleased changes:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
git clone https://github.com/doplaydo/gfp-mcp.git
|
|
119
|
-
cd gfp-mcp
|
|
120
|
-
pip install -e ".[dev]"
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Prerequisites
|
|
124
|
-
|
|
125
|
-
- Python 3.10 or higher
|
|
126
|
-
- GDSFactory+ with FastAPI server running
|
|
127
|
-
|
|
128
|
-
### Verify Installation
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
gfp-mcp-serve --help
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Quick Start
|
|
135
|
-
|
|
136
|
-
### 1. Start the FastAPI Server
|
|
137
|
-
|
|
138
|
-
In one terminal:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
gfp serve --port 8787
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### 2. Configure Your AI Assistant
|
|
145
|
-
|
|
146
|
-
#### Claude Code
|
|
147
|
-
|
|
148
|
-
Add to `.claude/settings.json`:
|
|
149
|
-
|
|
150
|
-
```json
|
|
151
|
-
{
|
|
152
|
-
"mcpServers": {
|
|
153
|
-
"gdsfactoryplus": {
|
|
154
|
-
"command": "gfp-mcp-serve",
|
|
155
|
-
"args": [],
|
|
156
|
-
"env": {
|
|
157
|
-
"GFP_API_URL": "http://localhost:8787"
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Or use the command line:
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
claude mcp add gdsfactoryplus -- gfp-mcp-serve
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
#### Claude Desktop
|
|
171
|
-
|
|
172
|
-
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
173
|
-
|
|
174
|
-
```json
|
|
175
|
-
{
|
|
176
|
-
"mcpServers": {
|
|
177
|
-
"gdsfactoryplus": {
|
|
178
|
-
"command": "gfp-mcp-serve",
|
|
179
|
-
"args": []
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
For Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
186
|
-
|
|
187
|
-
For Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
188
|
-
|
|
189
|
-
### 3. Use the Tools
|
|
190
|
-
|
|
191
|
-
Ask your AI assistant to:
|
|
192
|
-
|
|
193
|
-
- "List all available photonic components"
|
|
194
|
-
- "Build the mzi component"
|
|
195
|
-
- "Show me details about the coupler component"
|
|
196
|
-
- "Build multiple components: mzi, coupler, and bend_euler"
|
|
197
|
-
|
|
198
|
-
## Environment Variables
|
|
199
|
-
|
|
200
|
-
Configure the MCP server using environment variables:
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
# FastAPI server URL (default: http://localhost:8787)
|
|
204
|
-
export GFP_API_URL="http://localhost:8787"
|
|
205
|
-
|
|
206
|
-
# Request timeout in seconds (default: 300)
|
|
207
|
-
export GFP_MCP_TIMEOUT=300
|
|
208
|
-
|
|
209
|
-
# Enable debug logging (default: false)
|
|
210
|
-
export GFP_MCP_DEBUG=true
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## Project Structure
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
gfp-mcp/
|
|
217
|
-
├── mcp_standalone/ # MCP server implementation
|
|
218
|
-
│ ├── __init__.py # Package exports
|
|
219
|
-
│ ├── config.py # Configuration management
|
|
220
|
-
│ ├── client.py # HTTP client for FastAPI
|
|
221
|
-
│ ├── registry.py # Server registry (multi-project support)
|
|
222
|
-
│ ├── tools.py # MCP tool definitions
|
|
223
|
-
│ ├── mappings.py # Tool → Endpoint mappings
|
|
224
|
-
│ ├── server.py # MCP server core
|
|
225
|
-
│ └── README.md # Detailed documentation
|
|
226
|
-
├── tests/ # Test suite
|
|
227
|
-
│ ├── test_mcp_tools.py
|
|
228
|
-
│ ├── test_mcp_mappings.py
|
|
229
|
-
│ ├── test_mcp_integration.py
|
|
230
|
-
│ └── test_registry.py
|
|
231
|
-
├── mcp_serve.py # CLI entry point
|
|
232
|
-
├── MCP_QUICKSTART.md # Quick start guide
|
|
233
|
-
├── MCP_IMPLEMENTATION_STATUS.md # Implementation details
|
|
234
|
-
└── README.md # This file
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
## Testing
|
|
238
|
-
|
|
239
|
-
Run the test suite:
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
# Run all MCP tests
|
|
243
|
-
pytest tests/test_mcp_*.py -v
|
|
244
|
-
|
|
245
|
-
# Run with coverage
|
|
246
|
-
pytest tests/test_mcp_*.py --cov=mcp_standalone --cov-report=term-missing
|
|
247
|
-
|
|
248
|
-
# Run specific test file
|
|
249
|
-
pytest tests/test_mcp_tools.py -v
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
All tests are passing (46/46 tests):
|
|
253
|
-
- Tool definitions: 15 tests
|
|
254
|
-
- Endpoint mappings: 13 tests
|
|
255
|
-
- Integration & client: 9 tests
|
|
256
|
-
- Registry integration: 9 tests
|
|
257
|
-
|
|
258
|
-
## Example Workflows
|
|
259
|
-
|
|
260
|
-
### Build and Verify a Component
|
|
261
|
-
|
|
262
|
-
```
|
|
263
|
-
User: "List all available photonic components"
|
|
264
|
-
Claude: [Uses list_cells tool]
|
|
265
|
-
|
|
266
|
-
User: "Build the mzi component"
|
|
267
|
-
Claude: [Uses build_cell tool with name="mzi"]
|
|
268
|
-
|
|
269
|
-
User: "Show me the details of the mzi component"
|
|
270
|
-
Claude: [Uses get_cell_info tool with name="mzi"]
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
### Batch Build Multiple Components
|
|
274
|
-
|
|
275
|
-
```
|
|
276
|
-
User: "Build the following components: mzi, coupler, and bend_euler"
|
|
277
|
-
Claude: [Uses build_cells tool with names=["mzi", "coupler", "bend_euler"]]
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
## Troubleshooting
|
|
281
|
-
|
|
282
|
-
### Error: "Connection refused to localhost:8787"
|
|
283
|
-
|
|
284
|
-
**Cause**: FastAPI server is not running
|
|
285
|
-
|
|
286
|
-
**Solution**: Start the FastAPI server:
|
|
287
|
-
|
|
288
|
-
```bash
|
|
289
|
-
gfp serve --port 8787
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### Error: "MCP server not responding"
|
|
293
|
-
|
|
294
|
-
**Cause**: STDIO transport issue or MCP client misconfiguration
|
|
295
|
-
|
|
296
|
-
**Solution**:
|
|
297
|
-
1. Check Claude Code/Desktop logs with `claude --debug`
|
|
298
|
-
2. Restart the MCP server
|
|
299
|
-
3. Verify the configuration in settings.json
|
|
300
|
-
|
|
301
|
-
### Error: "Tool execution timeout"
|
|
302
|
-
|
|
303
|
-
**Cause**: Long-running operation exceeded timeout
|
|
304
|
-
|
|
305
|
-
**Solution**: Increase the timeout:
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
export GFP_MCP_TIMEOUT=600 # 10 minutes
|
|
309
|
-
gfp mcp-serve
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
## Roadmap
|
|
313
|
-
|
|
314
|
-
### Future Phases
|
|
315
|
-
|
|
316
|
-
- **Phase 2**: Verification tools (DRC, LVS)
|
|
317
|
-
- **Phase 3**: SPICE workflow tools
|
|
318
|
-
- **Phase 4**: Simulation & advanced tools
|
|
319
|
-
- **Phase 5**: Comprehensive testing & documentation
|
|
320
|
-
|
|
321
|
-
## Documentation
|
|
322
|
-
|
|
323
|
-
- [Quick Start Guide](MCP_QUICKSTART.md) - Step-by-step setup instructions
|
|
324
|
-
- [Implementation Status](MCP_IMPLEMENTATION_STATUS.md) - Detailed implementation notes
|
|
325
|
-
- [MCP Standalone README](mcp_standalone/README.md) - Architecture details
|
|
326
|
-
- [Contributing Guide](CONTRIBUTING.md) - Development and release guidelines
|
|
327
|
-
- [Changelog](CHANGELOG.md) - Version history and release notes
|
|
328
|
-
|
|
329
|
-
## Contributing
|
|
330
|
-
|
|
331
|
-
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines on:
|
|
332
|
-
|
|
333
|
-
- Development setup
|
|
334
|
-
- Running tests and code quality checks
|
|
335
|
-
- Making changes and submitting PRs
|
|
336
|
-
- Release process (for maintainers)
|
|
337
|
-
|
|
338
|
-
Quick checklist:
|
|
339
|
-
|
|
340
|
-
1. All tests pass: `pytest tests/test_mcp_*.py -v`
|
|
341
|
-
2. Code quality: `ruff check . && ruff format --check .`
|
|
342
|
-
3. Documentation is updated
|
|
343
|
-
4. Changes are backward compatible
|
|
344
|
-
|
|
345
|
-
## License
|
|
346
|
-
|
|
347
|
-
See the main GDSFactory+ project for license information.
|
|
348
|
-
|
|
349
|
-
## Support
|
|
350
|
-
|
|
351
|
-
For issues or questions:
|
|
352
|
-
|
|
353
|
-
1. Check the [Quick Start Guide](MCP_QUICKSTART.md) troubleshooting section
|
|
354
|
-
2. Review the [Implementation Status](MCP_IMPLEMENTATION_STATUS.md) document
|
|
355
|
-
3. Enable debug mode with `GFP_MCP_DEBUG=true` and check server logs
|
|
356
|
-
4. Open an issue on GitHub
|
|
357
|
-
|
|
358
|
-
## Acknowledgments
|
|
359
|
-
|
|
360
|
-
Built on the Model Context Protocol by Anthropic, enabling seamless AI assistant integration with photonic IC design workflows.
|
gfp_mcp-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
mcp_standalone/__init__.py,sha256=7PhYozHyiRK_oFui0RkF5GJWxA2OZoWVcU_-ESfHIR4,953
|
|
2
|
-
mcp_standalone/client.py,sha256=gUs9m2M27OP-GYmJ9fkojyxv212ETVJFqp0v2uN8Q2c,8205
|
|
3
|
-
mcp_standalone/config.py,sha256=zr2LnI_wNEcMWrnB_WLscR-skkXjE33ZPBtK08XjaX0,1386
|
|
4
|
-
mcp_standalone/mappings.py,sha256=jXEHwSrSYNDuVeMRM2dsSUsr38CzrHBLoe6exkJhqvc,7695
|
|
5
|
-
mcp_standalone/registry.py,sha256=1E61UalVot8HUS3cALjM7ejYB0qR6tI5QbQSZZeQe7Y,6401
|
|
6
|
-
mcp_standalone/server.py,sha256=Celd9j0KY1Fl_Qw09b9Px03vGhtaTUac2ozlYdGJ23A,7100
|
|
7
|
-
mcp_standalone/tools.py,sha256=__j9N396-cJj9CKi6EAdP5_J-xESrbRZG35KNzdszXM,12349
|
|
8
|
-
gfp_mcp-0.1.0.dist-info/METADATA,sha256=dVk1r3JfmlEY3RcqVSDqMLYm2fPAqwYjM4cTUD6sVQE,10442
|
|
9
|
-
gfp_mcp-0.1.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
10
|
-
gfp_mcp-0.1.0.dist-info/entry_points.txt,sha256=mgyus9dsB_8mjgnztuHNPqzPi-7HcPg1iYzfM5NMIjk,61
|
|
11
|
-
gfp_mcp-0.1.0.dist-info/top_level.txt,sha256=g2hRJHoDDPNtrNdXR70T7FR9Ev6DTRJiGW7ZvlvnXMc,15
|
|
12
|
-
gfp_mcp-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|