Fix MCP endpoint for Claude.ai connector (serve at root path)
FastMCP defaults to /mcp but Claude.ai sends requests to /. Add MCP_PATH env var to configure the endpoint path, set to / in docker-compose for the connector subdomain.
This commit is contained in:
parent
baab9abab2
commit
77ad2a6bd1
4
Makefile
4
Makefile
@ -5,7 +5,7 @@ dev:
|
|||||||
@echo "Starting mcnoaa-tides in development mode..."
|
@echo "Starting mcnoaa-tides in development mode..."
|
||||||
APP_ENV=dev docker compose up -d --build
|
APP_ENV=dev docker compose up -d --build
|
||||||
@echo "Docs: https://$(shell grep DOMAIN .env | head -1 | cut -d= -f2)"
|
@echo "Docs: https://$(shell grep DOMAIN .env | head -1 | cut -d= -f2)"
|
||||||
@echo "MCP: https://mcp.$(shell grep DOMAIN .env | head -1 | cut -d= -f2)/mcp"
|
@echo "MCP: https://mcp.$(shell grep DOMAIN .env | head -1 | cut -d= -f2)/"
|
||||||
@sleep 2
|
@sleep 2
|
||||||
docker compose logs -f
|
docker compose logs -f
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ prod:
|
|||||||
@echo "Starting mcnoaa-tides in production mode..."
|
@echo "Starting mcnoaa-tides in production mode..."
|
||||||
APP_ENV=prod docker compose up -d --build
|
APP_ENV=prod docker compose up -d --build
|
||||||
@echo "Docs: https://$(shell grep DOMAIN .env | head -1 | cut -d= -f2)"
|
@echo "Docs: https://$(shell grep DOMAIN .env | head -1 | cut -d= -f2)"
|
||||||
@echo "MCP: https://mcp.$(shell grep DOMAIN .env | head -1 | cut -d= -f2)/mcp"
|
@echo "MCP: https://mcp.$(shell grep DOMAIN .env | head -1 | cut -d= -f2)/"
|
||||||
@sleep 3
|
@sleep 3
|
||||||
docker compose logs --tail=20
|
docker compose logs --tail=20
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ services:
|
|||||||
- MCP_TRANSPORT=streamable-http
|
- MCP_TRANSPORT=streamable-http
|
||||||
- MCP_HOST=0.0.0.0
|
- MCP_HOST=0.0.0.0
|
||||||
- MCP_PORT=8000
|
- MCP_PORT=8000
|
||||||
|
- MCP_PATH=/
|
||||||
networks:
|
networks:
|
||||||
- caddy
|
- caddy
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
@ -73,6 +73,7 @@ def main():
|
|||||||
if transport == "streamable-http":
|
if transport == "streamable-http":
|
||||||
host = os.environ.get("MCP_HOST", "0.0.0.0")
|
host = os.environ.get("MCP_HOST", "0.0.0.0")
|
||||||
port = int(os.environ.get("MCP_PORT", "8000"))
|
port = int(os.environ.get("MCP_PORT", "8000"))
|
||||||
mcp.run(transport="streamable-http", host=host, port=port)
|
path = os.environ.get("MCP_PATH", "/mcp")
|
||||||
|
mcp.run(transport="streamable-http", host=host, port=port, path=path)
|
||||||
else:
|
else:
|
||||||
mcp.run()
|
mcp.run()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user