From 38739e5b0cfaaa2e76b4a6fb43e2305cea01f8b6 Mon Sep 17 00:00:00 2001 From: esgn <5435148+esgn@users.noreply.github.com> Date: Fri, 28 Nov 2025 11:26:44 +0100 Subject: [PATCH 1/2] feat(log): add geocontext log level --- agent.py | 5 +++-- docker-compose.yaml | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/agent.py b/agent.py index f94553f..ea756c5 100644 --- a/agent.py +++ b/agent.py @@ -34,14 +34,15 @@ async def build_graph(checkpointer=InMemorySaver()) -> CompiledStateGraph: env = os.environ.copy() proxy_vars = ["HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"] proxy_env = {var: env[var] for var in proxy_vars if var in env} - + log_level = env.get("GEOCONTEXT_LOG_LEVEL", "error") + client = MultiServerMCPClient( { "geocontext": { "command": "npx", "args": ["-y", "@ignfab/geocontext"], "transport": "stdio", - "env": {**proxy_env, "LOG_LEVEL": "error"} if proxy_env else {"LOG_LEVEL": "error"} + "env": {**proxy_env, "LOG_LEVEL": log_level} if proxy_env else {"LOG_LEVEL": log_level} }, "time": { "command": "uvx", diff --git a/docker-compose.yaml b/docker-compose.yaml index b4a0c71..9df3fb6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,6 +15,8 @@ services: - NO_PROXY=${NO_PROXY:-127.0.0.1,localhost} - DB_URI=postgresql://geocontext:${PGPASSWORD:-ChangeIt}@db:5432/geocontext - CONTACT_EMAIL=${CONTACT_EMAIL:-dev@localhost} + - GEOCONTEXT_LOG_LEVEL=${GEOCONTEXT_LOG_LEVEL:-error} + - LOG_LEVEL=${LOG_LEVEL:-INFO} read_only: true volumes: - site-tmp:/tmp From f0e75756eb6839c130b6f24440db56cbcd64b290 Mon Sep 17 00:00:00 2001 From: esgn <5435148+esgn@users.noreply.github.com> Date: Fri, 28 Nov 2025 11:30:56 +0100 Subject: [PATCH 2/2] chore(readme): add log levels to readme --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 16615a2..4f2397e 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,16 @@ Interactive demo for [ignfab/geocontext](https://github.com/ignfab/geocontext#re ## Parameters -| Name | Description | Default | -| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -| MODEL_NAME | The name of the model (see [LangGraph - create_react_agent](https://langchain-ai.github.io/langgraph/agents/models/#use-in-an-agent) / [init_chat_model](https://python.langchain.com/api_reference/langchain/chat_models/langchain.chat_models.base.init_chat_model.html)) | "anthropic:claude-3-7-sonnet-latest" | -| ANTHROPIC_API_KEY | Required from `anthropic:*` models (https://console.anthropic.com/settings/keys) | | -| GOOGLE_API_KEY | Required from `google_genai:*` models (https://aistudio.google.com/api-keys) | | -| TEMPERATURE | Model temperature | 0 | -| DB_URI | URL of the PostgreSQL (`postgresql://postgres:ChangeIt@localhost:5432/geocontext`) or Redis (ex : `redis://default:ChangeIt@localhost:6379/0`) database. | None (use InMemorySaver) | -| CONTACT_EMAIL | Email for the contact button. | "dev@localhost" | +| Name | Description | Default | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | +| MODEL_NAME | The name of the model (see [LangGraph - create_react_agent](https://langchain-ai.github.io/langgraph/agents/models/#use-in-an-agent) / [init_chat_model](https://python.langchain.com/api_reference/langchain/chat_models/langchain.chat_models.base.init_chat_model.html)) | "anthropic:claude-3-7-sonnet-latest" | +| ANTHROPIC_API_KEY | Required from `anthropic:*` models (https://console.anthropic.com/settings/keys) | | +| GOOGLE_API_KEY | Required from `google_genai:*` models (https://aistudio.google.com/api-keys) | | +| TEMPERATURE | Model temperature | 0 | +| DB_URI | URL of the PostgreSQL (`postgresql://postgres:ChangeIt@localhost:5432/geocontext`) or Redis (ex : `redis://default:ChangeIt@localhost:6379/0`) database. | None (use InMemorySaver) | +| CONTACT_EMAIL | Email for the contact button. | "dev@localhost" | +| GEOCONTEXT_LOG_LEVEL | Log level for Geocontext MCP. | error | +| LOG_LEVEL | Log level for this application. | INFO | > Note that "HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY" are supported if you have to use a corporate proxy.