Skip to content

Commit 1409773

Browse files
committed
feat(mcp): generate plugins tool from protobuf contract
1 parent e8a42f0 commit 1409773

16 files changed

Lines changed: 361 additions & 175 deletions

‎README.md‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,32 @@ docker compose up -d
153153
docker compose logs -f service
154154
```
155155

156+
### Minimal Local Run
157+
158+
For local `easyp generate`, gRPC testing and MCP smoke you do not need the full observability stack.
159+
160+
```bash
161+
# 1. Start only postgres and local registry
162+
# If port 5432 is already occupied, the task uses 5433 by default.
163+
task up-minimal
164+
165+
# 2. Publish only the plugin images required by easyp.yaml
166+
task local-push-required
167+
168+
# 3. In a separate terminal run the service from source
169+
# config.local.yml is tuned for this mode.
170+
task run-local
171+
172+
# 4. Generate code
173+
easyp --cfg easyp.yaml mod download
174+
easyp --cfg easyp.yaml generate
175+
176+
# 5. Optional MCP smoke check
177+
go run ./cmd/mcp-smoke --endpoint http://localhost:8083/mcp
178+
```
179+
180+
If you want every plugin image in the local registry, use `task local-push-registry` instead of `task local-push-required`.
181+
156182
### Health Check
157183

158184
```bash
@@ -244,7 +270,7 @@ SERVER_HOST=0.0.0.0
244270
SERVER_PORT_GRPC=8080
245271
SERVER_PORT_METRIC=8081
246272
SERVER_PORT_HEALTH=8082
247-
SERVER_PORT_GATEWAY=8083
273+
SERVER_PORT_MCP=8083
248274

249275
# Database
250276
DB_POSTGRES_DSN="postgres://user:pass@localhost/db"
@@ -263,7 +289,7 @@ server:
263289
grpc: 8080
264290
metric: 8081
265291
health: 8082
266-
gateway: 8083
292+
mcp: 8083
267293
db:
268294
migrate_dir: "migrate"
269295
driver: "postgres"

‎Taskfile.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ tasks:
99
cmds:
1010
- "docker compose up --build --remove-orphans --detach"
1111

12+
up-minimal:
13+
dir: "{{.USER_WORKING_DIR}}"
14+
preconditions:
15+
- "test -f docker-compose.yml"
16+
cmds:
17+
- "sh -c 'EASYP_POSTGRES_PORT=${EASYP_POSTGRES_PORT:-5433} docker compose up -d postgres registry'"
18+
1219
down:
1320
dir: "{{.USER_WORKING_DIR}}"
1421
preconditions:
@@ -23,6 +30,17 @@ tasks:
2330
cmds:
2431
- "./push.sh localhost:5005 --push"
2532

33+
local-push-required:
34+
dir: "{{.USER_WORKING_DIR}}"
35+
preconditions:
36+
- "test -f registry/protocolbuffers/go/v1.36.10/Dockerfile"
37+
- "test -f registry/grpc/go/v1.5.1/Dockerfile"
38+
cmds:
39+
- "docker build --platform linux/amd64 -t localhost:5005/protocolbuffers/go:v1.36.10 registry/protocolbuffers/go/v1.36.10"
40+
- "docker push localhost:5005/protocolbuffers/go:v1.36.10"
41+
- "docker build --platform linux/amd64 -t localhost:5005/grpc/go:v1.5.1 registry/grpc/go/v1.5.1"
42+
- "docker push localhost:5005/grpc/go:v1.5.1"
43+
2644
run:
2745
dir: "{{.USER_WORKING_DIR}}"
2846
deps:
@@ -32,6 +50,13 @@ tasks:
3250
cmds:
3351
- "docker compose logs -f service"
3452

53+
run-local:
54+
dir: "{{.USER_WORKING_DIR}}"
55+
preconditions:
56+
- "test -f config.local.yml"
57+
cmds:
58+
- "go run ./cmd/main.go -cfg config.local.yml -log_level debug"
59+
3560
test-mcp:
3661
dir: "{{.USER_WORKING_DIR}}"
3762
cmds:

‎api/generator/v1/generator.mcp.go‎

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/generator/v1/generator.pb.go‎

Lines changed: 77 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)