You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# from mcp_app.tools.hello_world import hello_world
67
+
# from mcp_app.tools.whoami import whoami
68
+
69
+
# Add your tools
70
+
from my_app.tools.my_tools import my_business_logic_tool
71
+
72
+
defregister_tools(mcp: FastMCP) -> None:
73
+
"""Register MCP tools with the server."""
74
+
75
+
# Remove demo tools
76
+
# mcp.tool()(hello_world)
77
+
# mcp.tool()(whoami)
78
+
79
+
# Register your tools
80
+
mcp.tool()(my_business_logic_tool)
81
+
```
82
+
92
83
### 3. Update Tests
93
84
94
85
Modify `tests/test_tools.py` to test your new tools instead of the demo ones.
@@ -97,6 +88,33 @@ Modify `tests/test_tools.py` to test your new tools instead of the demo ones.
97
88
98
89
Update README.md and DEVELOPMENT.md to document your tools instead of the demo ones.
99
90
91
+
## JWT Validation Configuration
92
+
93
+
The project includes JWT validation middleware for securing tools. By default, it's configured for local validation using a JWKS endpoint.
94
+
95
+
### Using Keycloak
96
+
97
+
To enable JWT validation with Keycloak:
98
+
99
+
1.**Run Keycloak locally** (e.g., via Docker: `docker run -p 8080:8080 quay.io/keycloak/keycloak:latest start-dev`).
100
+
2.**Create a realm and client** in Keycloak admin console.
101
+
3.**Update `config.toml`**:
102
+
- Set `jwks_uri = "http://localhost:8080/realms/your-realm/protocol/openid-connect/certs"`
103
+
- Adjust `allow_conditions` to match your email domain, e.g., `payload.email.endswith("@yourdomain.com")`
104
+
4.**Enable OAuth endpoints** if needed by setting `oauth_authorization_server.enabled = true` and `oauth_protected_resource.enabled = true`, updating issuer_uri and auth_servers accordingly.
105
+
106
+
### Using Auth0
107
+
108
+
To use Auth0 as your identity provider:
109
+
110
+
1.**Get your Auth0 tenant details** (tenant name, client ID, etc.).
111
+
2.**Update `config.toml`**:
112
+
- Set `jwks_uri = "https://your-tenant.auth0.com/.well-known/jwks.json"`
113
+
- Set `allow_conditions` to validate claims, e.g., `payload.iss == "https://your-tenant.auth0.com/" and payload.aud == "your-client-id"`
114
+
3.**Ensure Auth0 is configured** to issue JWTs with the required claims.
115
+
116
+
For external validation (e.g., via a proxy), set `strategy = "external"` and configure your proxy to forward validated JWTs in the `X-Validated-Jwt` header.
117
+
100
118
## Configuration Placeholders
101
119
102
120
Before using this template, you must replace all placeholders with your actual values:
Copy file name to clipboardExpand all lines: README-es.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,3 @@ Este proyecto está licenciado bajo Unlicense - consulta el archivo [LICENSE](LI
183
183
## Créditos
184
184
185
185
Traducción completa a Python del proyecto [MCP Forge](https://github.com/achetronic/mcp-forge) (Go), manteniendo todas las funcionalidades y nivel de seguridad del original.
Copy file name to clipboardExpand all lines: README.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,7 +185,3 @@ This project is licensed under the Unlicense - see the [LICENSE](LICENSE) file f
185
185
## Credits
186
186
187
187
Complete translation to Python of the [MCP Forge](https://github.com/achetronic/mcp-forge) project (Go), maintaining all functionalities and security level of the original.
Copy file name to clipboardExpand all lines: docs/_config.yml
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,10 @@ plugins:
5
5
6
6
title: "MCP Forge Python - Production-Ready MCP Server with OAuth"
7
7
description: "A comprehensive MCP (Model Context Protocol) server template with OAuth support, JWT validation, and production-ready deployment options for Python developers."
0 commit comments