Skip to content

Commit 61d154f

Browse files
authored
Merge pull request #108 from LeslieLeung/feature/mcp-server
2 parents 1c044bd + 26ced48 commit 61d154f

15 files changed

Lines changed: 32 additions & 13 deletions

File tree

backend/apps/api/glean_api/mcp/server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def create_mcp_server() -> FastMCP:
5151
resource_server_url=AnyHttpUrl(settings.mcp_resource_server_url),
5252
)
5353

54+
# Use host="0.0.0.0" to disable automatic DNS rebinding protection
55+
# which only allows localhost by default. This is necessary for Docker
56+
# deployments where the service is accessed via proxy (nginx).
57+
# Security is handled at the nginx/reverse proxy layer.
5458
mcp = FastMCP(
5559
name="Glean MCP Server",
5660
instructions="""
@@ -63,6 +67,7 @@ def create_mcp_server() -> FastMCP:
6367
- list_entries_by_date: List articles within a date range
6468
- list_subscriptions: List your RSS feed subscriptions
6569
""".strip(),
70+
host="0.0.0.0",
6671
lifespan=mcp_lifespan,
6772
auth=auth_settings,
6873
token_verifier=APITokenVerifier(),

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "glean-backend"
3-
version = "0.2.4"
3+
version = "0.2.5"
44
description = "Glean Backend - Personal Knowledge Management Tool"
55
requires-python = ">=3.11"
66
readme = "README.md"

backend/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/apps/admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glean/admin",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"private": true,
55
"type": "module",
66
"scripts": {

frontend/apps/web/nginx.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ server {
2828
proxy_cache_bypass $http_upgrade;
2929
}
3030

31+
# MCP server proxy
32+
location /mcp {
33+
proxy_pass http://backend:8000;
34+
proxy_http_version 1.1;
35+
proxy_set_header Upgrade $http_upgrade;
36+
proxy_set_header Connection 'upgrade';
37+
proxy_set_header Host $host;
38+
proxy_set_header X-Forwarded-Host $host;
39+
proxy_set_header X-Real-IP $remote_addr;
40+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
41+
proxy_set_header X-Forwarded-Proto $scheme;
42+
proxy_cache_bypass $http_upgrade;
43+
}
44+
3145
# SPA fallback
3246
location / {
3347
try_files $uri $uri/ /index.html;

frontend/apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@glean/web",
33
"productName": "Glean",
4-
"version": "0.2.4",
4+
"version": "0.2.5",
55
"description": "Glean - Personal Knowledge Management and RSS Reader",
66
"author": {
77
"name": "Leslie Leung",

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "glean-frontend",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"type": "module",
55
"private": true,
66
"scripts": {

frontend/packages/api-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glean/api-client",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"private": true,
55
"type": "module",
66
"main": "./src/index.ts",

frontend/packages/i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glean/i18n",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"private": true,
55
"type": "module",
66
"main": "./src/index.ts",

frontend/packages/i18n/src/locales/en/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"title": "How to use with MCP",
162162
"description": "Add your API token to your MCP client configuration to enable AI assistants to search and retrieve articles from your subscriptions.",
163163
"configTitle": "Claude Desktop Configuration",
164-
"urlNote": "Note: Replace the URL with your actual backend API address (e.g., http://localhost:8000/mcp/mcp for local development, or https://your-domain.com/mcp/mcp for production).",
164+
"urlNote": "Tip: When using Docker deployment, the URL in the configuration above can be used directly (it's automatically filled with your current domain). Self-hosted users should ensure nginx is configured to proxy the /mcp path.",
165165
"tools": "Available tools:",
166166
"toolSearch": "Search articles by keyword",
167167
"toolGet": "Get full article details",

0 commit comments

Comments
 (0)