Repository navigation
Serve the coach MCP from the main image at /mcp - #14
Merged
Merged
Conversation
Using the coach meant a second install: uv, a second .env with a token pasted in, a process to keep alive and a second port to expose. None of that was in the Docker quick start. The MCP now runs inside the backend process and is served at /mcp on the API's own port, so wherever the dashboard is reachable the coach is too, with nothing to configure. It still talks to the API over HTTP (loopback) with the caller's own token, so auth, user scoping and consent filtering stay one code path. A request without a bearer token is a 401. MCP_ENABLED=false turns the endpoint off. /mcp is dispatched ahead of the router and not mounted: a Starlette mount only matches /mcp/..., so a POST to the bare path fell through to the GET-only SPA catch-all and came back 405. The MCP's package is renamed app -> training_mcp, since the backend process already owns `app`, and its import-time logging setup moved into main(). It is a path dependency of the backend; fastmcp and the MCP SDK are held to the versions the MCP's own suite tests, which also keeps starlette where it was under the API. Running the MCP on its own (stdio, or a separate HTTP port) still works and is documented as the optional path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using the coach meant a second install:
uv, a second.envwith a token pasted in, a process to keep alive and a second port to expose. The Docker quick start mentioned none of it. The MCP now runs inside the backend process and is served at/mcpon the API's own port, so wherever the dashboard is reachable the coach is too, with nothing to configure.What changes
backend/app/mcp_mount.pyserves the MCP at/mcpand/mcp/. A request without a bearer token is a 401.MCP_ENABLED=falseturns it off.mcp/app→mcp/training_mcp, because the backend process already ownsapp. This is most of the diff. Its import-time logging setup moved intomain()so importing it doesn't reconfigure the host process.backend/uv.lock.fastmcpand the MCP SDK are held to the versions the MCP's own suite tests; unconstrained, the resolver also moved Starlette to 1.x under the API.uvprerequisite stated.Worth reviewing
/mcp/..., so a POST to the bare/mcpfell through to the GET-only SPA catch-all and came back 405.backend/pyproject.tomlhave to move together withmcp/uv.lock.Checked
tests/test_mcp_mount.py). MCP: its 14 tests pass./mcp; a bogus token got "rejected" on every data call; the dashboard and SPA routes still load.Upgrade note for standalone installs
uv run startis unaffected. An install that runs.venv/bin/startdirectly needs oneuv syncafter pulling.