Skip to content

Commit adf2e83

Browse files
authored
Merge pull request #1 from ankorstore/main
Sync from fork
2 parents c564333 + 65ec792 commit adf2e83

File tree

133 files changed

+9508
-422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+9508
-422
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- "sql"
3333
- "trace"
3434
- "worker"
35+
- "fxclock"
3536
- "fxcore"
3637
- "fxconfig"
3738
- "fxcron"
@@ -41,6 +42,7 @@ jobs:
4142
- "fxhttpclient"
4243
- "fxhttpserver"
4344
- "fxlog"
45+
- "fxmcpserver"
4446
- "fxmetrics"
4547
- "fxorm"
4648
- "fxsql"

.github/workflows/fxclock-ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "fxclock-ci"
2+
3+
on:
4+
push:
5+
branches:
6+
- "feat**"
7+
- "fix**"
8+
- "hotfix**"
9+
- "chore**"
10+
paths:
11+
- "fxclock/**.go"
12+
- "fxclock/go.mod"
13+
- "fxclock/go.sum"
14+
pull_request:
15+
types:
16+
- opened
17+
- synchronize
18+
- reopened
19+
branches:
20+
- main
21+
paths:
22+
- "fxclock/**.go"
23+
- "fxclock/go.mod"
24+
- "fxclock/go.sum"
25+
26+
jobs:
27+
ci:
28+
uses: ./.github/workflows/common-ci.yml
29+
secrets: inherit
30+
with:
31+
module: "fxclock"
32+
go_version: "1.21"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "fxmcpserver-ci"
2+
3+
on:
4+
push:
5+
branches:
6+
- "feat**"
7+
- "fix**"
8+
- "hotfix**"
9+
- "chore**"
10+
paths:
11+
- "fxmcpserver/**.go"
12+
- "fxmcpserver/go.mod"
13+
- "fxmcpserver/go.sum"
14+
pull_request:
15+
types:
16+
- opened
17+
- synchronize
18+
- reopened
19+
branches:
20+
- main
21+
paths:
22+
- "fxmcpserver/**.go"
23+
- "fxmcpserver/go.mod"
24+
- "fxmcpserver/go.sum"
25+
26+
jobs:
27+
ci:
28+
uses: ./.github/workflows/common-ci.yml
29+
secrets: inherit
30+
with:
31+
module: "fxmcpserver"
32+
go_version: "1.23"

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"config":"1.5.0","log":"1.2.0","generate":"1.3.0","trace":"1.3.0","healthcheck":"1.1.0","httpclient":"1.4.0","httpserver":"1.6.0","orm":"1.1.0","fxconfig":"1.3.0","fxgenerate":"1.3.0","fxlog":"1.1.0","fxtrace":"1.2.0","fxmetrics":"1.2.0","fxhealthcheck":"1.1.0","fxorm":"1.2.0","fxhttpclient":"1.4.0","fxhttpserver":"1.7.0","fxcore":"1.10.0","worker":"1.2.0","fxworker":"1.1.0","fxcron":"1.1.0","grpcserver":"1.2.0","fxgrpcserver":"1.3.0","sql":"1.1.0","fxsql":"1.3.0","fxvalidator":"1.0.0"}
1+
{"config":"1.5.0","log":"1.2.0","generate":"1.3.0","trace":"1.4.0","healthcheck":"1.1.0","httpclient":"1.5.0","httpserver":"1.6.0","orm":"1.1.0","fxconfig":"1.3.0","fxgenerate":"1.3.0","fxlog":"1.1.0","fxtrace":"1.2.0","fxmetrics":"1.2.0","fxhealthcheck":"1.1.1","fxorm":"1.2.0","fxhttpclient":"1.4.0","fxhttpserver":"1.7.1","fxcore":"1.12.0","worker":"1.2.0","fxworker":"1.1.1","fxcron":"1.1.1","grpcserver":"1.2.0","fxgrpcserver":"1.3.1","sql":"1.1.0","fxsql":"1.3.0","fxvalidator":"1.0.0","fxclock":"1.0.0","fxmcpserver":"1.6.0"}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Yokai provides ready to use `application templates` to start your projects:
7878

7979
- for [gRPC applications](https://ankorstore.github.io/yokai/getting-started/grpc-application)
8080
- for [HTTP applications](https://ankorstore.github.io/yokai/getting-started/http-application)
81+
- for [MCP applications](https://ankorstore.github.io/yokai/getting-started/mcp-application)
8182
- for [worker applications](https://ankorstore.github.io/yokai/getting-started/worker-application)
8283

8384
## Showroom
@@ -86,6 +87,7 @@ Yokai provides a [showroom repository](https://github.com/ankorstore/yokai-showr
8687

8788
- [gRPC demo application](https://github.com/ankorstore/yokai-showroom/tree/main/grpc-demo)
8889
- [HTTP demo application](https://github.com/ankorstore/yokai-showroom/tree/main/http-demo)
90+
- [MCP demo application](https://github.com/ankorstore/yokai-showroom/tree/main/mcp-demo)
8991
- [worker demo application](https://github.com/ankorstore/yokai-showroom/tree/main/worker-demo)
9092

9193
## Contributing
68.6 KB
Loading
69.3 KB
Loading

docs/demos/grpc-application.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ This demo application is following the [recommended project layout](https://go.d
2222

2323
- `cmd/`: entry points
2424
- `configs/`: configuration files
25-
- `internal/`:
26-
- `interceptor/`: gRPC interceptors
27-
- `service/`: gRPC services
28-
- `bootstrap.go`: bootstrap
29-
- `register.go`: dependencies registration
25+
- `internal/`:
26+
- `api/`: gRPC API
27+
- `interceptor/`: gRPC interceptors
28+
- `service/`: gRPC services
29+
- `bootstrap.go`: bootstrap
30+
- `register.go`: dependencies registration
3031
- `proto/`: protobuf definition and stubs
3132

3233
### Makefile
@@ -76,7 +77,7 @@ This demo application also provides [reflection](../modules/fxgrpcserver.md#refl
7677

7778
### Authentication
7879

79-
This demo application provides example [authentication interceptors](https://github.com/ankorstore/yokai-showroom/tree/main/grpc-demo/internal/interceptor/authentication.go).
80+
This demo application provides example [authentication interceptors](https://github.com/ankorstore/yokai-showroom/tree/main/grpc-demo/internal/api/interceptor/authentication.go).
8081

8182
You can enable authentication in the application [configuration file](https://github.com/ankorstore/yokai-showroom/tree/main/grpc-demo/configs/config.yaml) with `config.authentication.enabled=true`.
8283

docs/demos/http-application.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ This demo application is following the [recommended project layout](https://go.d
2727
- `migrations/`: database migrations
2828
- `seeds/`: database seeds
2929
- `internal/`:
30-
- `handler/`: HTTP handlers
31-
- `middleware/`: HTTP middlewares
32-
- `model/`: models
33-
- `repository/`: models repositories
34-
- `service/`: services
30+
- `api/`: HTTP API
31+
- `handler/`: HTTP handlers
32+
- `middleware/`: HTTP middlewares
33+
- `domain/`: domain
34+
- `model.go`: gophers model
35+
- `repository.go`: gophers repository
36+
- `service.go`: gophers service
3537
- `bootstrap.go`: bootstrap
3638
- `register.go`: dependencies registration
3739
- `router.go`: routing registration
@@ -81,7 +83,7 @@ On [http://localhost:8080](http://localhost:8080), you can use:
8183

8284
### Authentication
8385

84-
This demo application provides an example [authentication middleware](https://github.com/ankorstore/yokai-showroom/blob/main/http-demo/internal/middleware/authentication.go).
86+
This demo application provides an example [authentication middleware](https://github.com/ankorstore/yokai-showroom/blob/main/http-demo/internal/api/middleware/authentication.go).
8587

8688
You can enable authentication in the application [configuration file](https://github.com/ankorstore/yokai-showroom/blob/main/http-demo/configs/config.yaml) with `config.authentication.enabled=true`.
8789

docs/demos/mcp-application.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Demos - MCP application
3+
icon: material/folder-eye-outline
4+
---
5+
6+
# :material-folder-eye-outline: Demo - MCP application
7+
8+
> Yokai's [showroom](https://github.com/ankorstore/yokai-showroom) provides an [MCP server demo application](https://github.com/ankorstore/yokai-showroom/tree/main/mcp-demo).
9+
10+
## Overview
11+
12+
This [MCP server demo application](https://github.com/ankorstore/yokai-showroom/tree/main/mcp-demo) is a simple [MCP server](https://modelcontextprotocol.io/introduction) to manage [gophers](https://go.dev/blog/gopher).
13+
14+
It provides:
15+
16+
- a [Yokai](https://github.com/ankorstore/yokai) application container, with the [MCP server](../modules/fxmcpserver.md) and [SQL](../modules/fxsql.md) modules to offer the gophers MCP server
17+
- a [MySQL](https://www.mysql.com/) container to store the gophers
18+
- a [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) container to interact with the MCP server
19+
- a [Jaeger](https://www.jaegertracing.io/) container to collect the application traces
20+
21+
### Layout
22+
23+
This demo application is following the [recommended project layout](https://go.dev/doc/modules/layout#server-project):
24+
25+
- `cmd/`: entry points
26+
- `configs/`: configuration files
27+
- `db/`:
28+
- `migrations/`: database migrations
29+
- `seeds/`: database seeds
30+
- `internal/`:
31+
- `domain/`: domain
32+
- `model.go`: gophers model
33+
- `repository.go`: gophers repository
34+
- `service.go`: gophers service
35+
- `mcp/`: MCP registrations
36+
- `prompt/`: MCP prompts
37+
- `resource/`: MCP resources
38+
- `tool/`: MCP tools
39+
- `bootstrap.go`: bootstrap
40+
- `register.go`: dependencies registration
41+
42+
### Makefile
43+
44+
This demo application provides a `Makefile`:
45+
46+
```
47+
make up # start the docker compose stack
48+
make down # stop the docker compose stack
49+
make logs # stream the docker compose stack logs
50+
make fresh # refresh the docker compose stack
51+
make migrate # run database migrations
52+
make test # run tests
53+
make lint # run linter
54+
```
55+
56+
## Usage
57+
58+
### Start the application
59+
60+
To start the application, simply run:
61+
62+
```shell
63+
make fresh
64+
```
65+
66+
After a short moment, the application will offer:
67+
68+
- [http://localhost:8080/mcp](http://localhost:8080/mcp): application MCP server (Streamable HTTP)
69+
- [http://localhost:8081](http://localhost:8081): application core dashboard
70+
- [http://localhost:6274](http://localhost:6274): MCP inspector
71+
- [http://localhost:16686](http://localhost:16686): jaeger UI
72+
73+
### Interact with the application
74+
75+
#### MCP inspector
76+
77+
You can use the provided [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector), available on [http://localhost:6274](http://localhost:6274).
78+
79+
To connect to the MCP server, use:
80+
81+
- `Streamable HTTP` as transport type
82+
- `http://mcp-demo-app:8080/mcp` as URL
83+
84+
Then simply click `Connect`: from there, you will be able to interact with the resources, prompts and tools of the application.
85+
86+
#### MCP hosts
87+
88+
If you use MCP compatible applications like [Cursor](https://www.cursor.com/), or [Claude desktop](https://claude.ai/download), you can register this application as MCP server:
89+
90+
```json
91+
{
92+
"mcpServers": {
93+
"mcp-demo-app": {
94+
"url": "http://localhost:8080/mcp"
95+
}
96+
}
97+
}
98+
```
99+
100+
Note, if you client does not support remote MCP servers, you can use a [local proxy](https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/#connect-your-remote-mcp-server-to-claude-desktop-via-a-local-proxy):
101+
102+
```json
103+
{
104+
"mcpServers": {
105+
"mcp-demo-app": {
106+
"command": "npx",
107+
"args": ["mcp-remote", "http://localhost:8080/mcp"]
108+
}
109+
}
110+
}
111+
```

0 commit comments

Comments
 (0)