Commit Graph
15 Commits
Author SHA1 Message Date
Anthony LC c9412f525b 🧑‍💻(makefile) add helper command for the docs-mcp
We added some helper commands to the Makefile to
facilitate the development of the docs-mcp.
These commands allow developers to easily
connect to the docs-mcp server with your
favorite LLM.
You can start the MCP Inspector with
`make mcp-inspector` to connect to the docs-mcp server and
inspect the different endpoints and their responses.
2026-09-11 15:23:34 +02:00
Anthony LC f9e30f1ccc (mcp) add the docs-mcp server
Add `src/frontend/servers/mcp`, a stateless TypeScript (Express +
`@modelcontextprotocol/sdk`) MCP server exposing `search_documents`,
`read_document` and `create_document` over Streamable HTTP.

It is an OAuth resource server holding no credentials of its own: it
verifies the caller's Keycloak token against the realm JWKS
(`src/auth/jwtVerifier.ts`), checks the `docs-mcp` audience, then
forwards the same token unchanged to Django's
`/api/v1.0/mcp/documents/*` endpoints (`src/docsApiClient.ts`),
which stays the sole authority on document permissions.
No token exchange.

Ship the `mcp-development` compose service, its `env.d/development/mcp`
env file, a `build-mcp` Makefile helper, and
`documentation/mcp_server.md` describing the full flow and
how to connect MCP clients.
2026-09-11 15:23:34 +02:00
Manuel Raynaud 451499016e ️(backend) increase nb_accesses cache TTL
The nb_accesses cache TTL was very short, 30 seconds. That mean that the
user will hit the cache for a very short period and the cache is
probably not be hit. This is what we can see in the slow queries from
the pg_stat_statements table. The query to compute the nb_accesses is
executed a little bit less than the number of queries to list or
retrieve documents, meaning the cache is not used.
2026-09-11 12:55:20 +02:00
Manuel RaynaudandGitHub 673a670dd9 🔧(backend) configure request.summary logger
The request.summary logger is used by dockerflow. The INFO level is
always empty and is used everytime the liveness or readiness endpoint
are fetch.
2026-09-09 14:46:19 +00:00
Manuel Raynaud 137cecc0e1 🔧(backend) fine tune redis cache options
We want to configure other options on the redis cache. By default there
is no timeout on the connection to socket and no timeout for read/write
operations. We set default values in all caches used in production. The
settings IGNORE_EXCEPTIONS differ between the default and the session
cache. Activating it behaves like a missed cache. Enabling it for the
session should lead to unwanted side effects, by returning falsy on the
session creation, a retry mechanism of 10000 attempts is made in the
SessionStore.create method, the request can stay in this loop for a long
time.
2026-09-08 16:26:15 +02:00
Manuel Raynaud 3bede0d9a0 🐛(backend) allow to configure settings DATA_UPLOAD_MAX_MEMORY_SIZE
Release 3.17.2 of DRF now takes care of DATA_UPLOAD_MAX_MEMORY_SIZE
and is checked when the body request is parsed. Before that, DRF wasn't
using it at all and we were only looking for custom settings linked to
the media and conversion file upload. We must now also configure this
setting.
2026-09-04 10:21:43 +02:00
Manuel Raynaud c69e790703 🔥(backend) remove whitenoise package
whitenoise middleware is failing a lot with a cancelled exception from
asyncio. Using whitenoise is not needed in our case, we are just serving
an API with django and DRF. We decided to completely remove it.
2026-09-03 08:25:15 +02:00
Manuel Raynaud f714c7fae3 (backend) profile api using django-silk
We have performance issue with the media_auth endpoint. We need to
monitor and profile this endpoint to understand what is happening. We
decided to install and configure django-silk. By default django-silk is
not enabled and not accessible, once enabled migration must be run and
the /silk/ endpoint will be accessible only using a super user.
To have relecant profiles and monitor we must have a database comparable
to a production one because we are facing a scaling issue. Unless a
million documents probably nothing is happening, for this we added
several management commands to help us. A first one to anonymize a
database than can be reused without any risk to leak PII data, can be
called using python manage.py anonymize_database with some mandatory
options. An other command to generate a database profile, this command
should be run on a production database, this profile can then be used by
the generate_volumetry to populate a development database with same
volumetry than describe in the profile.
2026-08-20 16:21:36 +02:00
virgile-devandGitHub 61c2183390 📝(docs) update readme (#2508)
Reflect new features and update screenshots

Signed-off-by: virgile-deville <virgile.deville@beta.gouv.fr>
2026-07-23 09:39:19 +00:00
exyoneandAnthony LC 126818fc15 🌐(i18n) rename cn_CN to zh_CN, add eo_PL and zh_TW locales
We have renamed the Chinese locale from `cn_CN`
to `zh_CN` to align with standard locale naming
conventions.
Additionally, we have added support for two new
locales: Esperanto (`eo_PL`) and
Traditional Chinese (`zh_TW`).
2026-07-21 10:19:01 +02:00
Manuel Raynaud 9c9daff027 📝(documentation) explain how conversion format can be configured
Create a dedicated documentation to explain how conversion format is
handled and how it can be configured. Docspec configuration is also
covered.
2026-07-06 08:55:22 +02:00
Manuel Raynaud 4ed0ac5ba9 📝(documentation) how to enable collaboration safe guard mechanism
We write a documentation explaining how to enable the safe guard
collaboration feature to prevent a user not connected to the websocket
to erase the data coming from users connected to the websocket.
2026-07-06 08:55:21 +02:00
Manuel Raynaud b01e6d58fd ♻️(core) fix typo in settings COLLABORATION_WS_NOT_CONNECTED_READY_ONLY
The settings COLLABORATION_WS_NOT_CONNECTED_READY_ONLY contains a typo.
We don't want to see READY_ONLY but READ_ONLY. This commit fix the typo
and change everywhere in the codebase the settings name.
2026-07-06 08:55:21 +02:00
Manuel Raynaud e0287a613e 📝(documentation) add documentation explaining how Docs uses S3
The S3 usage made by docs can be complex. We want to write a
documentation to explain the auth_request nginx module usage and list
known issues with the configuration.
2026-07-06 08:55:21 +02:00
Manuel Raynaud fd34a79d6d 📝(documentation) rename docs folder in documentation
We rename the docs folder into documentation, we think this new name is
more relevant and less confusing.
2026-07-06 08:55:20 +02:00